@@ -298,6 +298,14 @@ impl<'a, 'gcc, 'tcx> AsmBuilderMethods<'tcx> for Builder<'a, 'gcc, 'tcx> {
298
298
constants_len += string. len ( ) + att_dialect as usize ;
299
299
}
300
300
301
+ InlineAsmOperandRef :: Const { value } => {
302
+ inputs. push ( AsmInOperand {
303
+ constraint : Cow :: Borrowed ( "i" ) ,
304
+ rust_idx,
305
+ val : value. immediate ( ) ,
306
+ } ) ;
307
+ }
308
+
301
309
InlineAsmOperandRef :: SymFn { instance } => {
302
310
// TODO(@Amanieu): Additional mangling is needed on
303
311
// some targets to add a leading underscore (Mach-O)
@@ -413,6 +421,10 @@ impl<'a, 'gcc, 'tcx> AsmBuilderMethods<'tcx> for Builder<'a, 'gcc, 'tcx> {
413
421
// processed in the previous pass
414
422
}
415
423
424
+ InlineAsmOperandRef :: Const { .. } => {
425
+ // processed in the previous pass
426
+ }
427
+
416
428
InlineAsmOperandRef :: Label { .. } => {
417
429
// processed in the previous pass
418
430
}
@@ -486,6 +498,15 @@ impl<'a, 'gcc, 'tcx> AsmBuilderMethods<'tcx> for Builder<'a, 'gcc, 'tcx> {
486
498
push_to_template ( modifier, gcc_index) ;
487
499
}
488
500
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
+
489
510
InlineAsmOperandRef :: SymFn { instance } => {
490
511
// TODO(@Amanieu): Additional mangling is needed on
491
512
// some targets to add a leading underscore (Mach-O)
0 commit comments