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
diff --git a/tools/bugpoint/ToolRunner.cpp b/tools/bugpoint/ToolRunner.cpp
index f9d8603..0d98262 100644
--- a/tools/bugpoint/ToolRunner.cpp
+++ b/tools/bugpoint/ToolRunner.cpp
@@ -50,11 +50,6 @@
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 @@
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 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();