@@ -14,11 +14,11 @@ use crate::prelude::*;
14
14
use crate :: pretty_clif:: CommentWriter ;
15
15
16
16
struct CodegenedFunction < ' tcx > {
17
- instance : Instance < ' tcx > ,
18
17
symbol_name : SymbolName < ' tcx > ,
19
18
func_id : FuncId ,
20
19
func : Function ,
21
20
clif_comments : CommentWriter ,
21
+ function_span : Span ,
22
22
source_info_set : IndexSet < SourceInfo > ,
23
23
}
24
24
@@ -108,8 +108,8 @@ fn codegen_fn<'tcx>(
108
108
tcx. sess . time ( "codegen clif ir" , || codegen_fn_body ( & mut fx, start_block) ) ;
109
109
110
110
// Recover all necessary data from fx, before accessing func will prevent future access to it.
111
- let instance = fx. instance ;
112
111
let clif_comments = fx. clif_comments ;
112
+ let function_span = fx. mir . span ;
113
113
let source_info_set = fx. source_info_set ;
114
114
115
115
fx. constants_cx . finalize ( fx. tcx , & mut * fx. module ) ;
@@ -128,7 +128,7 @@ fn codegen_fn<'tcx>(
128
128
// Verify function
129
129
verify_func ( tcx, & clif_comments, & func) ;
130
130
131
- CodegenedFunction { instance , symbol_name, func_id, func, clif_comments, source_info_set }
131
+ CodegenedFunction { symbol_name, func_id, func, clif_comments, function_span , source_info_set }
132
132
}
133
133
134
134
fn compile_fn < ' tcx > (
@@ -214,10 +214,10 @@ fn compile_fn<'tcx>(
214
214
cx. profiler . verbose_generic_activity ( "generate debug info" ) . run ( || {
215
215
if let Some ( debug_context) = debug_context {
216
216
debug_context. define_function (
217
- codegened_func. instance ,
218
217
codegened_func. func_id ,
219
218
codegened_func. symbol_name . name ,
220
219
context,
220
+ codegened_func. function_span ,
221
221
& codegened_func. source_info_set ,
222
222
) ;
223
223
}
0 commit comments