@@ -300,6 +300,14 @@ impl<'a, 'gcc, 'tcx> AsmBuilderMethods<'tcx> for Builder<'a, 'gcc, 'tcx> {
300300 constants_len += string. len ( ) + att_dialect as usize ;
301301 }
302302
303+ InlineAsmOperandRef :: Const { value } => {
304+ inputs. push ( AsmInOperand {
305+ constraint : Cow :: Borrowed ( "i" ) ,
306+ rust_idx,
307+ val : value. immediate ( ) ,
308+ } ) ;
309+ }
310+
303311 InlineAsmOperandRef :: SymFn { instance } => {
304312 // TODO(@Amanieu): Additional mangling is needed on
305313 // some targets to add a leading underscore (Mach-O)
@@ -415,6 +423,10 @@ impl<'a, 'gcc, 'tcx> AsmBuilderMethods<'tcx> for Builder<'a, 'gcc, 'tcx> {
415423 // processed in the previous pass
416424 }
417425
426+ InlineAsmOperandRef :: Const { .. } => {
427+ // processed in the previous pass
428+ }
429+
418430 InlineAsmOperandRef :: Label { .. } => {
419431 // processed in the previous pass
420432 }
@@ -488,6 +500,15 @@ impl<'a, 'gcc, 'tcx> AsmBuilderMethods<'tcx> for Builder<'a, 'gcc, 'tcx> {
488500 push_to_template ( modifier, gcc_index) ;
489501 }
490502
503+ InlineAsmOperandRef :: Const { .. } => {
504+ let in_gcc_index = inputs
505+ . iter ( )
506+ . position ( |op| operand_idx == op. rust_idx )
507+ . expect ( "wrong rust index" ) ;
508+ let gcc_index = in_gcc_index + outputs. len ( ) ;
509+ push_to_template ( None , gcc_index) ;
510+ }
511+
491512 InlineAsmOperandRef :: SymFn { instance } => {
492513 // TODO(@Amanieu): Additional mangling is needed on
493514 // some targets to add a leading underscore (Mach-O)
0 commit comments