InstrProf: Don't combine expansion regions with code regions

This was leading to duplicate counts when a code region happened to
overlap exactly with an expansion. The combining behaviour only makes
sense for code regions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229723 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Justin Bogner
2015-02-18 19:01:06 +00:00
parent 59935868d3
commit 798787cea4
2 changed files with 38 additions and 1 deletions

View File

@ -314,7 +314,7 @@ public:
popRegion();
if (PrevRegion && PrevRegion->startLoc() == Region.startLoc() &&
PrevRegion->endLoc() == Region.endLoc()) {
if (Region.Kind != coverage::CounterMappingRegion::SkippedRegion)
if (Region.Kind == coverage::CounterMappingRegion::CodeRegion)
Segments.back().addCount(Region.ExecutionCount);
} else {
// Add this region to the stack.