@@ -307,6 +307,14 @@ impl<'a, 'gcc, 'tcx> AsmBuilderMethods<'tcx> for Builder<'a, 'gcc, 'tcx> {
307307 constants_len += string. len ( ) + att_dialect as usize ;
308308 }
309309
310+ InlineAsmOperandRef :: Const { value } => {
311+ inputs. push ( AsmInOperand {
312+ constraint : Cow :: Borrowed ( "is" ) ,
313+ rust_idx,
314+ val : value. immediate ( ) ,
315+ } ) ;
316+ }
317+
310318 InlineAsmOperandRef :: SymFn { instance } => {
311319 // TODO(@Amanieu): Additional mangling is needed on
312320 // some targets to add a leading underscore (Mach-O)
@@ -422,6 +430,10 @@ impl<'a, 'gcc, 'tcx> AsmBuilderMethods<'tcx> for Builder<'a, 'gcc, 'tcx> {
422430 // processed in the previous pass
423431 }
424432
433+ InlineAsmOperandRef :: Const { .. } => {
434+ // processed in the previous pass
435+ }
436+
425437 InlineAsmOperandRef :: Label { .. } => {
426438 // processed in the previous pass
427439 }
@@ -495,6 +507,15 @@ impl<'a, 'gcc, 'tcx> AsmBuilderMethods<'tcx> for Builder<'a, 'gcc, 'tcx> {
495507 push_to_template ( modifier, gcc_index) ;
496508 }
497509
510+ InlineAsmOperandRef :: Const { .. } => {
511+ let in_gcc_index = inputs
512+ . iter ( )
513+ . position ( |op| operand_idx == op. rust_idx )
514+ . expect ( "wrong rust index" ) ;
515+ let gcc_index = in_gcc_index + outputs. len ( ) ;
516+ push_to_template ( None , gcc_index) ;
517+ }
518+
498519 InlineAsmOperandRef :: SymFn { instance } => {
499520 // TODO(@Amanieu): Additional mangling is needed on
500521 // some targets to add a leading underscore (Mach-O)
0 commit comments