aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/ProfileData/Coverage/CoverageMapping.cpp
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2017-11-09 02:33:43 +0000
committerVedant Kumar <vsk@apple.com>2017-11-09 02:33:43 +0000
commit43247f05421ba6e6f247592be6c2f39778796c6e (patch)
tree7a1043fdaf2a1e6c1bb7d6b9546a068d8dd6895d /llvm/lib/ProfileData/Coverage/CoverageMapping.cpp
parentf9a0d44eea28ada1adf75e5e63274055fccd65ab (diff)
downloadllvm-43247f05421ba6e6f247592be6c2f39778796c6e.zip
llvm-43247f05421ba6e6f247592be6c2f39778796c6e.tar.gz
llvm-43247f05421ba6e6f247592be6c2f39778796c6e.tar.bz2
[Coverage] Use the wrapped segment when a line has entry segments
We've worked around bugs in the frontend by ignoring the count from wrapped segments when a line has at least one region entry segment. Those frontend bugs are now fixed, so it's time to regenerate the checked-in covmapping files and remove the workaround. llvm-svn: 317761
Diffstat (limited to 'llvm/lib/ProfileData/Coverage/CoverageMapping.cpp')
-rw-r--r--llvm/lib/ProfileData/Coverage/CoverageMapping.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/ProfileData/Coverage/CoverageMapping.cpp b/llvm/lib/ProfileData/Coverage/CoverageMapping.cpp
index ce93229..6cde386 100644
--- a/llvm/lib/ProfileData/Coverage/CoverageMapping.cpp
+++ b/llvm/lib/ProfileData/Coverage/CoverageMapping.cpp
@@ -698,12 +698,12 @@ LineCoverageStats::LineCoverageStats(
if (!Mapped)
return;
- // Pick the max count from the non-gap, region entry segments. If there
- // aren't any, use the wrapped count.
- if (!MinRegionCount) {
+ // Pick the max count from the non-gap, region entry segments and the
+ // wrapped count.
+ if (WrappedSegment)
ExecutionCount = WrappedSegment->Count;
+ if (!MinRegionCount)
return;
- }
for (const auto *LS : LineSegments)
if (isStartOfRegion(LS))
ExecutionCount = std::max(ExecutionCount, LS->Count);