diff options
author | Chad Rosier <mcrosier@apple.com> | 2013-03-26 23:41:30 +0000 |
---|---|---|
committer | Chad Rosier <mcrosier@apple.com> | 2013-03-26 23:41:30 +0000 |
commit | c48d575f2e41bec767ccdea6591404c907f1bc91 (patch) | |
tree | 4e2d3e19e865f7dfa34aea6844861e84b87e3588 | |
parent | 0162c1ce296fc48fbe03a31a2ae00b939eef86a8 (diff) |
[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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178089 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Driver/Compilation.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Driver/Compilation.cpp b/lib/Driver/Compilation.cpp index db948a5bfe..1bff4a3d7a 100644 --- a/lib/Driver/Compilation.cpp +++ b/lib/Driver/Compilation.cpp @@ -290,11 +290,12 @@ int Compilation::ExecuteCommand(const Command &C, } 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 Command &C, FailingCommand = &C; delete[] Argv; - return Res; + return ExecutionFailed ? 1 : Res; } typedef SmallVectorImpl< std::pair<int, const Command *> > FailingCommandList; |