summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic/Diagnostic.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-02-06 04:16:02 +0000
committerChris Lattner <sabre@nondot.org>2009-02-06 04:16:02 +0000
commit9e03119446b5e8220aaea5a08ee33b975e50a619 (patch)
treefb4fc6c8e6c39cf2890a6715a2fbd5a98b6d6223 /clang/lib/Basic/Diagnostic.cpp
parentb05f49e7fdaf3bb78e6b77a2fa005d9b57ff28f2 (diff)
downloadbcm5719-llvm-9e03119446b5e8220aaea5a08ee33b975e50a619.tar.gz
bcm5719-llvm-9e03119446b5e8220aaea5a08ee33b975e50a619.zip
don't emit any diagnostics after a fatal one.
llvm-svn: 63914
Diffstat (limited to 'clang/lib/Basic/Diagnostic.cpp')
-rw-r--r--clang/lib/Basic/Diagnostic.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/clang/lib/Basic/Diagnostic.cpp b/clang/lib/Basic/Diagnostic.cpp
index ae23278f6ca..ff110711f5a 100644
--- a/clang/lib/Basic/Diagnostic.cpp
+++ b/clang/lib/Basic/Diagnostic.cpp
@@ -191,6 +191,7 @@ Diagnostic::Diagnostic(DiagnosticClient *client) : Client(client) {
memset(DiagMappings, 0, sizeof(DiagMappings));
ErrorOccurred = false;
+ FatalErrorOccurred = false;
NumDiagnostics = 0;
NumErrors = 0;
CustomDiagInfo = 0;
@@ -300,6 +301,11 @@ Diagnostic::Level Diagnostic::getDiagnosticLevel(unsigned DiagID) const {
void Diagnostic::ProcessDiag() {
DiagnosticInfo Info(this);
+ // If a fatal error has already been emitted, silence all subsequent
+ // diagnostics.
+ if (FatalErrorOccurred)
+ return;
+
// Figure out the diagnostic level of this message.
Diagnostic::Level DiagLevel = getDiagnosticLevel(Info.getID());
@@ -320,8 +326,10 @@ void Diagnostic::ProcessDiag() {
if (DiagLevel >= Diagnostic::Error) {
ErrorOccurred = true;
-
++NumErrors;
+
+ if (DiagLevel == Diagnostic::Fatal)
+ FatalErrorOccurred = true;
}
// Finally, report it.
OpenPOWER on IntegriCloud