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/tools/llvm-cov/CoverageSummary.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/tools/llvm-cov/CoverageSummary.cpp')
-rw-r--r-- | llvm/tools/llvm-cov/CoverageSummary.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/tools/llvm-cov/CoverageSummary.cpp b/llvm/tools/llvm-cov/CoverageSummary.cpp index 8df3bebbacf..785e9024ba7 100644 --- a/llvm/tools/llvm-cov/CoverageSummary.cpp +++ b/llvm/tools/llvm-cov/CoverageSummary.cpp @@ -72,7 +72,7 @@ CoverageSummary::createSummaries(ArrayRef<coverage::FunctionRecord> Functions) { FileCoverageSummary CoverageSummary::getCombinedFileSummaries() { size_t NumRegions = 0, CoveredRegions = 0; size_t NumLines = 0, NonCodeLines = 0, CoveredLines = 0; - size_t NumFunctionsCovered = 0, NumFunctions = 0; + size_t NumFunctionsExecuted = 0, NumFunctions = 0; for (const auto &File : FileSummaries) { NumRegions += File.RegionCoverage.NumRegions; CoveredRegions += File.RegionCoverage.Covered; @@ -81,12 +81,12 @@ FileCoverageSummary CoverageSummary::getCombinedFileSummaries() { NonCodeLines += File.LineCoverage.NonCodeLines; CoveredLines += File.LineCoverage.Covered; - NumFunctionsCovered += File.FunctionCoverage.FullyCovered; + NumFunctionsExecuted += File.FunctionCoverage.Executed; NumFunctions += File.FunctionCoverage.NumFunctions; } return FileCoverageSummary( "TOTAL", RegionCoverageInfo(CoveredRegions, NumRegions), LineCoverageInfo(CoveredLines, NonCodeLines, NumLines), - FunctionCoverageInfo(NumFunctionsCovered, NumFunctions), + FunctionCoverageInfo(NumFunctionsExecuted, NumFunctions), None); } |