@@ -104,7 +104,7 @@ impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
104
104
source_info : mir:: SourceInfo
105
105
) {
106
106
let ( scope, span) = self . debug_loc ( source_info) ;
107
- bx. set_source_location ( & self . debug_context , scope, span) ;
107
+ bx. set_source_location ( & mut self . debug_context , scope, span) ;
108
108
}
109
109
110
110
pub fn debug_loc ( & self , source_info : mir:: SourceInfo ) -> ( Option < Bx :: DIScope > , Span ) {
@@ -203,7 +203,7 @@ pub fn codegen_mir<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
203
203
204
204
let fn_ty = cx. new_fn_type ( sig, & [ ] ) ;
205
205
debug ! ( "fn_ty: {:?}" , fn_ty) ;
206
- let debug_context =
206
+ let mut debug_context =
207
207
cx. create_function_debug_context ( instance, sig, llfn, mir) ;
208
208
let mut bx = Bx :: new_block ( cx, llfn, "start" ) ;
209
209
@@ -225,7 +225,7 @@ pub fn codegen_mir<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
225
225
} ) . collect ( ) ;
226
226
227
227
// Compute debuginfo scopes from MIR scopes.
228
- let scopes = cx. create_mir_scopes ( mir, & debug_context) ;
228
+ let scopes = cx. create_mir_scopes ( mir, & mut debug_context) ;
229
229
let ( landing_pads, funclets) = create_funclets ( mir, & mut bx, & cleanup_kinds, & block_bxs) ;
230
230
231
231
let mut fx = FunctionCx {
@@ -253,7 +253,7 @@ pub fn codegen_mir<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
253
253
// FIXME(dlrobertson): This is ugly. Find a better way of getting the `PlaceRef` or
254
254
// `LocalRef` from `arg_local_refs`
255
255
let mut va_list_ref = None ;
256
- let args = arg_local_refs ( & mut bx, & fx, & fx . scopes , & memory_locals, & mut va_list_ref) ;
256
+ let args = arg_local_refs ( & mut bx, & fx, & memory_locals, & mut va_list_ref) ;
257
257
fx. va_list_ref = va_list_ref;
258
258
259
259
let mut allocate_local = |local| {
@@ -430,10 +430,6 @@ fn create_funclets<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
430
430
fn arg_local_refs < ' a , ' tcx : ' a , Bx : BuilderMethods < ' a , ' tcx > > (
431
431
bx : & mut Bx ,
432
432
fx : & FunctionCx < ' a , ' tcx , Bx > ,
433
- scopes : & IndexVec <
434
- mir:: SourceScope ,
435
- debuginfo:: MirDebugScope < Bx :: DIScope >
436
- > ,
437
433
memory_locals : & BitSet < mir:: Local > ,
438
434
va_list_ref : & mut Option < PlaceRef < ' tcx , Bx :: Value > > ,
439
435
) -> Vec < LocalRef < ' tcx , Bx :: Value > > {
@@ -443,7 +439,7 @@ fn arg_local_refs<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
443
439
let mut llarg_idx = fx. fn_ty . ret . is_indirect ( ) as usize ;
444
440
445
441
// Get the argument scope, if it exists and if we need it.
446
- let arg_scope = scopes[ mir:: OUTERMOST_SOURCE_SCOPE ] ;
442
+ let arg_scope = fx . scopes [ mir:: OUTERMOST_SOURCE_SCOPE ] ;
447
443
let arg_scope = if bx. sess ( ) . opts . debuginfo == DebugInfo :: Full {
448
444
arg_scope. scope_metadata
449
445
} else {
0 commit comments