BugReporter (extensive diagnostics): always add an edge if there is no location

context.

llvm-svn: 69823
This commit is contained in:
Ted Kremenek
2009-04-22 20:36:26 +00:00
parent a9c6c5d39b
commit fb05406cef

View File

@@ -788,7 +788,11 @@ class VISIBILITY_HIDDEN EdgeBuilder {
void popLocation() {
PathDiagnosticLocation L = CLocs.back();
if (L.asLocation().isFileID()) rawAddEdge(CLocs.back());
if (L.asLocation().isFileID()) {
// For contexts, we only one the first character as the range.
L = PathDiagnosticLocation(L.asLocation(), L.getManager());
rawAddEdge(CLocs.back());
}
CLocs.pop_back();
}
@@ -946,6 +950,9 @@ void EdgeBuilder::addEdge(PathDiagnosticLocation NewLoc, bool alwaysAdd) {
// Context does not contain the location. Flush it.
popLocation();
}
// If we reach here, there is no enclosing context. Just add the edge.
rawAddEdge(NewLoc);
}
void EdgeBuilder::addContext(const Stmt *S) {