rust/tests/mir-opt/instrument_coverage.bar.InstrumentCoverage.diff
Zalathar 6da319f635 coverage: Store all of a function's mappings in function coverage info
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.
2023-10-18 23:42:39 +11:00

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;
}
}