summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorAndrew Trick <atrick@apple.com>2011-05-21 00:56:46 +0000
committerAndrew Trick <atrick@apple.com>2011-05-21 00:56:46 +0000
commitdc5948d47205fd05184a25251e128db6a47b25c2 (patch)
tree79eabc660d9d50197ac5b3182ac793e88b9dbc82 /tools
parent5c2256a5719172273eaef198f92d8af924ff8623 (diff)
downloadllvm-dc5948d47205fd05184a25251e128db6a47b25c2.tar.gz
llvm-dc5948d47205fd05184a25251e128db6a47b25c2.tar.bz2
llvm-dc5948d47205fd05184a25251e128db6a47b25c2.tar.xz
Have Program::Wait return -2 for crashed and timeouts instead of embedding
info in the error message. Per Dan's request. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131780 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r--tools/bugpoint/OptimizerDriver.cpp2
-rw-r--r--tools/bugpoint/ToolRunner.cpp13
2 files changed, 5 insertions, 10 deletions
diff --git a/tools/bugpoint/OptimizerDriver.cpp b/tools/bugpoint/OptimizerDriver.cpp
index c6be271ae2..336c83d7b1 100644
--- a/tools/bugpoint/OptimizerDriver.cpp
+++ b/tools/bugpoint/OptimizerDriver.cpp
@@ -223,7 +223,7 @@ bool BugDriver::runPasses(Module *Program,
if (result == -1)
outs() << "Execute failed: " << ErrMsg << "\n";
else
- outs() << "Crashed with signal #" << abs(result) << "\n";
+ outs() << "Crashed: " << ErrMsg << "\n";
}
if (result & 0x01000000)
outs() << "Dumped core\n";
diff --git a/tools/bugpoint/ToolRunner.cpp b/tools/bugpoint/ToolRunner.cpp
index f9d8603b5a..0d98262b43 100644
--- a/tools/bugpoint/ToolRunner.cpp
+++ b/tools/bugpoint/ToolRunner.cpp
@@ -50,11 +50,6 @@ namespace {
cl::desc("Remote execution (rsh/ssh) extra options"));
}
-// Add a prefix to ErrMsg if the program is terminated by a signal to
-// distinguish compiled program crashes from other execution
-// failures. Miscompilation likely results in SIGSEGV.
-static const char *SignalPrefix = "Signal - ";
-
/// RunProgramWithTimeout - This function provides an alternate interface
/// to the sys::Program::ExecuteAndWait interface.
/// @see sys::Program::ExecuteAndWait
@@ -82,7 +77,7 @@ static int RunProgramWithTimeout(const sys::Path &ProgramPath,
return
sys::Program::ExecuteAndWait(ProgramPath, Args, 0, redirects,
- NumSeconds, MemoryLimit, ErrMsg, SignalPrefix);
+ NumSeconds, MemoryLimit, ErrMsg);
}
/// RunProgramRemotelyWithTimeout - This function runs the given program
@@ -862,9 +857,9 @@ int GCC::ExecuteProgram(const std::string &ProgramFile,
int ExitCode = RunProgramWithTimeout(OutputBinary, &ProgramArgs[0],
sys::Path(InputFile), sys::Path(OutputFile), sys::Path(OutputFile),
Timeout, MemoryLimit, Error);
- // Treat a signal (usually SIGSEGV) as part of the program output so that
- // crash-causing miscompilation is handled seamlessly.
- if (Error->find(SignalPrefix) == 0) {
+ // Treat a signal (usually SIGSEGV) or timeout as part of the program output
+ // so that crash-causing miscompilation is handled seamlessly.
+ if (ExitCode < -1) {
std::ofstream outFile(OutputFile.c_str(), std::ios_base::app);
outFile << *Error << '\n';
outFile.close();