@@ -5,7 +5,7 @@ use rustc_codegen_ssa::traits::*;
55
66use crate :: common:: CodegenCx ;
77use crate :: llvm;
8- use crate :: llvm:: debuginfo:: { DIScope , DISubprogram } ;
8+ use crate :: llvm:: debuginfo:: DIScope ;
99use rustc_middle:: mir:: { Body , SourceScope } ;
1010use rustc_session:: config:: DebugInfo ;
1111
@@ -16,7 +16,7 @@ use rustc_index::vec::Idx;
1616pub fn compute_mir_scopes (
1717 cx : & CodegenCx < ' ll , ' _ > ,
1818 mir : & Body < ' _ > ,
19- fn_metadata : & ' ll DISubprogram ,
19+ fn_dbg_scope : & ' ll DIScope ,
2020 debug_context : & mut FunctionDebugContext < & ' ll DIScope > ,
2121) {
2222 // Find all the scopes with variables defined in them.
@@ -37,16 +37,16 @@ pub fn compute_mir_scopes(
3737 // Instantiate all scopes.
3838 for idx in 0 ..mir. source_scopes . len ( ) {
3939 let scope = SourceScope :: new ( idx) ;
40- make_mir_scope ( cx, & mir, fn_metadata , & has_variables, debug_context, scope) ;
40+ make_mir_scope ( cx, & mir, fn_dbg_scope , & has_variables, debug_context, scope) ;
4141 }
4242}
4343
4444fn make_mir_scope (
4545 cx : & CodegenCx < ' ll , ' _ > ,
4646 mir : & Body < ' _ > ,
47- fn_metadata : & ' ll DISubprogram ,
47+ fn_dbg_scope : & ' ll DIScope ,
4848 has_variables : & BitSet < SourceScope > ,
49- debug_context : & mut FunctionDebugContext < & ' ll DISubprogram > ,
49+ debug_context : & mut FunctionDebugContext < & ' ll DIScope > ,
5050 scope : SourceScope ,
5151) {
5252 if debug_context. scopes [ scope] . is_valid ( ) {
@@ -55,13 +55,13 @@ fn make_mir_scope(
5555
5656 let scope_data = & mir. source_scopes [ scope] ;
5757 let parent_scope = if let Some ( parent) = scope_data. parent_scope {
58- make_mir_scope ( cx, mir, fn_metadata , has_variables, debug_context, parent) ;
58+ make_mir_scope ( cx, mir, fn_dbg_scope , has_variables, debug_context, parent) ;
5959 debug_context. scopes [ parent]
6060 } else {
6161 // The root is the function itself.
6262 let loc = cx. lookup_debug_loc ( mir. span . lo ( ) ) ;
6363 debug_context. scopes [ scope] = DebugScope {
64- scope_metadata : Some ( fn_metadata ) ,
64+ scope_metadata : Some ( fn_dbg_scope ) ,
6565 file_start_pos : loc. file . start_pos ,
6666 file_end_pos : loc. file . end_pos ,
6767 } ;
0 commit comments