about summary refs log tree commit diff
path: root/compiler/rustc_mir_build/src/build/coverageinfo.rs
AgeCommit message (Collapse)AuthorLines
2024-12-17Rename `rustc_mir_build::build` to `builder`Zalathar-310/+0
2024-10-08coverage. Adapt to mcdc mapping formats introduced by llvm 19zhuyunxing-3/+3
2024-07-05coverage: Rename `mir::coverage::BranchInfo` to `CoverageInfoHi`Zalathar-47/+60
This opens the door to collecting and storing coverage information that is unrelated to branch coverage or MC/DC.
2024-06-19coverage: Make MCDC take in account last RHS of condition-coverageDorian Péron-23/+45
Condition coverage extends branch coverage to treat the specific case of last operands of boolean decisions not involved in control flow. This is ultimately made for MCDC to be exhaustive on all boolean expressions. This patch adds a call to `visit_branch_coverage_operation` to track the top-level operand of the said decisions, and changes `visit_coverage_standalone_condition` so MCDC branch registration is called when enabled on these _last RHS_ cases.
2024-05-30coverage: Instrument the RHS value of lazy logical operatorsZalathar-0/+57
When a lazy logical operator (`&&` or `||`) occurs outside of an `if` condition, it normally doesn't have any associated control-flow branch, so we don't have an existing way to track whether it was true or false. This patch adds special code to handle this case, by inserting extra MIR blocks in a diamond shape after evaluating the RHS. This gives us a place to insert the appropriate marker statements, which can then be given their own counters.
2024-04-30coverage: Add branch coverage support for if-let and let-chainsZalathar-1/+1
2024-04-30coverage: Add branch coverage support for let-elseZalathar-3/+23
2024-04-30coverage. Split mcdc builder to a sub module of coverageinfozhuyunxing-269/+4
2024-04-30coverage. Add MCDCInfoBuilder to isolate all mcdc stuff from BranchInfoBuilderzhuyunxing-86/+110
2024-04-30coverage. Add BlockMarkerGen to avoid ownership gymnasticszhuyunxing-29/+35
2024-04-29mcdc-coverage: Get decision_depth from THIR loweringDorian Péron-17/+60
Use decision context stack to handle nested decisions: - Introduce MCDCDecisionCtx - Use a stack of MCDCDecisionCtx to handle nested decisions
2024-04-29mcdc-coverage: Add decision_depth field in structsDorian Péron-0/+2
Add decision_depth field to TVBitmapUpdate/CondBitmapUpdate statements Add decision_depth field to BcbMappingKinds MCDCBranch and MCDCDecision Add decision_depth field to MCDCBranchSpan and MCDCDecisionSpan
2024-04-22coverage: Move some helper code into `BranchInfoBuilder`Zalathar-26/+40
2024-04-22coverage: Detach MC/DC branch spans from regular branch spansZalathar-27/+20
MC/DC's reliance on the existing branch coverage types is making it much harder to improve branch coverage.
2024-04-19coverage. Generate Mappings of decisions and conditions for MC/DCzhuyunxing-10/+245
2024-03-23Unbox and unwrap the contents of `StatementKind::Coverage`Zalathar-3/+1
The payload of coverage statements was historically a structure with several fields, so it was boxed to avoid bloating `StatementKind`. Now that the payload is a single relatively-small enum, we can replace `Box<Coverage>` with just `CoverageKind`. This patch also adds a size assertion for `StatementKind`, to avoid accidentally bloating it in the future.
2024-03-14coverage: Record branch information during MIR buildingZalathar-4/+120
2024-03-14coverage: Data structures for recording branch info during MIR buildingZalathar-0/+32