diff options
Diffstat (limited to 'lib/Driver/Compilation.cpp')
-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; |