forked from OSchip/llvm-project
Revert r344375 "[Driver] check for exit code from SIGPIPE"
This doesn't build on Windows. llvm-svn: 344389
This commit is contained in:
parent
20ab6954a4
commit
3185977105
|
@ -78,7 +78,6 @@
|
|||
#include "llvm/Support/raw_ostream.h"
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <sysexits.h>
|
||||
#include <utility>
|
||||
#if LLVM_ON_UNIX
|
||||
#include <unistd.h> // getpid
|
||||
|
@ -1389,9 +1388,8 @@ int Driver::ExecuteCompilation(
|
|||
|
||||
// Otherwise, remove result files and print extra information about abnormal
|
||||
// failures.
|
||||
int Res = 0;
|
||||
for (const auto &CmdPair : FailingCommands) {
|
||||
int CommandRes = CmdPair.first;
|
||||
int Res = CmdPair.first;
|
||||
const Command *FailingCommand = CmdPair.second;
|
||||
|
||||
// Remove result files if we're not saving temps.
|
||||
|
@ -1400,17 +1398,10 @@ int Driver::ExecuteCompilation(
|
|||
C.CleanupFileMap(C.getResultFiles(), JA, true);
|
||||
|
||||
// Failure result files are valid unless we crashed.
|
||||
if (CommandRes < 0)
|
||||
if (Res < 0)
|
||||
C.CleanupFileMap(C.getFailureResultFiles(), JA, true);
|
||||
}
|
||||
|
||||
// llvm/lib/Support/Unix/Signals.inc will exit with a special return code
|
||||
// for SIGPIPE. Do not print diagnostics for this case.
|
||||
if (CommandRes == EX_IOERR) {
|
||||
Res = CommandRes;
|
||||
continue;
|
||||
}
|
||||
|
||||
// Print extra information about abnormal failures, if possible.
|
||||
//
|
||||
// This is ad-hoc, but we don't want to be excessively noisy. If the result
|
||||
|
@ -1420,17 +1411,17 @@ int Driver::ExecuteCompilation(
|
|||
// diagnostics, so always print the diagnostic there.
|
||||
const Tool &FailingTool = FailingCommand->getCreator();
|
||||
|
||||
if (!FailingCommand->getCreator().hasGoodDiagnostics() || CommandRes != 1) {
|
||||
if (!FailingCommand->getCreator().hasGoodDiagnostics() || Res != 1) {
|
||||
// FIXME: See FIXME above regarding result code interpretation.
|
||||
if (CommandRes < 0)
|
||||
if (Res < 0)
|
||||
Diag(clang::diag::err_drv_command_signalled)
|
||||
<< FailingTool.getShortName();
|
||||
else
|
||||
Diag(clang::diag::err_drv_command_failed)
|
||||
<< FailingTool.getShortName() << CommandRes;
|
||||
Diag(clang::diag::err_drv_command_failed) << FailingTool.getShortName()
|
||||
<< Res;
|
||||
}
|
||||
}
|
||||
return Res;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Driver::PrintHelp(bool ShowHidden) const {
|
||||
|
|
Loading…
Reference in New Issue