]> granicus.if.org Git - clang/commit
Fix an assertion hit when the serialized diagnostics writer receive a diagnostic
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Thu, 10 May 2012 05:03:45 +0000 (05:03 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Thu, 10 May 2012 05:03:45 +0000 (05:03 +0000)
commit16afdf76b6f12e41ff6f6e6828bfb1d4732523ba
treeff1e52eb429bff15196fbb565d94225d940c70f6
parentdd44f34301316b814277d6a8c146d86c7115330b
Fix an assertion hit when the serialized diagnostics writer receive a diagnostic
from the frontend when the location is invalid and the SourceManager null.

Instead of keeping the SourceManager object in DiagnosticRenderer, propagate it
to the calls accordingly (as reference when it is expected to not be null, or pointer
when it may be null).
This effectively makes DiagnosticRenderer not tied to a specific SourceManager,
removing a hack from TextDiagnosticPrinter.

rdar://11386874

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156536 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Frontend/DiagnosticRenderer.h
include/clang/Frontend/TextDiagnostic.h
include/clang/Frontend/TextDiagnosticPrinter.h
lib/Frontend/DiagnosticRenderer.cpp
lib/Frontend/SerializedDiagnosticPrinter.cpp
lib/Frontend/TextDiagnostic.cpp
lib/Frontend/TextDiagnosticPrinter.cpp
test/Misc/serialized-diags-frontend.c [new file with mode: 0644]
tools/libclang/CIndexDiagnostic.cpp