diff options
| author | Amanieu d'Antras <amanieu@gmail.com> | 2021-03-27 05:04:32 +0000 |
|---|---|---|
| committer | Amanieu d'Antras <amanieu@gmail.com> | 2021-03-30 02:10:28 +0100 |
| commit | 26d260bfa4a31df541ff1d4c24965730660b4114 (patch) | |
| tree | d1515135bac6e48886b4e4fe7a6873fcf2ca9b3c /compiler/rustc_middle/src/mir | |
| parent | 3debe9acb8df363e0b5363f23f8218c2d7919904 (diff) | |
| download | rust-26d260bfa4a31df541ff1d4c24965730660b4114.tar.gz rust-26d260bfa4a31df541ff1d4c24965730660b4114.zip | |
Run LLVM coverage instrumentation passes before optimization passes
This matches the behavior of Clang and allows us to remove several hacks which were needed to ensure functions weren't optimized away before reaching the instrumentation pass.
Diffstat (limited to 'compiler/rustc_middle/src/mir')
| -rw-r--r-- | compiler/rustc_middle/src/mir/mono.rs | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/compiler/rustc_middle/src/mir/mono.rs b/compiler/rustc_middle/src/mir/mono.rs index 0167655bee5..6c2468b9ffe 100644 --- a/compiler/rustc_middle/src/mir/mono.rs +++ b/compiler/rustc_middle/src/mir/mono.rs @@ -84,14 +84,7 @@ impl<'tcx> MonoItem<'tcx> { .debugging_opts .inline_in_all_cgus .unwrap_or_else(|| tcx.sess.opts.optimize != OptLevel::No) - && !tcx.sess.link_dead_code() - && !tcx.sess.instrument_coverage(); - // Disabled for `-Z instrument-coverage` because some LLVM optimizations can sometimes - // break coverage results. A test that failed at certain optimization levels is now - // validated at that optimization level (via `compile-flags` directive): - // * `src/test/run-make-fulldeps/coverage/closure.rs` broke with `-C opt-level=2`, and - // also required disabling `internalize_symbols` in - // `rustc_mir/monomorphize/partitioning/mod.rs` + && !tcx.sess.link_dead_code(); match *self { MonoItem::Fn(ref instance) => { |
