mirror of
https://github.com/rust-lang/rust.git
synced 2025-10-03 02:40:40 +00:00

Previously, mappings were attached to individual coverage statements in MIR. That necessitated special handling in MIR optimizations to avoid deleting those statements, since otherwise codegen would be unable to reassemble the original list of mappings. With this change, a function's list of mappings is now attached to its MIR body, and survives intact even if individual statements are deleted by optimizations.
16 lines
331 B
Diff
16 lines
331 B
Diff
- // MIR for `bar` before InstrumentCoverage
|
|
+ // MIR for `bar` after InstrumentCoverage
|
|
|
|
fn bar() -> bool {
|
|
let mut _0: bool;
|
|
|
|
+ coverage Counter(0) => /the/src/instrument_coverage.rs:20:1 - 22:2;
|
|
+
|
|
bb0: {
|
|
+ Coverage::CounterIncrement(0);
|
|
_0 = const true;
|
|
return;
|
|
}
|
|
}
|
|
|