@@ -14,11 +14,11 @@ use crate::prelude::*;
1414use crate :: pretty_clif:: CommentWriter ;
1515
1616struct CodegenedFunction < ' tcx > {
17- instance : Instance < ' tcx > ,
1817 symbol_name : SymbolName < ' tcx > ,
1918 func_id : FuncId ,
2019 func : Function ,
2120 clif_comments : CommentWriter ,
21+ function_span : Span ,
2222 source_info_set : IndexSet < SourceInfo > ,
2323}
2424
@@ -108,8 +108,8 @@ fn codegen_fn<'tcx>(
108108 tcx. sess . time ( "codegen clif ir" , || codegen_fn_body ( & mut fx, start_block) ) ;
109109
110110 // Recover all necessary data from fx, before accessing func will prevent future access to it.
111- let instance = fx. instance ;
112111 let clif_comments = fx. clif_comments ;
112+ let function_span = fx. mir . span ;
113113 let source_info_set = fx. source_info_set ;
114114
115115 fx. constants_cx . finalize ( fx. tcx , & mut * fx. module ) ;
@@ -128,7 +128,7 @@ fn codegen_fn<'tcx>(
128128 // Verify function
129129 verify_func ( tcx, & clif_comments, & func) ;
130130
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 }
132132}
133133
134134fn compile_fn < ' tcx > (
@@ -214,10 +214,10 @@ fn compile_fn<'tcx>(
214214 cx. profiler . verbose_generic_activity ( "generate debug info" ) . run ( || {
215215 if let Some ( debug_context) = debug_context {
216216 debug_context. define_function (
217- codegened_func. instance ,
218217 codegened_func. func_id ,
219218 codegened_func. symbol_name . name ,
220219 context,
220+ codegened_func. function_span ,
221221 & codegened_func. source_info_set ,
222222 ) ;
223223 }
0 commit comments