summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-cov/CoverageReport.cpp
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2017-09-19 02:00:12 +0000
committerVedant Kumar <vsk@apple.com>2017-09-19 02:00:12 +0000
commitb7fdaf2cd403e99f3079efafc1793e3e7868a245 (patch)
tree3c7d9aba6a9b0731755dd7da5e049d60cef46e14 /llvm/tools/llvm-cov/CoverageReport.cpp
parentef8e05ff07e3ff6b7d9aedb615b12a2ed61b9d01 (diff)
downloadbcm5719-llvm-b7fdaf2cd403e99f3079efafc1793e3e7868a245.tar.gz
bcm5719-llvm-b7fdaf2cd403e99f3079efafc1793e3e7868a245.zip
[llvm-cov] Make report metrics agree with line exec counts, fixes PR34615
Use the same logic as the line-oriented coverage view to determine the number of covered lines in a function. Fixes llvm.org/PR34615. llvm-svn: 313604
Diffstat (limited to 'llvm/tools/llvm-cov/CoverageReport.cpp')
-rw-r--r--llvm/tools/llvm-cov/CoverageReport.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/tools/llvm-cov/CoverageReport.cpp b/llvm/tools/llvm-cov/CoverageReport.cpp
index 4bbade4a179..4c02bbcf2a3 100644
--- a/llvm/tools/llvm-cov/CoverageReport.cpp
+++ b/llvm/tools/llvm-cov/CoverageReport.cpp
@@ -306,7 +306,7 @@ void CoverageReport::renderFunctionReports(ArrayRef<std::string> Files,
OS << "\n";
FunctionCoverageSummary Totals("TOTAL");
for (const auto &F : Functions) {
- FunctionCoverageSummary Function = FunctionCoverageSummary::get(F);
+ auto Function = FunctionCoverageSummary::get(Coverage, F);
++Totals.ExecutionCount;
Totals.RegionCoverage += Function.RegionCoverage;
Totals.LineCoverage += Function.LineCoverage;
@@ -332,7 +332,7 @@ std::vector<FileCoverageSummary> CoverageReport::prepareFileReports(
for (const auto &Group : Coverage.getInstantiationGroups(Filename)) {
std::vector<FunctionCoverageSummary> InstantiationSummaries;
for (const coverage::FunctionRecord *F : Group.getInstantiations()) {
- auto InstantiationSummary = FunctionCoverageSummary::get(*F);
+ auto InstantiationSummary = FunctionCoverageSummary::get(Coverage, *F);
Summary.addInstantiation(InstantiationSummary);
Totals.addInstantiation(InstantiationSummary);
InstantiationSummaries.push_back(InstantiationSummary);
OpenPOWER on IntegriCloud