llvm-cov: Use the number of executed functions for the function coverage metric.

This commit fixes llvm-cov's function coverage metric by using the number of executed functions instead of the number of fully covered functions.

Differential Revision: http://reviews.llvm.org/D5196


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218672 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Alex Lorenz
2014-09-30 12:45:13 +00:00
parent f49592dddc
commit 38c59de6b1
9 changed files with 57 additions and 24 deletions

View File

@ -167,7 +167,9 @@ CoverageMapping::load(ObjectFileCoverageMappingReader &CoverageReader,
continue;
}
FunctionRecord Function(Record.FunctionName, Record.Filenames);
assert(Counts.size() != 0 && "Function's counts are empty");
FunctionRecord Function(Record.FunctionName, Record.Filenames,
Counts.front());
CounterMappingContext Ctx(Record.Expressions, Counts);
for (const auto &Region : Record.MappingRegions) {
ErrorOr<int64_t> ExecutionCount = Ctx.evaluate(Region.Count);