@@ -6,6 +6,7 @@ use cranelift_frontend::{FunctionBuilder, FunctionBuilderContext};
66use cranelift_module:: ModuleError ;
77use rustc_ast:: InlineAsmOptions ;
88use rustc_codegen_ssa:: base:: is_call_from_compiler_builtins_to_upstream_monomorphization;
9+ use rustc_data_structures:: profiling:: SelfProfilerRef ;
910use rustc_index:: IndexVec ;
1011use rustc_middle:: middle:: codegen_fn_attrs:: CodegenFnAttrFlags ;
1112use rustc_middle:: mir:: InlineAsmMacro ;
@@ -170,12 +171,13 @@ pub(crate) fn codegen_fn<'tcx>(
170171
171172pub ( crate ) fn compile_fn (
172173 cx : & mut crate :: CodegenCx ,
174+ profiler : & SelfProfilerRef ,
173175 cached_context : & mut Context ,
174176 module : & mut dyn Module ,
175177 codegened_func : CodegenedFunction ,
176178) {
177179 let _timer =
178- cx . profiler . generic_activity_with_arg ( "compile function" , & * codegened_func. symbol_name ) ;
180+ profiler. generic_activity_with_arg ( "compile function" , & * codegened_func. symbol_name ) ;
179181
180182 let clif_comments = codegened_func. clif_comments ;
181183
@@ -213,7 +215,7 @@ pub(crate) fn compile_fn(
213215 } ;
214216
215217 // Define function
216- cx . profiler . generic_activity ( "define function" ) . run ( || {
218+ profiler. generic_activity ( "define function" ) . run ( || {
217219 context. want_disasm = cx. should_write_ir ;
218220 match module. define_function ( codegened_func. func_id , context) {
219221 Ok ( ( ) ) => { }
@@ -254,7 +256,7 @@ pub(crate) fn compile_fn(
254256
255257 // Define debuginfo for function
256258 let debug_context = & mut cx. debug_context ;
257- cx . profiler . generic_activity ( "generate debug info" ) . run ( || {
259+ profiler. generic_activity ( "generate debug info" ) . run ( || {
258260 if let Some ( debug_context) = debug_context {
259261 codegened_func. func_debug_cx . unwrap ( ) . finalize (
260262 debug_context,
0 commit comments