@@ -298,6 +298,14 @@ impl<'a, 'gcc, 'tcx> AsmBuilderMethods<'tcx> for Builder<'a, 'gcc, 'tcx> {
298298 constants_len += string. len ( ) + att_dialect as usize ;
299299 }
300300
301+ InlineAsmOperandRef :: Const { value } => {
302+ inputs. push ( AsmInOperand {
303+ constraint : Cow :: Borrowed ( "i" ) ,
304+ rust_idx,
305+ val : value. immediate ( ) ,
306+ } ) ;
307+ }
308+
301309 InlineAsmOperandRef :: SymFn { instance } => {
302310 // TODO(@Amanieu): Additional mangling is needed on
303311 // some targets to add a leading underscore (Mach-O)
@@ -413,6 +421,10 @@ impl<'a, 'gcc, 'tcx> AsmBuilderMethods<'tcx> for Builder<'a, 'gcc, 'tcx> {
413421 // processed in the previous pass
414422 }
415423
424+ InlineAsmOperandRef :: Const { .. } => {
425+ // processed in the previous pass
426+ }
427+
416428 InlineAsmOperandRef :: Label { .. } => {
417429 // processed in the previous pass
418430 }
@@ -486,6 +498,15 @@ impl<'a, 'gcc, 'tcx> AsmBuilderMethods<'tcx> for Builder<'a, 'gcc, 'tcx> {
486498 push_to_template ( modifier, gcc_index) ;
487499 }
488500
501+ InlineAsmOperandRef :: Const { .. } => {
502+ let in_gcc_index = inputs
503+ . iter ( )
504+ . position ( |op| operand_idx == op. rust_idx )
505+ . expect ( "wrong rust index" ) ;
506+ let gcc_index = in_gcc_index + outputs. len ( ) ;
507+ push_to_template ( None , gcc_index) ;
508+ }
509+
489510 InlineAsmOperandRef :: SymFn { instance } => {
490511 // TODO(@Amanieu): Additional mangling is needed on
491512 // some targets to add a leading underscore (Mach-O)
0 commit comments