MC/DC in LLVM Source-based Code Coverage: Review 2/3
Background
I previously upstreamed work to enable Branch Coverage (https://reviews.llvm.org/D84467), which was pushed in early 2021. MC/DC (Modified Condition/Decision Coverage) is a planned enhancement to Source-based Code Coverage. Implementation was completed in May for our downstream Arm compiler, and in general use it has not yielded any issues.
Patches have been tested on windows (stage1) and linux/mac (stage1 and stage2). Fuchsia is not yet supported.
See attached file for Background, Motivation, Design, and Implementation Concepts:
See attached PDF for Technical Talk slides from 2022 LLVM Developers' Meeting:
I am also available at Discord @alanphipps
Review
This review is for the Visualization and Evaluation components
- Bitmask evaluation and MC/DC Region Analysis:
- CoverageMapping.h, CoverageMapping.cpp
- Creation of MC/DC Views with Records:
- CodeCoverage.cpp
- CoverageViewOptions.h
- Text, HTML Visualization:
- SourceCoverageView.h, SourceCoverageView.cpp
- SourceCoverageViewHTML.h, SourceCoverageViewHTML.cpp
- SourceCoverageViewText.h, SourceCoverageViewText.cpp
- Summary Report Generation:
- CoverageSummaryInfo.h, CoverageSummaryInfo.cpp
- CoverageReport.cpp
- JSON exporting:
- CoverageExporterJson.cpp
This is an uncommon include in LLVM. We usually use format, formatv, etc.