aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/ProfileData/Coverage/CoverageMapping.cpp
diff options
context:
space:
mode:
authorZequan Wu <zequanwu@google.com>2020-07-30 23:36:31 -0700
committerZequan Wu <zequanwu@google.com>2020-08-04 18:38:44 -0700
commite3df9471750935876bd2bf7da93ccf0eacca8592 (patch)
tree395f7e37fbb441ede84d91a9bf40c30c257778a6 /llvm/lib/ProfileData/Coverage/CoverageMapping.cpp
parentfe74f731e7024ce8b66869777dca6d6ed5a22e47 (diff)
downloadllvm-e3df9471750935876bd2bf7da93ccf0eacca8592.zip
llvm-e3df9471750935876bd2bf7da93ccf0eacca8592.tar.gz
llvm-e3df9471750935876bd2bf7da93ccf0eacca8592.tar.bz2
[llvm-cov] reset executation count to 0 after wrapped segment
Fix the bug: https://bugs.llvm.org/show_bug.cgi?id=36979. It also fixes this bug: https://bugs.llvm.org/show_bug.cgi?id=35404, which I think is caused by the same problem. Differential Revision: https://reviews.llvm.org/D85036
Diffstat (limited to 'llvm/lib/ProfileData/Coverage/CoverageMapping.cpp')
-rw-r--r--llvm/lib/ProfileData/Coverage/CoverageMapping.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/ProfileData/Coverage/CoverageMapping.cpp b/llvm/lib/ProfileData/Coverage/CoverageMapping.cpp
index 70f00d3..3197f5d 100644
--- a/llvm/lib/ProfileData/Coverage/CoverageMapping.cpp
+++ b/llvm/lib/ProfileData/Coverage/CoverageMapping.cpp
@@ -770,6 +770,7 @@ LineCoverageStats::LineCoverageStats(
ExecutionCount = WrappedSegment->Count;
if (!MinRegionCount)
return;
+ ExecutionCount = 0;
for (const auto *LS : LineSegments)
if (isStartOfRegion(LS))
ExecutionCount = std::max(ExecutionCount, LS->Count);