1
1
use rustc_attr:: InstructionSetAttr ;
2
2
use rustc_middle:: mir:: mono:: { Linkage , MonoItem , MonoItemData , Visibility } ;
3
3
use rustc_middle:: mir:: { Body , InlineAsmOperand , START_BLOCK } ;
4
- use rustc_middle:: ty:: layout:: { HasTyCtxt , HasTypingEnv , LayoutOf } ;
4
+ use rustc_middle:: ty:: layout:: { LayoutOf , TyAndLayout } ;
5
5
use rustc_middle:: ty:: { Instance , TyCtxt } ;
6
6
use rustc_middle:: { bug, ty} ;
7
7
use rustc_span:: sym;
8
8
9
9
use crate :: common;
10
- use crate :: traits:: { AsmCodegenMethods , BuilderMethods , GlobalAsmOperandRef , MiscCodegenMethods } ;
10
+ use crate :: mir:: AsmCodegenMethods ;
11
+ use crate :: traits:: { GlobalAsmOperandRef , MiscCodegenMethods } ;
11
12
12
- pub ( crate ) fn codegen_naked_asm < ' a , ' tcx , Bx : BuilderMethods < ' a , ' tcx > > (
13
- cx : & ' a Bx :: CodegenCx ,
13
+ pub ( crate ) fn codegen_naked_asm <
14
+ ' a ,
15
+ ' tcx ,
16
+ Cx : LayoutOf < ' tcx , LayoutOfResult = TyAndLayout < ' tcx > >
17
+ + AsmCodegenMethods < ' tcx >
18
+ + MiscCodegenMethods < ' tcx > ,
19
+ > (
20
+ cx : & ' a Cx ,
14
21
mir : & Body < ' tcx > ,
15
22
instance : Instance < ' tcx > ,
16
23
) {
@@ -28,7 +35,7 @@ pub(crate) fn codegen_naked_asm<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
28
35
} ;
29
36
30
37
let operands: Vec < _ > =
31
- operands. iter ( ) . map ( |op| inline_to_global_operand :: < Bx > ( cx, instance, op) ) . collect ( ) ;
38
+ operands. iter ( ) . map ( |op| inline_to_global_operand :: < Cx > ( cx, instance, op) ) . collect ( ) ;
32
39
33
40
let item_data = cx. codegen_unit ( ) . items ( ) . get ( & MonoItem :: Fn ( instance) ) . unwrap ( ) ;
34
41
let name = cx. mangled_name ( instance) ;
@@ -42,8 +49,8 @@ pub(crate) fn codegen_naked_asm<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
42
49
cx. codegen_global_asm ( & template_vec, & operands, options, line_spans) ;
43
50
}
44
51
45
- fn inline_to_global_operand < ' a , ' tcx , Bx : BuilderMethods < ' a , ' tcx > > (
46
- cx : & ' a Bx :: CodegenCx ,
52
+ fn inline_to_global_operand < ' a , ' tcx , Cx : LayoutOf < ' tcx , LayoutOfResult = TyAndLayout < ' tcx > > > (
53
+ cx : & ' a Cx ,
47
54
instance : Instance < ' tcx > ,
48
55
op : & InlineAsmOperand < ' tcx > ,
49
56
) -> GlobalAsmOperandRef < ' tcx > {
0 commit comments