From c79346a57c3b8e332efa2c798869e8311cd19566 Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Thu, 18 Nov 2010 20:06:46 +0000 Subject: Since multiple diagnostics can share one diagnostic client, have the client keeping track of the total number of warnings/errors reported. llvm-svn: 119731 --- clang/lib/Frontend/CompilerInstance.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'clang/lib/Frontend/CompilerInstance.cpp') diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp index dafbef1..152dd6d 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"); -- cgit v1.1