@@ -3,18 +3,26 @@ use rustc_attr_parsing::InstructionSetAttr;
3
3
use rustc_hir:: def_id:: DefId ;
4
4
use rustc_middle:: mir:: mono:: { Linkage , MonoItem , MonoItemData , Visibility } ;
5
5
use 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 } ;
7
7
use rustc_middle:: ty:: { Instance , Ty , TyCtxt } ;
8
8
use rustc_middle:: { bug, span_bug, ty} ;
9
9
use rustc_span:: sym;
10
10
use rustc_target:: callconv:: { ArgAbi , FnAbi , PassMode } ;
11
11
use rustc_target:: spec:: WasmCAbi ;
12
12
13
13
use 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 ,
18
26
mir : & Body < ' tcx > ,
19
27
instance : Instance < ' tcx > ,
20
28
) {
@@ -32,7 +40,7 @@ pub(crate) fn codegen_naked_asm<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
32
40
} ;
33
41
34
42
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 ( ) ;
36
44
37
45
let item_data = cx. codegen_unit ( ) . items ( ) . get ( & MonoItem :: Fn ( instance) ) . unwrap ( ) ;
38
46
let name = cx. mangled_name ( instance) ;
@@ -47,8 +55,8 @@ pub(crate) fn codegen_naked_asm<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
47
55
cx. codegen_global_asm ( & template_vec, & operands, options, line_spans) ;
48
56
}
49
57
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 ,
52
60
instance : Instance < ' tcx > ,
53
61
op : & InlineAsmOperand < ' tcx > ,
54
62
) -> GlobalAsmOperandRef < ' tcx > {
0 commit comments