diff options
| author | George Karpenkov <ekarpenkov@apple.com> | 2018-09-07 00:43:37 +0000 |
|---|---|---|
| committer | George Karpenkov <ekarpenkov@apple.com> | 2018-09-07 00:43:37 +0000 |
| commit | a3fdd179073935f7035911fbcdbda4e657b3d083 (patch) | |
| tree | 88be395d956faf5ac072a06eec9275d39b6e9c3d | |
| parent | 55e3d1ec353a5849a0c3da72faa44cec6d528dfa (diff) | |
| download | bcm5719-llvm-a3fdd179073935f7035911fbcdbda4e657b3d083.tar.gz bcm5719-llvm-a3fdd179073935f7035911fbcdbda4e657b3d083.zip | |
[analyzer] Executed lines: store file IDs, not hashes.
Raw FileIDs are needed for the PlistDiagnostics to produce stable filenames.
Differential Revision: https://reviews.llvm.org/D51668
llvm-svn: 341619
| -rw-r--r-- | clang/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h | 2 | ||||
| -rw-r--r-- | clang/lib/StaticAnalyzer/Core/BugReporter.cpp | 6 | ||||
| -rw-r--r-- | clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/clang/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h b/clang/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h index ad76a1630ae..4a4af64eb48 100644 --- a/clang/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h +++ b/clang/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h @@ -759,7 +759,7 @@ public: }; /// File IDs mapped to sets of line numbers. -using FilesToLineNumsMap = std::map<unsigned, std::set<unsigned>>; +using FilesToLineNumsMap = std::map<FileID, std::set<unsigned>>; /// PathDiagnostic - PathDiagnostic objects represent a single path-sensitive /// diagnostic. It represents an ordered-collection of PathDiagnosticPieces, diff --git a/clang/lib/StaticAnalyzer/Core/BugReporter.cpp b/clang/lib/StaticAnalyzer/Core/BugReporter.cpp index 4e0a0d5045e..1c140a1651c 100644 --- a/clang/lib/StaticAnalyzer/Core/BugReporter.cpp +++ b/clang/lib/StaticAnalyzer/Core/BugReporter.cpp @@ -1893,7 +1893,7 @@ static void updateExecutedLinesWithDiagnosticPieces( FileID FID = Loc.getFileID(); unsigned LineNo = Loc.getLineNumber(); assert(FID.isValid()); - ExecutedLines[FID.getHashValue()].insert(LineNo); + ExecutedLines[FID].insert(LineNo); } } @@ -3030,7 +3030,7 @@ static void populateExecutedLinesWithFunctionSignature( FileID FID = SM.getFileID(SM.getExpansionLoc(Start)); for (unsigned Line = StartLine; Line <= EndLine; Line++) - ExecutedLines->operator[](FID.getHashValue()).insert(Line); + ExecutedLines->operator[](FID).insert(Line); } static void populateExecutedLinesWithStmt( @@ -3042,7 +3042,7 @@ static void populateExecutedLinesWithStmt( SourceLocation ExpansionLoc = SM.getExpansionLoc(Loc); FileID FID = SM.getFileID(ExpansionLoc); unsigned LineNo = SM.getExpansionLineNumber(ExpansionLoc); - ExecutedLines->operator[](FID.getHashValue()).insert(LineNo); + ExecutedLines->operator[](FID).insert(LineNo); } /// \return all executed lines including function signatures on the path diff --git a/clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp b/clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp index 77ea2a00ef6..7f7cf37a0fe 100644 --- a/clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp +++ b/clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp @@ -346,7 +346,7 @@ static void serializeExecutedLines( if (I != ExecutedLines.begin()) os << ", "; - os << "\"" << I->first << "\": {"; + os << "\"" << I->first.getHashValue() << "\": {"; for (unsigned LineNo : I->second) { if (LineNo != *(I->second.begin())) os << ", "; |

