diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-04-02 05:13:24 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-04-02 05:13:24 +0000 |
commit | 12f510aa8fa96a10df663702d93006d62725b079 (patch) | |
tree | b48e698f989f6545f929952a8729e5378a9638b6 /clang/lib | |
parent | 3b3e0b3c1ec29184650e8dd6bb69266f34b10ac9 (diff) | |
download | bcm5719-llvm-12f510aa8fa96a10df663702d93006d62725b079.tar.gz bcm5719-llvm-12f510aa8fa96a10df663702d93006d62725b079.zip |
Hack: Add 'PathDiagnostic::flattenLocations()'. Because PlistDiagnosticClient
can use a PathLocation after any reference Stmts are reclaimed,
flattenLocation() converts those references to statements to source ranges.
llvm-svn: 68292
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Frontend/PlistDiagnostics.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Frontend/PlistDiagnostics.cpp b/clang/lib/Frontend/PlistDiagnostics.cpp index 9649cf61881..575c3f3bfca 100644 --- a/clang/lib/Frontend/PlistDiagnostics.cpp +++ b/clang/lib/Frontend/PlistDiagnostics.cpp @@ -267,6 +267,10 @@ void PlistDiagnostics::HandlePathDiagnostic(const PathDiagnostic* D) { return; } + // We need to flatten the locations (convert Stmt* to locations) because + // the referenced statements may be freed by the time the diagnostics + // are emitted. + const_cast<PathDiagnostic*>(D)->flattenLocations(); BatchedDiags.push_back(D); } |