diff options
author | Chris Lattner <sabre@nondot.org> | 2010-04-07 20:21:58 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-04-07 20:21:58 +0000 |
commit | 75a0393eb580106a4266285fb91e36343ee6cebd (patch) | |
tree | 4b993b44ffbd3b6d3d833bf1d54fb6ec938a3299 /clang/lib/Basic/Diagnostic.cpp | |
parent | 27c786bcf9f1b0d2e7f9b01c07604e4901e68dec (diff) | |
download | bcm5719-llvm-75a0393eb580106a4266285fb91e36343ee6cebd.tar.gz bcm5719-llvm-75a0393eb580106a4266285fb91e36343ee6cebd.zip |
add capabilities to stop emitting errors after some limit.
Right now the limit is 0 (aka disabled)
llvm-svn: 100684
Diffstat (limited to 'clang/lib/Basic/Diagnostic.cpp')
-rw-r--r-- | clang/lib/Basic/Diagnostic.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/Basic/Diagnostic.cpp b/clang/lib/Basic/Diagnostic.cpp index a1094ad95ca..388875cf631 100644 --- a/clang/lib/Basic/Diagnostic.cpp +++ b/clang/lib/Basic/Diagnostic.cpp @@ -223,6 +223,7 @@ Diagnostic::Diagnostic(DiagnosticClient *client) : Client(client) { ErrorOccurred = false; FatalErrorOccurred = false; + MaxErrorsEmitted = 0; NumWarnings = 0; NumErrors = 0; @@ -551,6 +552,12 @@ bool Diagnostic::ProcessDiag() { if (DiagLevel >= Diagnostic::Error) { ErrorOccurred = true; ++NumErrors; + + // If we've emitted a lot of errors, emit a fatal error after it to stop a + // flood of bogus errors. + if (MaxErrorsEmitted && NumErrors >= MaxErrorsEmitted && + DiagLevel == Diagnostic::Error) + SetDelayedDiagnostic(diag::fatal_too_many_errors); } // Finally, report it. |