diff options
| author | NAKAMURA Takumi <geek4civic@gmail.com> | 2024-12-27 19:48:30 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-27 19:48:30 +0900 |
| commit | 223521b13e7465bc177f43e22de526b777d6ff74 (patch) | |
| tree | dfed43bba84ac0741bf9a2febd22ee9c478954ce /llvm/tools/llvm-cov/CodeCoverage.cpp | |
| parent | ac8bb7353a7fe79cd99b3c041d5a153517c31abc (diff) | |
| download | llvm-223521b13e7465bc177f43e22de526b777d6ff74.zip llvm-223521b13e7465bc177f43e22de526b777d6ff74.tar.gz llvm-223521b13e7465bc177f43e22de526b777d6ff74.tar.bz2 | |
llvm-cov: Introduce `--binary-counters` (#120841)
In `llvm-cov show`, this option rounds counters (line, branch) to
`[1,0]` at rendering. This will be useful when the number of counts
doesn't interest but **Covered/uncoverd** does.
Diffstat (limited to 'llvm/tools/llvm-cov/CodeCoverage.cpp')
| -rw-r--r-- | llvm/tools/llvm-cov/CodeCoverage.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/tools/llvm-cov/CodeCoverage.cpp b/llvm/tools/llvm-cov/CodeCoverage.cpp index 5db5c2e..921f283 100644 --- a/llvm/tools/llvm-cov/CodeCoverage.cpp +++ b/llvm/tools/llvm-cov/CodeCoverage.cpp @@ -1023,6 +1023,12 @@ int CodeCoverageTool::doShow(int argc, const char **argv, cl::alias ShowOutputDirectoryA("o", cl::desc("Alias for --output-dir"), cl::aliasopt(ShowOutputDirectory)); + cl::opt<bool> BinaryCounters( + "binary-counters", cl::Optional, + cl::desc("Show binary counters (1/0) in lines and branches instead of " + "integer execution counts"), + cl::cat(ViewCategory)); + cl::opt<uint32_t> TabSize( "tab-size", cl::init(2), cl::desc( @@ -1100,6 +1106,7 @@ int CodeCoverageTool::doShow(int argc, const char **argv, ViewOpts.ShowFunctionInstantiations = ShowInstantiations; ViewOpts.ShowDirectoryCoverage = ShowDirectoryCoverage; ViewOpts.ShowOutputDirectory = ShowOutputDirectory; + ViewOpts.BinaryCounters = BinaryCounters; ViewOpts.TabSize = TabSize; ViewOpts.ProjectTitle = ProjectTitle; |
