Skip to content

Commit f4dc4eb

Browse files
committed
s/Count1/BinaryCount/
1 parent 47550d1 commit f4dc4eb

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

llvm/tools/llvm-cov/SourceCoverageView.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,9 +268,13 @@ class SourceCoverageView {
268268
/// digits.
269269
static std::string formatCount(uint64_t N);
270270

271-
uint64_t Count1(uint64_t N) const { return (N && BinaryCounters ? 1 : N); }
271+
uint64_t BinaryCount(uint64_t N) const {
272+
return (N && BinaryCounters ? 1 : N);
273+
}
272274

273-
std::string formatCount1(uint64_t N) const { return formatCount(Count1(N)); }
275+
std::string formatBinaryCount(uint64_t N) const {
276+
return formatCount(BinaryCount(N));
277+
}
274278

275279
/// Check if region marker output is expected for a line.
276280
bool shouldRenderRegionMarkers(const LineCoverageStats &LCS) const;

llvm/tools/llvm-cov/SourceCoverageViewHTML.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,8 +1019,8 @@ void SourceCoverageViewHTML::renderLine(raw_ostream &OS, LineRef L,
10191019
// Just consider the segments which start *and* end on this line.
10201020
for (unsigned I = 0, E = Segments.size() - 1; I < E; ++I) {
10211021
const auto *CurSeg = Segments[I];
1022-
auto CurSegCount = Count1(CurSeg->Count);
1023-
auto LCSCount = Count1(LCS.getExecutionCount());
1022+
auto CurSegCount = BinaryCount(CurSeg->Count);
1023+
auto LCSCount = BinaryCount(LCS.getExecutionCount());
10241024
if (!CurSeg->IsRegionEntry)
10251025
continue;
10261026
if (CurSegCount == LCSCount)
@@ -1054,7 +1054,7 @@ void SourceCoverageViewHTML::renderLineCoverageColumn(
10541054
raw_ostream &OS, const LineCoverageStats &Line) {
10551055
std::string Count;
10561056
if (Line.isMapped())
1057-
Count = tag("pre", formatCount1(Line.getExecutionCount()));
1057+
Count = tag("pre", formatBinaryCount(Line.getExecutionCount()));
10581058
std::string CoverageClass =
10591059
(Line.getExecutionCount() > 0)
10601060
? "covered-line"
@@ -1109,7 +1109,7 @@ void SourceCoverageViewHTML::renderBranchView(raw_ostream &OS, BranchView &BRV,
11091109

11101110
OS << tag("span", Label, (Count ? "None" : "red branch")) << ": ";
11111111
if (getOptions().ShowBranchCounts)
1112-
OS << tag("span", formatCount1(Count),
1112+
OS << tag("span", formatBinaryCount(Count),
11131113
(Count ? "covered-line" : "uncovered-line"));
11141114
else
11151115
OS << format("%0.2f", (Total != 0 ? 100.0 * Count / Total : 0.0)) << "%";

llvm/tools/llvm-cov/SourceCoverageViewText.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ void SourceCoverageViewText::renderLineCoverageColumn(
216216
OS.indent(LineCoverageColumnWidth) << '|';
217217
return;
218218
}
219-
std::string C = formatCount1(Line.getExecutionCount());
219+
std::string C = formatBinaryCount(Line.getExecutionCount());
220220
OS.indent(LineCoverageColumnWidth - C.size());
221221
colored_ostream(OS, raw_ostream::MAGENTA,
222222
Line.hasMultipleRegions() && getOptions().Colors)
@@ -263,7 +263,7 @@ void SourceCoverageViewText::renderRegionMarkers(raw_ostream &OS,
263263

264264
if (getOptions().Debug)
265265
errs() << "Marker at " << S->Line << ":" << S->Col << " = "
266-
<< formatCount1(S->Count) << "\n";
266+
<< formatBinaryCount(S->Count) << "\n";
267267
}
268268
OS << '\n';
269269
}
@@ -307,7 +307,7 @@ void SourceCoverageViewText::renderBranchView(raw_ostream &OS, BranchView &BRV,
307307
<< Label;
308308

309309
if (getOptions().ShowBranchCounts)
310-
OS << ": " << formatCount1(Count);
310+
OS << ": " << formatBinaryCount(Count);
311311
else
312312
OS << ": " << format("%0.2f", (Total != 0 ? 100.0 * Count / Total : 0.0))
313313
<< "%";

0 commit comments

Comments
 (0)