]> granicus.if.org Git - clang/commitdiff
[driver] Clear the FailureResultFiles when initializing clang diagnostics. Also,
authorChad Rosier <mcrosier@apple.com>
Tue, 29 Jan 2013 23:57:10 +0000 (23:57 +0000)
committerChad Rosier <mcrosier@apple.com>
Tue, 29 Jan 2013 23:57:10 +0000 (23:57 +0000)
minor cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173852 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/Compilation.cpp
lib/Driver/Driver.cpp

index da589b9d5bf09de9805a61ea597e3b84fa83b5ae..86e617211f80419b34d174c24b7944e7d9d570c2 100644 (file)
@@ -329,6 +329,7 @@ void Compilation::initCompilationForDiagnostics() {
   // Clear temporary/results file lists.
   TempFiles.clear();
   ResultFiles.clear();
+  FailureResultFiles.clear();
 
   // Remove any user specified output.  Claim any unclaimed arguments, so as
   // to avoid emitting warnings about unused args.
index 0ba61a3de8bfa3935a72aaec02f5db46ff9593a2..3ede6e328841b3283f8aba35f82273f85689561b 100644 (file)
@@ -398,6 +398,12 @@ void Driver::generateCompilationDiagnostics(Compilation &C,
     }
   }
 
+  if (Inputs.empty()) {
+    Diag(clang::diag::note_drv_command_failed_diag_msg)
+      << "Error generating preprocessed source(s) - no preprocessable inputs.";
+    return;
+  }
+
   // Don't attempt to generate preprocessed files if multiple -arch options are
   // used, unless they're all duplicates.
   llvm::StringSet<> ArchNames;
@@ -416,12 +422,6 @@ void Driver::generateCompilationDiagnostics(Compilation &C,
     return;
   }
 
-  if (Inputs.empty()) {
-    Diag(clang::diag::note_drv_command_failed_diag_msg)
-      << "Error generating preprocessed source(s) - no preprocessable inputs.";
-    return;
-  }
-
   // Construct the list of abstract actions to perform for this compilation. On
   // Darwin OSes this uses the driver-driver and builds universal actions.
   const ToolChain &TC = C.getDefaultToolChain();