summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ProfileData
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/ProfileData')
-rw-r--r--llvm/lib/ProfileData/Coverage/CoverageMapping.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/ProfileData/Coverage/CoverageMapping.cpp b/llvm/lib/ProfileData/Coverage/CoverageMapping.cpp
index 6cde3863f18..0d52e48084f 100644
--- a/llvm/lib/ProfileData/Coverage/CoverageMapping.cpp
+++ b/llvm/lib/ProfileData/Coverage/CoverageMapping.cpp
@@ -388,6 +388,12 @@ class SegmentBuilder {
if (CompletedSegmentLoc == CompletedRegion->endLoc())
continue;
+ // Use the count from the next completed region if it ends at the same
+ // location.
+ if (I + 1 < E &&
+ CompletedRegion->endLoc() == ActiveRegions[I + 1]->endLoc())
+ CompletedRegion = ActiveRegions[I + 1];
+
startSegment(*CompletedRegion, CompletedSegmentLoc, false);
}
OpenPOWER on IntegriCloud