aboutsummaryrefslogtreecommitdiff
path: root/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
commit15221422eda7bac679e38b07512feda49715ef66 (patch)
tree3869dcbdd39667510b9629d44bc2d5a89cc952fc /lib/Basic/Diagnostic.cpp
parent41327585e4937bad8f9db485a506ea45223caeac (diff)
don't emit any diagnostics after a fatal one.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63914 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Basic/Diagnostic.cpp')
-rw-r--r--lib/Basic/Diagnostic.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/Basic/Diagnostic.cpp b/lib/Basic/Diagnostic.cpp
index ae23278f6c..ff110711f5 100644
--- a/lib/Basic/Diagnostic.cpp
+++ b/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.