]> granicus.if.org Git - clang/commitdiff
Use hasErrorOccurred() instead of getNumErrors() where it makes sense.
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Thu, 18 Nov 2010 21:47:07 +0000 (21:47 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Thu, 18 Nov 2010 21:47:07 +0000 (21:47 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119746 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/Driver.cpp
lib/Frontend/FrontendAction.cpp

index 3cb0aa6101016ad028b31357d35c769a89d95fbb..5bb9a651d09d7535a478b6983977300de7d93a01 100644 (file)
@@ -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;
 
index cfa0b6dbd3f232534029474b81c9b9618dbbd252..2e9d05f3cf889d10d75c86b45f7a5852a4d57ec9 100644 (file)
@@ -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();