@@ -36,7 +36,7 @@ pub(crate) fn codegen_and_compile_fn<'tcx>(
3636 let cached_func = std:: mem:: replace ( & mut cached_context. func , Function :: new ( ) ) ;
3737 let codegened_func = codegen_fn ( tcx, cx, cached_func, module, instance) ;
3838
39- compile_fn ( tcx , cx, cached_context, module, codegened_func) ;
39+ compile_fn ( cx, cached_context, module, codegened_func) ;
4040}
4141
4242fn codegen_fn < ' tcx > (
@@ -142,7 +142,6 @@ fn codegen_fn<'tcx>(
142142}
143143
144144fn compile_fn < ' tcx > (
145- tcx : TyCtxt < ' tcx > ,
146145 cx : & mut crate :: CodegenCx < ' tcx > ,
147146 cached_context : & mut Context ,
148147 module : & mut dyn Module ,
@@ -193,7 +192,7 @@ fn compile_fn<'tcx>(
193192 } ;
194193
195194 // Define function
196- tcx . sess . time ( "define function" , || {
195+ cx . profiler . verbose_generic_activity ( "define function" ) . run ( || {
197196 context. want_disasm = cx. should_write_ir ;
198197 module. define_function ( codegened_func. func_id , context) . unwrap ( ) ;
199198 } ) ;
@@ -222,7 +221,7 @@ fn compile_fn<'tcx>(
222221 let isa = module. isa ( ) ;
223222 let debug_context = & mut cx. debug_context ;
224223 let unwind_context = & mut cx. unwind_context ;
225- tcx . sess . time ( "generate debug info" , || {
224+ cx . profiler . verbose_generic_activity ( "generate debug info" ) . run ( || {
226225 if let Some ( debug_context) = debug_context {
227226 debug_context. define_function (
228227 codegened_func. instance ,
0 commit comments