diff options
author | Alex Lorenz <arphaman@gmail.com> | 2014-09-30 12:45:13 +0000 |
---|---|---|
committer | Alex Lorenz <arphaman@gmail.com> | 2014-09-30 12:45:13 +0000 |
commit | cb1702d45a433689f297567b1bcba03378bbd9f2 (patch) | |
tree | f2ab574484c3c140ed1485a1dd792abfab6be9d2 /llvm/lib/ProfileData/CoverageMapping.cpp | |
parent | 40d3deeb7da108f16dbdcb5f83e718607c07f5f8 (diff) | |
download | bcm5719-llvm-cb1702d45a433689f297567b1bcba03378bbd9f2.tar.gz bcm5719-llvm-cb1702d45a433689f297567b1bcba03378bbd9f2.zip |
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
llvm-svn: 218672
Diffstat (limited to 'llvm/lib/ProfileData/CoverageMapping.cpp')
-rw-r--r-- | llvm/lib/ProfileData/CoverageMapping.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/ProfileData/CoverageMapping.cpp b/llvm/lib/ProfileData/CoverageMapping.cpp index 06a950c2e40..115256358ed 100644 --- a/llvm/lib/ProfileData/CoverageMapping.cpp +++ b/llvm/lib/ProfileData/CoverageMapping.cpp @@ -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); |