diff options
author | Chris Lattner <sabre@nondot.org> | 2009-02-06 04:16:02 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-02-06 04:16:02 +0000 |
commit | 9e03119446b5e8220aaea5a08ee33b975e50a619 (patch) | |
tree | fb4fc6c8e6c39cf2890a6715a2fbd5a98b6d6223 /clang/lib/Basic/Diagnostic.cpp | |
parent | b05f49e7fdaf3bb78e6b77a2fa005d9b57ff28f2 (diff) | |
download | bcm5719-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.cpp | 10 |
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. |