From: Chandler Carruth Date: Wed, 18 Aug 2010 06:46:41 +0000 (+0000) Subject: Check whether errors should be included in the diagnostic counts. Previously, X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7a5bf5fb01c676809efcf63de322a88819115652;p=clang Check whether errors should be included in the diagnostic counts. Previously, only warnings did this check. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111355 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Basic/Diagnostic.cpp b/lib/Basic/Diagnostic.cpp index 1e911ec802..d4c7aa9521 100644 --- a/lib/Basic/Diagnostic.cpp +++ b/lib/Basic/Diagnostic.cpp @@ -576,11 +576,11 @@ bool Diagnostic::ProcessDiag() { // If a fatal error has already been emitted, silence all subsequent // diagnostics. if (FatalErrorOccurred) { - if (DiagLevel >= Diagnostic::Error) { + if (DiagLevel >= Diagnostic::Error && Client->IncludeInDiagnosticCounts()) { ++NumErrors; ++NumErrorsSuppressed; } - + return false; } @@ -601,9 +601,11 @@ bool Diagnostic::ProcessDiag() { } if (DiagLevel >= Diagnostic::Error) { - ErrorOccurred = true; - ++NumErrors; - + if (Client->IncludeInDiagnosticCounts()) { + 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 (ErrorLimit && NumErrors >= ErrorLimit &&