mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-02 07:22:42 +00:00
coverage: Re-enable UnreachablePropagation
for coverage builds
This commit is contained in:
parent
54116c8cae
commit
1cca2529d1
@ -14,11 +14,7 @@ pub struct UnreachablePropagation;
|
||||
impl MirPass<'_> for UnreachablePropagation {
|
||||
fn is_enabled(&self, sess: &rustc_session::Session) -> bool {
|
||||
// Enable only under -Zmir-opt-level=2 as this can make programs less debuggable.
|
||||
|
||||
// FIXME(#116171) Coverage gets confused by MIR passes that can remove all
|
||||
// coverage statements from an instrumented function. This pass can be
|
||||
// re-enabled when coverage codegen is robust against that happening.
|
||||
sess.mir_opt_level() >= 2 && !sess.instrument_coverage()
|
||||
sess.mir_opt_level() >= 2
|
||||
}
|
||||
|
||||
fn run_pass<'tcx>(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
|
||||
|
@ -14,11 +14,11 @@ Number of expressions: 0
|
||||
Number of file 0 mappings: 1
|
||||
- Code(Counter(0)) at (prev + 17, 1) to (start + 1, 37)
|
||||
|
||||
Function name: unreachable::unreachable_intrinsic
|
||||
Raw bytes (9): 0x[01, 01, 00, 01, 01, 16, 01, 01, 2c]
|
||||
Function name: unreachable::unreachable_intrinsic (unused)
|
||||
Raw bytes (9): 0x[01, 01, 00, 01, 00, 16, 01, 01, 2c]
|
||||
Number of files: 1
|
||||
- file 0 => global file 1
|
||||
Number of expressions: 0
|
||||
Number of file 0 mappings: 1
|
||||
- Code(Counter(0)) at (prev + 22, 1) to (start + 1, 44)
|
||||
- Code(Zero) at (prev + 22, 1) to (start + 1, 44)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user