Skip to content

Commit

Permalink
Reland "[Coverage][llvm-cov] Enable MC/DC Support in LLVM Source-base…
Browse files Browse the repository at this point in the history
…d Code Coverage (2/3)"

Part 2 of 3. This includes the Visualization and Evaluation components.

Differential Revision: https://reviews.llvm.org/D138847
  • Loading branch information
evodius96 committed Dec 13, 2023
1 parent 14d7e0b commit 8ecbb04
Show file tree
Hide file tree
Showing 34 changed files with 2,253 additions and 22 deletions.
4 changes: 4 additions & 0 deletions clang/lib/CodeGen/CoverageMappingGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1623,8 +1623,12 @@ static void dump(llvm::raw_ostream &OS, StringRef FunctionName,
OS << "Gap,";
break;
case CounterMappingRegion::BranchRegion:
case CounterMappingRegion::MCDCBranchRegion:
OS << "Branch,";
break;
case CounterMappingRegion::MCDCDecisionRegion:
OS << "Decision,";
break;
}

OS << "File " << R.FileID << ", " << R.LineStart << ":" << R.ColumnStart
Expand Down
9 changes: 9 additions & 0 deletions llvm/docs/CommandGuide/llvm-cov.rst
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,11 @@ OPTIONS
Show coverage for branch conditions in terms of either count or percentage.
The supported views are: "count", "percent".

.. option:: -show-mcdc

Show modified condition/decision coverage (MC/DC) for each applicable boolean
expression.

.. option:: -show-line-counts

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

Show statistics for all branch conditions. Defaults to true.

.. option:: -show-mcdc-summary

Show MC/DC statistics. Defaults to false.

.. option:: -show-functions

Show coverage summaries for each function. Defaults to false.
Expand Down
Loading

0 comments on commit 8ecbb04

Please sign in to comment.