diff options
Diffstat (limited to 'llvm/tools/llvm-cov/SourceCoverageViewText.cpp')
-rw-r--r-- | llvm/tools/llvm-cov/SourceCoverageViewText.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/tools/llvm-cov/SourceCoverageViewText.cpp b/llvm/tools/llvm-cov/SourceCoverageViewText.cpp index 40d4359..6e0db09 100644 --- a/llvm/tools/llvm-cov/SourceCoverageViewText.cpp +++ b/llvm/tools/llvm-cov/SourceCoverageViewText.cpp @@ -232,7 +232,9 @@ void SourceCoverageViewText::renderBranchView(raw_ostream &OS, BranchView &BRV, for (const auto &R : BRV.Regions) { double TruePercent = 0.0; double FalsePercent = 0.0; - unsigned Total = R.ExecutionCount + R.FalseExecutionCount; + // FIXME: It may overflow when the data is too large, but I have not + // encountered it in actual use, and not sure whether to use __uint128_t. + uint64_t Total = R.ExecutionCount + R.FalseExecutionCount; if (!getOptions().ShowBranchCounts && Total != 0) { TruePercent = ((double)(R.ExecutionCount) / (double)Total) * 100.0; |