From be3aab6abe5e66bb86596da806acc49614eacb69 Mon Sep 17 00:00:00 2001
From: Argyrios Kyrtzidis <akyrtzi@gmail.com>
Date: Thu, 18 Nov 2010 21:47:07 +0000
Subject: [PATCH] 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
---
 lib/Driver/Driver.cpp           | 4 ++--
 lib/Frontend/FrontendAction.cpp | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp
index 3cb0aa61010..5bb9a651d09 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 cfa0b6dbd3f..2e9d05f3cf8 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();
-- 
GitLab