aboutsummaryrefslogtreecommitdiff
path: root/lib/Basic/Diagnostic.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-04-14 19:56:12 +0000
committerTed Kremenek <kremenek@apple.com>2008-04-14 19:56:12 +0000
commit06bdb3a4fa8e84721b57a86f73aa3224f5367d58 (patch)
tree740481ebc61c190d117f8e44a1636d9c76c91518 /lib/Basic/Diagnostic.cpp
parent55af98c10a2fdff1fc2ee757746fdfb118d83eec (diff)
Only increment the number of diagnostics when the DiagnosticClient used
is the one attached to the Diagnostic object. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49677 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Basic/Diagnostic.cpp')
-rw-r--r--lib/Basic/Diagnostic.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/Basic/Diagnostic.cpp b/lib/Basic/Diagnostic.cpp
index 867b3dbec1..77984d6a09 100644
--- a/lib/Basic/Diagnostic.cpp
+++ b/lib/Basic/Diagnostic.cpp
@@ -221,7 +221,9 @@ void Diagnostic::Report(DiagnosticClient* C,
if (DiagLevel >= Diagnostic::Error) {
ErrorOccurred = true;
- ++NumErrors;
+
+ if (C == &Client)
+ ++NumErrors;
}
// Finally, report it.
@@ -230,7 +232,9 @@ void Diagnostic::Report(DiagnosticClient* C,
C->HandleDiagnostic(*this, DiagLevel, Pos, (diag::kind)DiagID,
Strs, NumStrs, Ranges, NumRanges);
- ++NumDiagnostics;
+
+ if (C == &Client)
+ ++NumDiagnostics;
}
DiagnosticClient::~DiagnosticClient() {}