From: Argyrios Kyrtzidis Date: Thu, 18 Nov 2010 21:47:07 +0000 (+0000) Subject: Use hasErrorOccurred() instead of getNumErrors() where it makes sense. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=be3aab6abe5e66bb86596da806acc49614eacb69;p=clang Use hasErrorOccurred() instead of getNumErrors() where it makes sense. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119746 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp index 3cb0aa6101..5bb9a651d0 100644 --- a/lib/Driver/Driver.cpp +++ b/lib/Driver/Driver.cpp @@ -326,7 +326,7 @@ int Driver::ExecuteCompilation(const Compilation &C) const { } // If there were errors building the compilation, quit now. - if (getDiags().getNumErrors()) + if (getDiags().hasErrorOccurred()) return 1; const Command *FailingCommand = 0; @@ -998,7 +998,7 @@ void Driver::BuildJobs(Compilation &C) const { // If the user passed -Qunused-arguments or there were errors, don't warn // about any unused arguments. - if (Diags.getNumErrors() || + if (Diags.hasErrorOccurred() || C.getArgs().hasArg(options::OPT_Qunused_arguments)) return; diff --git a/lib/Frontend/FrontendAction.cpp b/lib/Frontend/FrontendAction.cpp index cfa0b6dbd3..2e9d05f3cf 100644 --- a/lib/Frontend/FrontendAction.cpp +++ b/lib/Frontend/FrontendAction.cpp @@ -288,7 +288,7 @@ void FrontendAction::EndSourceFile() { // Cleanup the output streams, and erase the output files if we encountered // an error. - CI.clearOutputFiles(/*EraseFiles=*/CI.getDiagnostics().getNumErrors()); + CI.clearOutputFiles(/*EraseFiles=*/CI.getDiagnostics().hasErrorOccurred()); // Inform the diagnostic client we are done with this source file. CI.getDiagnosticClient().EndSourceFile();