summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2013-02-21 21:40:44 +0000
committerTed Kremenek <kremenek@apple.com>2013-02-21 21:40:44 +0000
commitc6ebda167f524ae32f2c2b97d7b1a2de76013ce7 (patch)
tree93eaace3987eca8f161b8ccd7f2ec18fd652a1f3 /clang/lib/Frontend
parentc6301bfafb80970f14d82b1d22847bbadb09b838 (diff)
downloadbcm5719-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.cpp10
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;
}
OpenPOWER on IntegriCloud