[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
This commit is contained in:
parent
55e3d1ec35
commit
a3fdd17907
@ -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,
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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 << ", ";
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user