aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend/CompilerInstance.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/Frontend/CompilerInstance.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/Frontend/CompilerInstance.cpp')
-rw-r--r--lib/Frontend/CompilerInstance.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Frontend/CompilerInstance.cpp b/lib/Frontend/CompilerInstance.cpp
index dafbef1824..152dd6d5b6 100644
--- a/lib/Frontend/CompilerInstance.cpp
+++ b/lib/Frontend/CompilerInstance.cpp
@@ -553,9 +553,10 @@ bool CompilerInstance::ExecuteAction(FrontendAction &Act) {
}
if (getDiagnosticOpts().ShowCarets) {
- unsigned NumWarnings = getDiagnostics().getNumWarnings();
- unsigned NumErrors = getDiagnostics().getNumErrors() -
- getDiagnostics().getNumErrorsSuppressed();
+ // We can have multiple diagnostics sharing one diagnostic client.
+ // Get the total number of warnings/errors from the client.
+ unsigned NumWarnings = getDiagnostics().getClient()->getNumWarnings();
+ unsigned NumErrors = getDiagnostics().getClient()->getNumErrors();
if (NumWarnings)
OS << NumWarnings << " warning" << (NumWarnings == 1 ? "" : "s");