Skip to content

Commit 8ecbb04

Browse files
committed
Reland "[Coverage][llvm-cov] Enable MC/DC Support in LLVM Source-based Code Coverage (2/3)"
Part 2 of 3. This includes the Visualization and Evaluation components. Differential Revision: https://reviews.llvm.org/D138847
1 parent 14d7e0b commit 8ecbb04

34 files changed

+2253
-22
lines changed

clang/lib/CodeGen/CoverageMappingGen.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -1623,8 +1623,12 @@ static void dump(llvm::raw_ostream &OS, StringRef FunctionName,
16231623
OS << "Gap,";
16241624
break;
16251625
case CounterMappingRegion::BranchRegion:
1626+
case CounterMappingRegion::MCDCBranchRegion:
16261627
OS << "Branch,";
16271628
break;
1629+
case CounterMappingRegion::MCDCDecisionRegion:
1630+
OS << "Decision,";
1631+
break;
16281632
}
16291633

16301634
OS << "File " << R.FileID << ", " << R.LineStart << ":" << R.ColumnStart

llvm/docs/CommandGuide/llvm-cov.rst

+9
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,11 @@ OPTIONS
222222
Show coverage for branch conditions in terms of either count or percentage.
223223
The supported views are: "count", "percent".
224224

225+
.. option:: -show-mcdc
226+
227+
Show modified condition/decision coverage (MC/DC) for each applicable boolean
228+
expression.
229+
225230
.. option:: -show-line-counts
226231

227232
Show the execution counts for each line. Defaults to true, unless another
@@ -426,6 +431,10 @@ OPTIONS
426431

427432
Show statistics for all branch conditions. Defaults to true.
428433

434+
.. option:: -show-mcdc-summary
435+
436+
Show MC/DC statistics. Defaults to false.
437+
429438
.. option:: -show-functions
430439

431440
Show coverage summaries for each function. Defaults to false.

0 commit comments

Comments
 (0)