diff options
author | Ted Kremenek <kremenek@apple.com> | 2013-02-21 21:40:44 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2013-02-21 21:40:44 +0000 |
commit | c6ebda167f524ae32f2c2b97d7b1a2de76013ce7 (patch) | |
tree | 93eaace3987eca8f161b8ccd7f2ec18fd652a1f3 /clang/lib/Frontend | |
parent | c6301bfafb80970f14d82b1d22847bbadb09b838 (diff) | |
download | bcm5719-llvm-c6ebda167f524ae32f2c2b97d7b1a2de76013ce7.tar.gz bcm5719-llvm-c6ebda167f524ae32f2c2b97d7b1a2de76013ce7.zip |
Teach serialized diagnostics about notes without locations.
Along the way, improve a diagnostic for "previous declaration here" for implicit parameters.
Fixes <rdar://problem/13211384>.
llvm-svn: 175802
Diffstat (limited to 'clang/lib/Frontend')
-rw-r--r-- | clang/lib/Frontend/SerializedDiagnosticPrinter.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/lib/Frontend/SerializedDiagnosticPrinter.cpp b/clang/lib/Frontend/SerializedDiagnosticPrinter.cpp index 8eb0e40b01b..4bb662bb265 100644 --- a/clang/lib/Frontend/SerializedDiagnosticPrinter.cpp +++ b/clang/lib/Frontend/SerializedDiagnosticPrinter.cpp @@ -543,8 +543,18 @@ void SDiagsWriter::HandleDiagnostic(DiagnosticsEngine::Level DiagLevel, // Special-case diagnostics with no location. We may not have entered a // source file in this case, so we can't use the normal DiagnosticsRenderer // machinery. + + // Make sure we bracket all notes as "sub-diagnostics". This matches + // the behavior in SDiagsRenderer::emitDiagnostic(). + if (DiagLevel == DiagnosticsEngine::Note) + EnterDiagBlock(); + EmitDiagnosticMessage(SourceLocation(), PresumedLoc(), DiagLevel, State->diagBuf, 0, &Info); + + if (DiagLevel == DiagnosticsEngine::Note) + ExitDiagBlock(); + return; } |