aboutsummaryrefslogtreecommitdiff
path: root/lib/Basic/Diagnostic.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2010-11-18 20:06:46 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2010-11-18 20:06:46 +0000
commitf2224d89a6ae65a3839529e26d0f6d025d83d6bb (patch)
tree31801a351dd849d50a1922a2326db3c828d96ffb /lib/Basic/Diagnostic.cpp
parent33e4e70c8c0a17e0ccb7465d96556b077a68ecb1 (diff)
Since multiple diagnostics can share one diagnostic client, have the client keeping track
of the total number of warnings/errors reported. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119731 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Basic/Diagnostic.cpp')
-rw-r--r--lib/Basic/Diagnostic.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/Basic/Diagnostic.cpp b/lib/Basic/Diagnostic.cpp
index a26f49764c..858b70a712 100644
--- a/lib/Basic/Diagnostic.cpp
+++ b/lib/Basic/Diagnostic.cpp
@@ -145,6 +145,16 @@ bool DiagnosticBuilder::Emit() {
DiagnosticClient::~DiagnosticClient() {}
+void DiagnosticClient::HandleDiagnostic(Diagnostic::Level DiagLevel,
+ const DiagnosticInfo &Info) {
+ if (!IncludeInDiagnosticCounts())
+ return;
+
+ if (DiagLevel == Diagnostic::Warning)
+ ++NumWarnings;
+ else if (DiagLevel >= Diagnostic::Error)
+ ++NumErrors;
+}
/// ModifierIs - Return true if the specified modifier matches specified string.
template <std::size_t StrLen>