]> granicus.if.org Git - clang/commitdiff
Check whether errors should be included in the diagnostic counts. Previously,
authorChandler Carruth <chandlerc@gmail.com>
Wed, 18 Aug 2010 06:46:41 +0000 (06:46 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Wed, 18 Aug 2010 06:46:41 +0000 (06:46 +0000)
only warnings did this check.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111355 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Basic/Diagnostic.cpp

index 1e911ec8029d8e4e1df542fadcde0d5c133cd7b3..d4c7aa9521711e3dd846d0d5fb7b4d570024df4e 100644 (file)
@@ -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 &&