@@ -3,18 +3,26 @@ use rustc_attr_parsing::InstructionSetAttr;
33use rustc_hir:: def_id:: DefId ;
44use rustc_middle:: mir:: mono:: { Linkage , MonoItem , MonoItemData , Visibility } ;
55use rustc_middle:: mir:: { Body , InlineAsmOperand , START_BLOCK } ;
6- use rustc_middle:: ty:: layout:: { FnAbiOf , HasTyCtxt , HasTypingEnv , LayoutOf } ;
6+ use rustc_middle:: ty:: layout:: { FnAbiOf , LayoutOf , TyAndLayout } ;
77use rustc_middle:: ty:: { Instance , Ty , TyCtxt } ;
88use rustc_middle:: { bug, span_bug, ty} ;
99use rustc_span:: sym;
1010use rustc_target:: callconv:: { ArgAbi , FnAbi , PassMode } ;
1111use rustc_target:: spec:: { BinaryFormat , WasmCAbi } ;
1212
1313use crate :: common;
14- use crate :: traits:: { AsmCodegenMethods , BuilderMethods , GlobalAsmOperandRef , MiscCodegenMethods } ;
15-
16- pub ( crate ) fn codegen_naked_asm < ' a , ' tcx , Bx : BuilderMethods < ' a , ' tcx > > (
17- cx : & ' a Bx :: CodegenCx ,
14+ use crate :: mir:: AsmCodegenMethods ;
15+ use crate :: traits:: { GlobalAsmOperandRef , MiscCodegenMethods } ;
16+
17+ pub ( crate ) fn codegen_naked_asm <
18+ ' a ,
19+ ' tcx ,
20+ Cx : LayoutOf < ' tcx , LayoutOfResult = TyAndLayout < ' tcx > >
21+ + FnAbiOf < ' tcx , FnAbiOfResult = & ' tcx FnAbi < ' tcx , Ty < ' tcx > > >
22+ + AsmCodegenMethods < ' tcx >
23+ + MiscCodegenMethods < ' tcx > ,
24+ > (
25+ cx : & ' a Cx ,
1826 mir : & Body < ' tcx > ,
1927 instance : Instance < ' tcx > ,
2028) {
@@ -32,7 +40,7 @@ pub(crate) fn codegen_naked_asm<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
3240 } ;
3341
3442 let operands: Vec < _ > =
35- operands. iter ( ) . map ( |op| inline_to_global_operand :: < Bx > ( cx, instance, op) ) . collect ( ) ;
43+ operands. iter ( ) . map ( |op| inline_to_global_operand :: < Cx > ( cx, instance, op) ) . collect ( ) ;
3644
3745 let item_data = cx. codegen_unit ( ) . items ( ) . get ( & MonoItem :: Fn ( instance) ) . unwrap ( ) ;
3846 let name = cx. mangled_name ( instance) ;
@@ -47,8 +55,8 @@ pub(crate) fn codegen_naked_asm<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
4755 cx. codegen_global_asm ( & template_vec, & operands, options, line_spans) ;
4856}
4957
50- fn inline_to_global_operand < ' a , ' tcx , Bx : BuilderMethods < ' a , ' tcx > > (
51- cx : & ' a Bx :: CodegenCx ,
58+ fn inline_to_global_operand < ' a , ' tcx , Cx : LayoutOf < ' tcx , LayoutOfResult = TyAndLayout < ' tcx > > > (
59+ cx : & ' a Cx ,
5260 instance : Instance < ' tcx > ,
5361 op : & InlineAsmOperand < ' tcx > ,
5462) -> GlobalAsmOperandRef < ' tcx > {
0 commit comments