diff options
author | Chris Lattner <sabre@nondot.org> | 2003-06-02 04:54:16 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-06-02 04:54:16 +0000 |
commit | b165ea31b7d136cb75939237694c761c69689aed (patch) | |
tree | a4746020895567f4513a28a134f4114fb2136cc4 /llvm/tools/bugpoint/OptimizerDriver.cpp | |
parent | f9162dc7132e984a0dacd2eb05979aae6d5ca46f (diff) | |
download | bcm5719-llvm-b165ea31b7d136cb75939237694c761c69689aed.tar.gz bcm5719-llvm-b165ea31b7d136cb75939237694c761c69689aed.zip |
Give better information about how the passes crash
llvm-svn: 6532
Diffstat (limited to 'llvm/tools/bugpoint/OptimizerDriver.cpp')
-rw-r--r-- | llvm/tools/bugpoint/OptimizerDriver.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/llvm/tools/bugpoint/OptimizerDriver.cpp b/llvm/tools/bugpoint/OptimizerDriver.cpp index fefca737951..d6beef541bd 100644 --- a/llvm/tools/bugpoint/OptimizerDriver.cpp +++ b/llvm/tools/bugpoint/OptimizerDriver.cpp @@ -133,8 +133,23 @@ bool BugDriver::runPasses(const std::vector<const PassInfo*> &Passes, if (DeleteOutput) removeFile(OutputFilename); - if (!Quiet) std::cout << (Status ? "Crashed!\n" : "Success!\n"); + bool ExitedOK = WIFEXITED(Status) && WEXITSTATUS(Status) == 0; + + if (!Quiet) { + if (ExitedOK) + std::cout << "Success!\n"; + else if (WIFEXITED(Status)) + std::cout << "Exited with error code '" << WEXITSTATUS(Status) << "'\n"; + else if (WIFSIGNALED(Status)) + std::cout << "Crashed with signal #" << WTERMSIG(Status) << "\n"; +#ifdef WCOREDUMP + else if (WCOREDUMP(Status)) + std::cout << "Dumped core\n"; +#endif + else + std::cout << "Failed for unknown reason!\n"; + } // Was the child successful? - return Status != 0; + return !ExitedOK; } |