@@ -170,14 +170,15 @@ pub fn codegen_mir<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
170
170
) {
171
171
assert ! ( !instance. args. has_infer( ) ) ;
172
172
173
+ let tcx = cx. tcx ( ) ;
173
174
let llfn = cx. get_fn ( instance) ;
174
175
175
176
let mir = cx. tcx ( ) . instance_mir ( instance. def ) ;
176
177
177
178
let fn_abi = cx. fn_abi_of_instance ( instance, ty:: List :: empty ( ) ) ;
178
179
debug ! ( "fn_abi: {:?}" , fn_abi) ;
179
180
180
- if cx . tcx ( ) . codegen_fn_attrs ( instance. def_id ( ) ) . flags . contains ( CodegenFnAttrFlags :: NAKED ) {
181
+ if tcx. codegen_fn_attrs ( instance. def_id ( ) ) . flags . contains ( CodegenFnAttrFlags :: NAKED ) {
181
182
crate :: mir:: naked_asm:: codegen_naked_asm :: < Bx > ( cx, & mir, instance) ;
182
183
return ;
183
184
}
@@ -194,7 +195,7 @@ pub fn codegen_mir<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
194
195
}
195
196
196
197
let cleanup_kinds =
197
- base:: wants_new_eh_instructions ( cx . tcx ( ) . sess ) . then ( || analyze:: cleanup_kinds ( mir) ) ;
198
+ base:: wants_new_eh_instructions ( tcx. sess ) . then ( || analyze:: cleanup_kinds ( mir) ) ;
198
199
199
200
let cached_llbbs: IndexVec < mir:: BasicBlock , CachedLlbb < Bx :: BasicBlock > > =
200
201
mir. basic_blocks
@@ -217,7 +218,7 @@ pub fn codegen_mir<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
217
218
cleanup_kinds,
218
219
landing_pads : IndexVec :: from_elem ( None , & mir. basic_blocks ) ,
219
220
funclets : IndexVec :: from_fn_n ( |_| None , mir. basic_blocks . len ( ) ) ,
220
- cold_blocks : find_cold_blocks ( cx . tcx ( ) , mir) ,
221
+ cold_blocks : find_cold_blocks ( tcx, mir) ,
221
222
locals : locals:: Locals :: empty ( ) ,
222
223
debug_context,
223
224
per_local_var_debug_info : None ,
@@ -233,7 +234,7 @@ pub fn codegen_mir<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
233
234
fx. compute_per_local_var_debug_info ( & mut start_bx) . unzip ( ) ;
234
235
fx. per_local_var_debug_info = per_local_var_debug_info;
235
236
236
- let traversal_order = traversal:: mono_reachable_reverse_postorder ( mir, cx . tcx ( ) , instance) ;
237
+ let traversal_order = traversal:: mono_reachable_reverse_postorder ( mir, tcx, instance) ;
237
238
let memory_locals = analyze:: non_ssa_locals ( & fx, & traversal_order) ;
238
239
239
240
// Allocate variable and temp allocas
0 commit comments