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/SourceCoverageViewText.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/SourceCoverageViewText.cpp')
-rw-r--r-- | llvm/tools/llvm-cov/SourceCoverageViewText.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/tools/llvm-cov/SourceCoverageViewText.cpp b/llvm/tools/llvm-cov/SourceCoverageViewText.cpp index 63f8248..765f8bb 100644 --- a/llvm/tools/llvm-cov/SourceCoverageViewText.cpp +++ b/llvm/tools/llvm-cov/SourceCoverageViewText.cpp @@ -216,7 +216,7 @@ void SourceCoverageViewText::renderLineCoverageColumn( OS.indent(LineCoverageColumnWidth) << '|'; return; } - std::string C = formatCount(Line.getExecutionCount()); + std::string C = formatBinaryCount(Line.getExecutionCount()); OS.indent(LineCoverageColumnWidth - C.size()); colored_ostream(OS, raw_ostream::MAGENTA, Line.hasMultipleRegions() && getOptions().Colors) @@ -263,7 +263,7 @@ void SourceCoverageViewText::renderRegionMarkers(raw_ostream &OS, if (getOptions().Debug) errs() << "Marker at " << S->Line << ":" << S->Col << " = " - << formatCount(S->Count) << "\n"; + << formatBinaryCount(S->Count) << "\n"; } OS << '\n'; } @@ -307,7 +307,7 @@ void SourceCoverageViewText::renderBranchView(raw_ostream &OS, BranchView &BRV, << Label; if (getOptions().ShowBranchCounts) - OS << ": " << formatCount(Count); + OS << ": " << formatBinaryCount(Count); else OS << ": " << format("%0.2f", (Total != 0 ? 100.0 * Count / Total : 0.0)) << "%"; |