aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-cov/CodeCoverage.cpp
diff options
context:
space:
mode:
authorJustin Bogner <mail@justinbogner.com>2015-02-14 02:01:24 +0000
committerJustin Bogner <mail@justinbogner.com>2015-02-14 02:01:24 +0000
commitf91bc6cdd87556fecc68cb95693fc0e37a15231a (patch)
treecde984d2621589e809cc4f3c266053828890d22f /llvm/tools/llvm-cov/CodeCoverage.cpp
parent5975a703e6657784339e25fcf84a745e9342668a (diff)
downloadllvm-f91bc6cdd87556fecc68cb95693fc0e37a15231a.zip
llvm-f91bc6cdd87556fecc68cb95693fc0e37a15231a.tar.gz
llvm-f91bc6cdd87556fecc68cb95693fc0e37a15231a.tar.bz2
llvm-cov: Simplify coverage reports, fixing PR22575 in the process
PR22575 occurred because we were unsafely storing references into a std::vector. If the vector moved because it grew, we'd be left iterating through garbage memory. This avoids the issue by simplifying the logic to gather coverage information as we go, rather than storing it and iterating over it. I'm relying on the existing tests showing that this is semantically NFC, since it's difficult to hit the issue this fixes without relatively large covered programs. llvm-svn: 229215
Diffstat (limited to 'llvm/tools/llvm-cov/CodeCoverage.cpp')
-rw-r--r--llvm/tools/llvm-cov/CodeCoverage.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/llvm/tools/llvm-cov/CodeCoverage.cpp b/llvm/tools/llvm-cov/CodeCoverage.cpp
index 98a044f..feaa3fc 100644
--- a/llvm/tools/llvm-cov/CodeCoverage.cpp
+++ b/llvm/tools/llvm-cov/CodeCoverage.cpp
@@ -16,7 +16,6 @@
#include "RenderingSupport.h"
#include "CoverageFilters.h"
#include "CoverageReport.h"
-#include "CoverageSummary.h"
#include "CoverageViewOptions.h"
#include "SourceCoverageView.h"
#include "llvm/ADT/SmallString.h"
@@ -459,9 +458,7 @@ int CodeCoverageTool::report(int argc, const char **argv,
if (!Coverage)
return 1;
- CoverageSummary Summarizer;
- Summarizer.createSummaries(*Coverage);
- CoverageReport Report(ViewOpts, Summarizer);
+ CoverageReport Report(ViewOpts, std::move(Coverage));
if (SourceFiles.empty() && Filters.empty()) {
Report.renderFileReports(llvm::outs());
return 0;