[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
This commit is contained in:
Chad Rosier 2013-03-26 23:41:30 +00:00
Родитель 0162c1ce29
Коммит c48d575f2e
1 изменённых файлов: 3 добавлений и 2 удалений

Просмотреть файл

@ -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;