@@ -104,7 +104,7 @@ impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
104104 source_info : mir:: SourceInfo
105105 ) {
106106 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) ;
108108 }
109109
110110 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>>(
203203
204204 let fn_ty = cx. new_fn_type ( sig, & [ ] ) ;
205205 debug ! ( "fn_ty: {:?}" , fn_ty) ;
206- let debug_context =
206+ let mut debug_context =
207207 cx. create_function_debug_context ( instance, sig, llfn, mir) ;
208208 let mut bx = Bx :: new_block ( cx, llfn, "start" ) ;
209209
@@ -225,7 +225,7 @@ pub fn codegen_mir<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
225225 } ) . collect ( ) ;
226226
227227 // 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) ;
229229 let ( landing_pads, funclets) = create_funclets ( mir, & mut bx, & cleanup_kinds, & block_bxs) ;
230230
231231 let mut fx = FunctionCx {
@@ -253,7 +253,7 @@ pub fn codegen_mir<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
253253 // FIXME(dlrobertson): This is ugly. Find a better way of getting the `PlaceRef` or
254254 // `LocalRef` from `arg_local_refs`
255255 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) ;
257257 fx. va_list_ref = va_list_ref;
258258
259259 let mut allocate_local = |local| {
@@ -430,10 +430,6 @@ fn create_funclets<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
430430fn arg_local_refs < ' a , ' tcx : ' a , Bx : BuilderMethods < ' a , ' tcx > > (
431431 bx : & mut Bx ,
432432 fx : & FunctionCx < ' a , ' tcx , Bx > ,
433- scopes : & IndexVec <
434- mir:: SourceScope ,
435- debuginfo:: MirDebugScope < Bx :: DIScope >
436- > ,
437433 memory_locals : & BitSet < mir:: Local > ,
438434 va_list_ref : & mut Option < PlaceRef < ' tcx , Bx :: Value > > ,
439435) -> Vec < LocalRef < ' tcx , Bx :: Value > > {
@@ -443,7 +439,7 @@ fn arg_local_refs<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
443439 let mut llarg_idx = fx. fn_ty . ret . is_indirect ( ) as usize ;
444440
445441 // 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 ] ;
447443 let arg_scope = if bx. sess ( ) . opts . debuginfo == DebugInfo :: Full {
448444 arg_scope. scope_metadata
449445 } else {
0 commit comments