From 5ecbe7fcf8bceb91d43a21be872aaef44c01073a Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Mon, 5 Apr 2021 10:45:04 +0200 Subject: Explicitly register instrprof pass Don't use "passes" for this purpose, explicitly insert it into the correct place in the pipeline instead. --- compiler/rustc_codegen_ssa/src/back/write.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'compiler/rustc_codegen_ssa/src') diff --git a/compiler/rustc_codegen_ssa/src/back/write.rs b/compiler/rustc_codegen_ssa/src/back/write.rs index dce8ab6f026..dd50a298859 100644 --- a/compiler/rustc_codegen_ssa/src/back/write.rs +++ b/compiler/rustc_codegen_ssa/src/back/write.rs @@ -84,6 +84,7 @@ pub struct ModuleConfig { pub pgo_gen: SwitchWithOptPath, pub pgo_use: Option, + pub instrument_coverage: bool, pub sanitizer: SanitizerSet, pub sanitizer_recover: SanitizerSet, @@ -174,12 +175,6 @@ impl ModuleConfig { if sess.opts.debugging_opts.profile && !is_compiler_builtins { passes.push("insert-gcov-profiling".to_owned()); } - - // The rustc option `-Zinstrument_coverage` injects intrinsic calls to - // `llvm.instrprof.increment()`, which requires the LLVM `instrprof` pass. - if sess.instrument_coverage() { - passes.push("instrprof".to_owned()); - } passes }, vec![] @@ -193,6 +188,7 @@ impl ModuleConfig { SwitchWithOptPath::Disabled ), pgo_use: if_regular!(sess.opts.cg.profile_use.clone(), None), + instrument_coverage: if_regular!(sess.instrument_coverage(), false), sanitizer: if_regular!(sess.opts.debugging_opts.sanitizer, SanitizerSet::empty()), sanitizer_recover: if_regular!( -- cgit 1.4.1-3-g733a5