mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229215 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user