r178089 - [driver] Do not generate crash diagnostics if the compilation command failed

Chad Rosier mcrosier at apple.com
Tue Mar 26 16:41:30 PDT 2013


Author: mcrosier
Date: Tue Mar 26 18:41:30 2013
New Revision: 178089

URL: http://llvm.org/viewvc/llvm-project?rev=178089&view=rev
Log:
[driver] Do not generate crash diagnostics if the compilation command failed
to execute as the crash will surely reoccur while generating the diagnostics.
rdar://13362359

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

Modified: cfe/trunk/lib/Driver/Compilation.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Compilation.cpp?rev=178089&r1=178088&r2=178089&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Compilation.cpp (original)
+++ cfe/trunk/lib/Driver/Compilation.cpp Tue Mar 26 18:41:30 2013
@@ -290,11 +290,12 @@ int Compilation::ExecuteCommand(const Co
   }
 
   std::string Error;
+  bool ExecutionFailed;
   int Res =
     llvm::sys::Program::ExecuteAndWait(Prog, Argv,
                                        /*env*/0, Redirects,
                                        /*secondsToWait*/0, /*memoryLimit*/0,
-                                       &Error);
+                                       &Error, &ExecutionFailed);
   if (!Error.empty()) {
     assert(Res && "Error string set with 0 result code!");
     getDriver().Diag(clang::diag::err_drv_command_failure) << Error;
@@ -304,7 +305,7 @@ int Compilation::ExecuteCommand(const Co
     FailingCommand = &C;
 
   delete[] Argv;
-  return Res;
+  return ExecutionFailed ? 1 : Res;
 }
 
 typedef SmallVectorImpl< std::pair<int, const Command *> > FailingCommandList;





More information about the cfe-commits mailing list