summaryrefslogtreecommitdiff
path: root/tools/bugpoint
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2006-08-21 06:04:45 +0000
committerReid Spencer <rspencer@reidspencer.com>2006-08-21 06:04:45 +0000
commit8ea5ecb0564b8822c70ad84202471f03e2690da7 (patch)
tree2b32a1dc217579d1cc5799b60e575dcb0a6dcc5d /tools/bugpoint
parent4ce5dc63778f36f61b510456783f15a224406e68 (diff)
downloadllvm-8ea5ecb0564b8822c70ad84202471f03e2690da7.tar.gz
llvm-8ea5ecb0564b8822c70ad84202471f03e2690da7.tar.bz2
llvm-8ea5ecb0564b8822c70ad84202471f03e2690da7.tar.xz
For PR797:
Adjust usage of the ExecuteAndWait function to use the last argument which is the ErrMsg string. This is necessitated because this function no longer throws exceptions on error. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29791 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/bugpoint')
-rw-r--r--tools/bugpoint/OptimizerDriver.cpp13
-rw-r--r--tools/bugpoint/ToolRunner.cpp2
2 files changed, 9 insertions, 6 deletions
diff --git a/tools/bugpoint/OptimizerDriver.cpp b/tools/bugpoint/OptimizerDriver.cpp
index 0ac514bbef..4311200cc3 100644
--- a/tools/bugpoint/OptimizerDriver.cpp
+++ b/tools/bugpoint/OptimizerDriver.cpp
@@ -179,7 +179,8 @@ bool BugDriver::runPasses(const std::vector<const PassInfo*> &Passes,
args[n++] = 0;
sys::Path prog(sys::Program::FindProgramByName(ToolName));
- int result = sys::Program::ExecuteAndWait(prog,args,0,0,Timeout);
+ std::string ErrMsg;
+ int result = sys::Program::ExecuteAndWait(prog,args,0,0,Timeout,&ErrMsg);
// If we are supposed to delete the bytecode file or if the passes crashed,
// remove it now. This may fail if the file was never created, but that's ok.
@@ -194,10 +195,12 @@ bool BugDriver::runPasses(const std::vector<const PassInfo*> &Passes,
std::cout << "Success!\n";
else if (result > 0)
std::cout << "Exited with error code '" << result << "'\n";
- else if (result == -9999)
- std::cout << "Program not executable\n";
- else if (result < 0)
- std::cout << "Crashed with signal #" << abs(result) << "\n";
+ else if (result < 0) {
+ if (result == -1)
+ std::cout << "Execute failed: " << ErrMsg << "\n";
+ else
+ std::cout << "Crashed with signal #" << abs(result) << "\n";
+ }
if (result & 0x01000000)
std::cout << "Dumped core\n";
}
diff --git a/tools/bugpoint/ToolRunner.cpp b/tools/bugpoint/ToolRunner.cpp
index 067bf658c7..8712baf353 100644
--- a/tools/bugpoint/ToolRunner.cpp
+++ b/tools/bugpoint/ToolRunner.cpp
@@ -55,7 +55,7 @@ static void ProcessFailure(sys::Path ProgPath, const char** Args) {
sys::Path ErrorFilename("error_messages");
ErrorFilename.makeUnique();
RunProgramWithTimeout(ProgPath, Args, sys::Path(""), ErrorFilename,
- ErrorFilename); // FIXME: check return code
+ ErrorFilename); // FIXME: check return code ?
// Print out the error messages generated by GCC if possible...
std::ifstream ErrorFile(ErrorFilename.c_str());