@@ -27,7 +27,7 @@ use libc::{c_uint, c_char};
27
27
28
28
// Take an inline assembly expression and splat it out via LLVM
29
29
pub fn trans_inline_asm < ' a , ' tcx > (
30
- bcx : & Builder < ' a , ' tcx > ,
30
+ bx : & Builder < ' a , ' tcx > ,
31
31
ia : & hir:: InlineAsm ,
32
32
outputs : Vec < PlaceRef < ' tcx > > ,
33
33
mut inputs : Vec < ValueRef >
@@ -39,13 +39,13 @@ pub fn trans_inline_asm<'a, 'tcx>(
39
39
let mut indirect_outputs = vec ! [ ] ;
40
40
for ( i, ( out, place) ) in ia. outputs . iter ( ) . zip ( & outputs) . enumerate ( ) {
41
41
if out. is_rw {
42
- inputs. push ( place. load ( bcx ) . immediate ( ) ) ;
42
+ inputs. push ( place. load ( bx ) . immediate ( ) ) ;
43
43
ext_constraints. push ( i. to_string ( ) ) ;
44
44
}
45
45
if out. is_indirect {
46
- indirect_outputs. push ( place. load ( bcx ) . immediate ( ) ) ;
46
+ indirect_outputs. push ( place. load ( bx ) . immediate ( ) ) ;
47
47
} else {
48
- output_types. push ( place. layout . llvm_type ( bcx . ccx ) ) ;
48
+ output_types. push ( place. layout . llvm_type ( bx . cx ) ) ;
49
49
}
50
50
}
51
51
if !indirect_outputs. is_empty ( ) {
@@ -58,7 +58,7 @@ pub fn trans_inline_asm<'a, 'tcx>(
58
58
59
59
// Default per-arch clobbers
60
60
// Basically what clang does
61
- let arch_clobbers = match & bcx . sess ( ) . target . target . arch [ ..] {
61
+ let arch_clobbers = match & bx . sess ( ) . target . target . arch [ ..] {
62
62
"x86" | "x86_64" => vec ! [ "~{dirflag}" , "~{fpsr}" , "~{flags}" ] ,
63
63
_ => Vec :: new ( )
64
64
} ;
@@ -76,9 +76,9 @@ pub fn trans_inline_asm<'a, 'tcx>(
76
76
// Depending on how many outputs we have, the return type is different
77
77
let num_outputs = output_types. len ( ) ;
78
78
let output_type = match num_outputs {
79
- 0 => Type :: void ( bcx . ccx ) ,
79
+ 0 => Type :: void ( bx . cx ) ,
80
80
1 => output_types[ 0 ] ,
81
- _ => Type :: struct_ ( bcx . ccx , & output_types, false )
81
+ _ => Type :: struct_ ( bx . cx , & output_types, false )
82
82
} ;
83
83
84
84
let dialect = match ia. dialect {
@@ -88,7 +88,7 @@ pub fn trans_inline_asm<'a, 'tcx>(
88
88
89
89
let asm = CString :: new ( ia. asm . as_str ( ) . as_bytes ( ) ) . unwrap ( ) ;
90
90
let constraint_cstr = CString :: new ( all_constraints) . unwrap ( ) ;
91
- let r = bcx . inline_asm_call (
91
+ let r = bx . inline_asm_call (
92
92
asm. as_ptr ( ) ,
93
93
constraint_cstr. as_ptr ( ) ,
94
94
& inputs,
@@ -101,28 +101,28 @@ pub fn trans_inline_asm<'a, 'tcx>(
101
101
// Again, based on how many outputs we have
102
102
let outputs = ia. outputs . iter ( ) . zip ( & outputs) . filter ( |& ( ref o, _) | !o. is_indirect ) ;
103
103
for ( i, ( _, & place) ) in outputs. enumerate ( ) {
104
- let v = if num_outputs == 1 { r } else { bcx . extract_value ( r, i as u64 ) } ;
105
- OperandValue :: Immediate ( v) . store ( bcx , place) ;
104
+ let v = if num_outputs == 1 { r } else { bx . extract_value ( r, i as u64 ) } ;
105
+ OperandValue :: Immediate ( v) . store ( bx , place) ;
106
106
}
107
107
108
108
// Store mark in a metadata node so we can map LLVM errors
109
109
// back to source locations. See #17552.
110
110
unsafe {
111
111
let key = "srcloc" ;
112
- let kind = llvm:: LLVMGetMDKindIDInContext ( bcx . ccx . llcx ( ) ,
112
+ let kind = llvm:: LLVMGetMDKindIDInContext ( bx . cx . llcx ,
113
113
key. as_ptr ( ) as * const c_char , key. len ( ) as c_uint ) ;
114
114
115
- let val: llvm:: ValueRef = C_i32 ( bcx . ccx , ia. ctxt . outer ( ) . as_u32 ( ) as i32 ) ;
115
+ let val: llvm:: ValueRef = C_i32 ( bx . cx , ia. ctxt . outer ( ) . as_u32 ( ) as i32 ) ;
116
116
117
117
llvm:: LLVMSetMetadata ( r, kind,
118
- llvm:: LLVMMDNodeInContext ( bcx . ccx . llcx ( ) , & val, 1 ) ) ;
118
+ llvm:: LLVMMDNodeInContext ( bx . cx . llcx , & val, 1 ) ) ;
119
119
}
120
120
}
121
121
122
- pub fn trans_global_asm < ' a , ' tcx > ( ccx : & CrateContext < ' a , ' tcx > ,
122
+ pub fn trans_global_asm < ' a , ' tcx > ( cx : & CodegenCx < ' a , ' tcx > ,
123
123
ga : & hir:: GlobalAsm ) {
124
124
let asm = CString :: new ( ga. asm . as_str ( ) . as_bytes ( ) ) . unwrap ( ) ;
125
125
unsafe {
126
- llvm:: LLVMRustAppendModuleInlineAsm ( ccx . llmod ( ) , asm. as_ptr ( ) ) ;
126
+ llvm:: LLVMRustAppendModuleInlineAsm ( cx . llmod , asm. as_ptr ( ) ) ;
127
127
}
128
128
}
0 commit comments