From cb1702d45a433689f297567b1bcba03378bbd9f2 Mon Sep 17 00:00:00 2001 From: Alex Lorenz Date: Tue, 30 Sep 2014 12:45:13 +0000 Subject: 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 --- llvm/tools/llvm-cov/CoverageSummary.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'llvm/tools/llvm-cov/CoverageSummary.cpp') 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 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); } -- cgit v1.2.3