@@ -36,7 +36,7 @@ pub(crate) fn codegen_and_compile_fn<'tcx>(
36
36
let cached_func = std:: mem:: replace ( & mut cached_context. func , Function :: new ( ) ) ;
37
37
let codegened_func = codegen_fn ( tcx, cx, cached_func, module, instance) ;
38
38
39
- compile_fn ( tcx , cx, cached_context, module, codegened_func) ;
39
+ compile_fn ( cx, cached_context, module, codegened_func) ;
40
40
}
41
41
42
42
fn codegen_fn < ' tcx > (
@@ -142,7 +142,6 @@ fn codegen_fn<'tcx>(
142
142
}
143
143
144
144
fn compile_fn < ' tcx > (
145
- tcx : TyCtxt < ' tcx > ,
146
145
cx : & mut crate :: CodegenCx < ' tcx > ,
147
146
cached_context : & mut Context ,
148
147
module : & mut dyn Module ,
@@ -193,7 +192,7 @@ fn compile_fn<'tcx>(
193
192
} ;
194
193
195
194
// Define function
196
- tcx . sess . time ( "define function" , || {
195
+ cx . profiler . verbose_generic_activity ( "define function" ) . run ( || {
197
196
context. want_disasm = cx. should_write_ir ;
198
197
module. define_function ( codegened_func. func_id , context) . unwrap ( ) ;
199
198
} ) ;
@@ -222,7 +221,7 @@ fn compile_fn<'tcx>(
222
221
let isa = module. isa ( ) ;
223
222
let debug_context = & mut cx. debug_context ;
224
223
let unwind_context = & mut cx. unwind_context ;
225
- tcx . sess . time ( "generate debug info" , || {
224
+ cx . profiler . verbose_generic_activity ( "generate debug info" ) . run ( || {
226
225
if let Some ( debug_context) = debug_context {
227
226
debug_context. define_function (
228
227
codegened_func. instance ,
0 commit comments