aboutsummaryrefslogtreecommitdiff
path: root/lib/Basic/DiagnosticIDs.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-08-17 19:13:00 +0000
committerDouglas Gregor <dgregor@apple.com>2011-08-17 19:13:00 +0000
commitf1d594864b4aefc1fe21535cb43e8a81038f3f15 (patch)
treef9826e140ad7203000f31788e26b5c0b6cc685d1 /lib/Basic/DiagnosticIDs.cpp
parentcc0de8c08128023544dd0c9c7ee67b105fed2985 (diff)
Fix -ferror-limit= to properly emit notes following the last error
messages. Fi from David Blaikie, tests from Nikola Smiljanic! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137851 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Basic/DiagnosticIDs.cpp')
-rw-r--r--lib/Basic/DiagnosticIDs.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/Basic/DiagnosticIDs.cpp b/lib/Basic/DiagnosticIDs.cpp
index 907e826a33..fa397c9ac9 100644
--- a/lib/Basic/DiagnosticIDs.cpp
+++ b/lib/Basic/DiagnosticIDs.cpp
@@ -733,11 +733,13 @@ bool DiagnosticIDs::ProcessDiag(Diagnostic &Diag) const {
++Diag.NumErrors;
}
- // If we've emitted a lot of errors, emit a fatal error after it to stop a
- // flood of bogus errors.
- if (Diag.ErrorLimit && Diag.NumErrors >= Diag.ErrorLimit &&
- DiagLevel == DiagnosticIDs::Error)
+ // If we've emitted a lot of errors, emit a fatal error instead of it to
+ // stop a flood of bogus errors.
+ if (Diag.ErrorLimit && Diag.NumErrors > Diag.ErrorLimit &&
+ DiagLevel == DiagnosticIDs::Error) {
Diag.SetDelayedDiagnostic(diag::fatal_too_many_errors);
+ return false;
+ }
}
// If we have any Fix-Its, make sure that all of the Fix-Its point into