summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-01-23 20:28:53 +0000
committerTed Kremenek <kremenek@apple.com>2009-01-23 20:28:53 +0000
commitea06ec1cade1d256a0f2b15e0aebd8ab0fbcbe33 (patch)
tree3cc990c942e90e0173f2b4775c7ee95c717074a6 /clang/lib/Basic
parent3d5d14ea15eee48eb846c079d7efee296f53048c (diff)
downloadbcm5719-llvm-ea06ec1cade1d256a0f2b15e0aebd8ab0fbcbe33.tar.gz
bcm5719-llvm-ea06ec1cade1d256a0f2b15e0aebd8ab0fbcbe33.zip
Added virtual method DiagnosticClient::IncludeInDiagnosticCounts(). This is used by Diagnostics to determine if a diagnostic sent to a given DiagnosticClient should be included in the count of diagnostics. The default implementation of this method returns 'true'.
Implemented DiagCollector::IncludeInDiagnosticCounts() to return 'false' so that the batching of diagnostics for use with BugReporter doesn't mess up the count of real diagnostics. llvm-svn: 62873
Diffstat (limited to 'clang/lib/Basic')
-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