Index: clang/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h =================================================================== --- clang/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h +++ clang/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h @@ -759,7 +759,7 @@ }; /// File IDs mapped to sets of line numbers. -using FilesToLineNumsMap = std::map>; +using FilesToLineNumsMap = std::map>; /// PathDiagnostic - PathDiagnostic objects represent a single path-sensitive /// diagnostic. It represents an ordered-collection of PathDiagnosticPieces, Index: clang/lib/StaticAnalyzer/Core/BugReporter.cpp =================================================================== --- clang/lib/StaticAnalyzer/Core/BugReporter.cpp +++ clang/lib/StaticAnalyzer/Core/BugReporter.cpp @@ -1892,7 +1892,7 @@ FullSourceLoc Loc = P->getLocation().asLocation().getExpansionLoc(); FileID FID = Loc.getFileID(); unsigned LineNo = Loc.getLineNumber(); - ExecutedLines[FID.getHashValue()].insert(LineNo); + ExecutedLines[FID].insert(LineNo); } } @@ -3027,7 +3027,7 @@ 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( @@ -3037,7 +3037,7 @@ 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 Index: clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp =================================================================== --- clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp +++ clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp @@ -339,7 +339,7 @@ llvm::raw_string_ostream &os) { // Mapping from file IDs to executed lines. - const std::map> &ExecutedLines = + const std::map> &ExecutedLines = D.getExecutedLines(); os << "var relevant_lines = {"; @@ -348,7 +348,7 @@ if (I != ExecutedLines.begin()) os << ", "; - os << "\"" << I->first << "\": {"; + os << "\"" << I->first.getHashValue() << "\": {"; for (unsigned LineNo : I->second) { if (LineNo != *(I->second.begin())) os << ", "; Index: clang/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp =================================================================== --- clang/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp +++ clang/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp @@ -330,6 +330,7 @@ static void printCoverage(const PathDiagnostic *D, unsigned InputIndentLevel, + const FIDMap &FIDs, llvm::raw_fd_ostream &o) { unsigned IndentLevel = InputIndentLevel; @@ -338,10 +339,12 @@ IndentLevel++; // Mapping from file IDs to executed lines. - const std::map> &ExecutedLines = + const std::map> &ExecutedLines = D->getExecutedLines(); for (auto I = ExecutedLines.begin(), E = ExecutedLines.end(); I != E; ++I) { - Indent(o, IndentLevel) << "" << I->first << "\n"; + FIDMap::const_iterator II = FIDs.find(I->first); + assert(II != FIDs.end()); + Indent(o, IndentLevel) << "" << II->second << "\n"; Indent(o, IndentLevel) << "\n"; IndentLevel++; for (unsigned LineNo : I->second) { @@ -582,7 +585,7 @@ } } - printCoverage(D, /*IndentLevel=*/2, o); + printCoverage(D, /*IndentLevel=*/2, FM, o); // Close up the entry. o << " \n";