@@ -276,6 +276,14 @@ impl<'a, 'gcc, 'tcx> AsmBuilderMethods<'tcx> for Builder<'a, 'gcc, 'tcx> {
276276 constants_len += string. len ( ) + att_dialect as usize ;
277277 }
278278
279+ InlineAsmOperandRef :: Const { value } => {
280+ inputs. push ( AsmInOperand {
281+ constraint : Cow :: Borrowed ( "i" ) ,
282+ rust_idx,
283+ val : value. immediate ( ) ,
284+ } ) ;
285+ }
286+
279287 InlineAsmOperandRef :: SymFn { instance } => {
280288 // TODO(@Amanieu): Additional mangling is needed on
281289 // some targets to add a leading underscore (Mach-O)
@@ -391,6 +399,10 @@ impl<'a, 'gcc, 'tcx> AsmBuilderMethods<'tcx> for Builder<'a, 'gcc, 'tcx> {
391399 // processed in the previous pass
392400 }
393401
402+ InlineAsmOperandRef :: Const { .. } => {
403+ // processed in the previous pass
404+ }
405+
394406 InlineAsmOperandRef :: Label { .. } => {
395407 // processed in the previous pass
396408 }
@@ -464,6 +476,15 @@ impl<'a, 'gcc, 'tcx> AsmBuilderMethods<'tcx> for Builder<'a, 'gcc, 'tcx> {
464476 push_to_template ( modifier, gcc_index) ;
465477 }
466478
479+ InlineAsmOperandRef :: Const { .. } => {
480+ let in_gcc_index = inputs
481+ . iter ( )
482+ . position ( |op| operand_idx == op. rust_idx )
483+ . expect ( "wrong rust index" ) ;
484+ let gcc_index = in_gcc_index + outputs. len ( ) ;
485+ push_to_template ( None , gcc_index) ;
486+ }
487+
467488 InlineAsmOperandRef :: SymFn { instance } => {
468489 // TODO(@Amanieu): Additional mangling is needed on
469490 // some targets to add a leading underscore (Mach-O)
0 commit comments