r173852 - [driver] Clear the FailureResultFiles when initializing clang diagnostics. Also,

Chad Rosier mcrosier at apple.com
Tue Jan 29 15:57:10 PST 2013


Author: mcrosier
Date: Tue Jan 29 17:57:10 2013
New Revision: 173852

URL: http://llvm.org/viewvc/llvm-project?rev=173852&view=rev
Log:
[driver] Clear the FailureResultFiles when initializing clang diagnostics. Also,
minor cleanup.

Modified:
    cfe/trunk/lib/Driver/Compilation.cpp
    cfe/trunk/lib/Driver/Driver.cpp

Modified: cfe/trunk/lib/Driver/Compilation.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Compilation.cpp?rev=173852&r1=173851&r2=173852&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Compilation.cpp (original)
+++ cfe/trunk/lib/Driver/Compilation.cpp Tue Jan 29 17:57:10 2013
@@ -329,6 +329,7 @@ void Compilation::initCompilationForDiag
   // 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.

Modified: cfe/trunk/lib/Driver/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Driver.cpp?rev=173852&r1=173851&r2=173852&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Driver.cpp (original)
+++ cfe/trunk/lib/Driver/Driver.cpp Tue Jan 29 17:57:10 2013
@@ -398,6 +398,12 @@ void Driver::generateCompilationDiagnost
     }
   }
 
+  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::generateCompilationDiagnost
     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();





More information about the cfe-commits mailing list