@@ -6,6 +6,7 @@ use cranelift_frontend::{FunctionBuilder, FunctionBuilderContext};
6
6
use cranelift_module:: ModuleError ;
7
7
use rustc_ast:: InlineAsmOptions ;
8
8
use rustc_codegen_ssa:: base:: is_call_from_compiler_builtins_to_upstream_monomorphization;
9
+ use rustc_data_structures:: profiling:: SelfProfilerRef ;
9
10
use rustc_index:: IndexVec ;
10
11
use rustc_middle:: middle:: codegen_fn_attrs:: CodegenFnAttrFlags ;
11
12
use rustc_middle:: mir:: InlineAsmMacro ;
@@ -170,12 +171,13 @@ pub(crate) fn codegen_fn<'tcx>(
170
171
171
172
pub ( crate ) fn compile_fn (
172
173
cx : & mut crate :: CodegenCx ,
174
+ profiler : & SelfProfilerRef ,
173
175
cached_context : & mut Context ,
174
176
module : & mut dyn Module ,
175
177
codegened_func : CodegenedFunction ,
176
178
) {
177
179
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 ) ;
179
181
180
182
let clif_comments = codegened_func. clif_comments ;
181
183
@@ -213,7 +215,7 @@ pub(crate) fn compile_fn(
213
215
} ;
214
216
215
217
// Define function
216
- cx . profiler . generic_activity ( "define function" ) . run ( || {
218
+ profiler. generic_activity ( "define function" ) . run ( || {
217
219
context. want_disasm = cx. should_write_ir ;
218
220
match module. define_function ( codegened_func. func_id , context) {
219
221
Ok ( ( ) ) => { }
@@ -254,7 +256,7 @@ pub(crate) fn compile_fn(
254
256
255
257
// Define debuginfo for function
256
258
let debug_context = & mut cx. debug_context ;
257
- cx . profiler . generic_activity ( "generate debug info" ) . run ( || {
259
+ profiler. generic_activity ( "generate debug info" ) . run ( || {
258
260
if let Some ( debug_context) = debug_context {
259
261
codegened_func. func_debug_cx . unwrap ( ) . finalize (
260
262
debug_context,
0 commit comments