diff options
author | George Karpenkov <ekarpenkov@apple.com> | 2018-09-07 00:42:53 +0000 |
---|---|---|
committer | George Karpenkov <ekarpenkov@apple.com> | 2018-09-07 00:42:53 +0000 |
commit | 5f8d361c9cb718a1001d52442bdf88cd046b6174 (patch) | |
tree | 2cacfadd9ab0e6173abb98708298e5dcae6bbd89 /clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp | |
parent | 98bee0229749b9164c70579c34f6258f4fcb639b (diff) | |
download | bcm5719-llvm-5f8d361c9cb718a1001d52442bdf88cd046b6174.tar.gz bcm5719-llvm-5f8d361c9cb718a1001d52442bdf88cd046b6174.zip |
[analyzer] Push updating-the-executed-lines logic into the BugReporter.
So it can be reused across different consumers.
Differential Revision: https://reviews.llvm.org/D51514
llvm-svn: 341617
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp')
-rw-r--r-- | clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp b/clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp index b733e70daff..77ea2a00ef6 100644 --- a/clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp +++ b/clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp @@ -337,23 +337,8 @@ static void serializeExecutedLines( const PathDiagnostic &D, const PathPieces &path, llvm::raw_string_ostream &os) { - // Copy executed lines from path diagnostics. - std::map<unsigned, std::set<unsigned>> ExecutedLines; - for (auto I = D.executedLines_begin(), - E = D.executedLines_end(); I != E; ++I) { - std::set<unsigned> &LinesInFile = ExecutedLines[I->first]; - for (unsigned LineNo : I->second) { - LinesInFile.insert(LineNo); - } - } - // We need to include all lines for which any kind of diagnostics appears. - for (const auto &P : path) { - FullSourceLoc Loc = P->getLocation().asLocation().getExpansionLoc(); - FileID FID = Loc.getFileID(); - unsigned LineNo = Loc.getLineNumber(); - ExecutedLines[FID.getHashValue()].insert(LineNo); - } + const FilesToLineNumsMap &ExecutedLines = D.getExecutedLines(); os << "var relevant_lines = {"; for (auto I = ExecutedLines.begin(), |