summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic/Diagnostic.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Basic/Diagnostic.cpp')
-rw-r--r--clang/lib/Basic/Diagnostic.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/clang/lib/Basic/Diagnostic.cpp b/clang/lib/Basic/Diagnostic.cpp
index 340ef28846c..2271095b596 100644
--- a/clang/lib/Basic/Diagnostic.cpp
+++ b/clang/lib/Basic/Diagnostic.cpp
@@ -255,7 +255,7 @@ void Diagnostic::ProcessDiag() {
// Finally, report it.
Client->HandleDiagnostic(DiagLevel, Info);
- ++NumDiagnostics;
+ if (Client->IncludeInDiagnosticCounts()) ++NumDiagnostics;
}
@@ -551,3 +551,9 @@ FormatDiagnostic(llvm::SmallVectorImpl<char> &OutStr) const {
}
}
}
+
+/// IncludeInDiagnosticCounts - This method (whose default implementation
+/// returns true) indicates whether the diagnostics handled by this
+/// DiagnosticClient should be included in the number of diagnostics
+/// reported by Diagnostic.
+bool DiagnosticClient::IncludeInDiagnosticCounts() const { return true; }
OpenPOWER on IntegriCloud