summaryrefslogtreecommitdiffstats
path: root/clang/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
commitc79346a57c3b8e332efa2c798869e8311cd19566 (patch)
treebde8c24c4ca28a1a5bb8c0d0c041601f95d13af1 /clang/lib/Frontend/CompilerInstance.cpp
parentd00406486421143c5e4eb79f9ce97e30442b1ab2 (diff)
downloadbcm5719-llvm-c79346a57c3b8e332efa2c798869e8311cd19566.tar.gz
bcm5719-llvm-c79346a57c3b8e332efa2c798869e8311cd19566.zip
Since multiple diagnostics can share one diagnostic client, have the client keeping track
of the total number of warnings/errors reported. llvm-svn: 119731
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInstance.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp
index dafbef1824b..152dd6d5b6b 100644
--- a/clang/lib/Frontend/CompilerInstance.cpp
+++ b/clang/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");
OpenPOWER on IntegriCloud