@@ -27,7 +27,7 @@ use libc::{c_uint, c_char};
2727
2828// Take an inline assembly expression and splat it out via LLVM
2929pub fn trans_inline_asm < ' a , ' tcx > (
30- bcx : & Builder < ' a , ' tcx > ,
30+ bx : & Builder < ' a , ' tcx > ,
3131 ia : & hir:: InlineAsm ,
3232 outputs : Vec < PlaceRef < ' tcx > > ,
3333 mut inputs : Vec < ValueRef >
@@ -39,13 +39,13 @@ pub fn trans_inline_asm<'a, 'tcx>(
3939 let mut indirect_outputs = vec ! [ ] ;
4040 for ( i, ( out, place) ) in ia. outputs . iter ( ) . zip ( & outputs) . enumerate ( ) {
4141 if out. is_rw {
42- inputs. push ( place. load ( bcx ) . immediate ( ) ) ;
42+ inputs. push ( place. load ( bx ) . immediate ( ) ) ;
4343 ext_constraints. push ( i. to_string ( ) ) ;
4444 }
4545 if out. is_indirect {
46- indirect_outputs. push ( place. load ( bcx ) . immediate ( ) ) ;
46+ indirect_outputs. push ( place. load ( bx ) . immediate ( ) ) ;
4747 } else {
48- output_types. push ( place. layout . llvm_type ( bcx . ccx ) ) ;
48+ output_types. push ( place. layout . llvm_type ( bx . cx ) ) ;
4949 }
5050 }
5151 if !indirect_outputs. is_empty ( ) {
@@ -58,7 +58,7 @@ pub fn trans_inline_asm<'a, 'tcx>(
5858
5959 // Default per-arch clobbers
6060 // Basically what clang does
61- let arch_clobbers = match & bcx . sess ( ) . target . target . arch [ ..] {
61+ let arch_clobbers = match & bx . sess ( ) . target . target . arch [ ..] {
6262 "x86" | "x86_64" => vec ! [ "~{dirflag}" , "~{fpsr}" , "~{flags}" ] ,
6363 _ => Vec :: new ( )
6464 } ;
@@ -76,9 +76,9 @@ pub fn trans_inline_asm<'a, 'tcx>(
7676 // Depending on how many outputs we have, the return type is different
7777 let num_outputs = output_types. len ( ) ;
7878 let output_type = match num_outputs {
79- 0 => Type :: void ( bcx . ccx ) ,
79+ 0 => Type :: void ( bx . cx ) ,
8080 1 => output_types[ 0 ] ,
81- _ => Type :: struct_ ( bcx . ccx , & output_types, false )
81+ _ => Type :: struct_ ( bx . cx , & output_types, false )
8282 } ;
8383
8484 let dialect = match ia. dialect {
@@ -88,7 +88,7 @@ pub fn trans_inline_asm<'a, 'tcx>(
8888
8989 let asm = CString :: new ( ia. asm . as_str ( ) . as_bytes ( ) ) . unwrap ( ) ;
9090 let constraint_cstr = CString :: new ( all_constraints) . unwrap ( ) ;
91- let r = bcx . inline_asm_call (
91+ let r = bx . inline_asm_call (
9292 asm. as_ptr ( ) ,
9393 constraint_cstr. as_ptr ( ) ,
9494 & inputs,
@@ -101,28 +101,28 @@ pub fn trans_inline_asm<'a, 'tcx>(
101101 // Again, based on how many outputs we have
102102 let outputs = ia. outputs . iter ( ) . zip ( & outputs) . filter ( |& ( ref o, _) | !o. is_indirect ) ;
103103 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) ;
106106 }
107107
108108 // Store mark in a metadata node so we can map LLVM errors
109109 // back to source locations. See #17552.
110110 unsafe {
111111 let key = "srcloc" ;
112- let kind = llvm:: LLVMGetMDKindIDInContext ( bcx . ccx . llcx ( ) ,
112+ let kind = llvm:: LLVMGetMDKindIDInContext ( bx . cx . llcx ,
113113 key. as_ptr ( ) as * const c_char , key. len ( ) as c_uint ) ;
114114
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 ) ;
116116
117117 llvm:: LLVMSetMetadata ( r, kind,
118- llvm:: LLVMMDNodeInContext ( bcx . ccx . llcx ( ) , & val, 1 ) ) ;
118+ llvm:: LLVMMDNodeInContext ( bx . cx . llcx , & val, 1 ) ) ;
119119 }
120120}
121121
122- pub fn trans_global_asm < ' a , ' tcx > ( ccx : & CrateContext < ' a , ' tcx > ,
122+ pub fn trans_global_asm < ' a , ' tcx > ( cx : & CodegenCx < ' a , ' tcx > ,
123123 ga : & hir:: GlobalAsm ) {
124124 let asm = CString :: new ( ga. asm . as_str ( ) . as_bytes ( ) ) . unwrap ( ) ;
125125 unsafe {
126- llvm:: LLVMRustAppendModuleInlineAsm ( ccx . llmod ( ) , asm. as_ptr ( ) ) ;
126+ llvm:: LLVMRustAppendModuleInlineAsm ( cx . llmod , asm. as_ptr ( ) ) ;
127127 }
128128}
0 commit comments