llvm-cov: Combine segments that cover the same location

If we have multiple coverage counts for the same segment, we need to
add them up rather than arbitrarily choosing one. This fixes that and
adds a test with template instantiations to exercise it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218432 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Justin Bogner
2014-09-25 00:34:18 +00:00
parent 0253523c92
commit aacc919bfd
5 changed files with 62 additions and 4 deletions

View File

@ -274,6 +274,7 @@ struct CoverageSegment {
Count = NewCount;
HasCount = true;
}
void addCount(uint64_t NewCount) { setCount(Count + NewCount); }
};
/// \brief Coverage information to be processed or displayed.