summaryrefslogtreecommitdiffstats
path: root/llvm/tools/bugpoint/BugDriver.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-02-19 17:03:49 +0000
committerChris Lattner <sabre@nondot.org>2004-02-19 17:03:49 +0000
commit5e9868a77b1c6dda3212cb6ef19896de7530586b (patch)
tree5082338481db901ec88b4dc0f7cd2b81919d7fae /llvm/tools/bugpoint/BugDriver.cpp
parent63f41abfe674e7497c56c5fefa728521e7483a0e (diff)
downloadbcm5719-llvm-5e9868a77b1c6dda3212cb6ef19896de7530586b.tar.gz
bcm5719-llvm-5e9868a77b1c6dda3212cb6ef19896de7530586b.zip
Be a bit more robust. Explicitly check for a code generator crash.
llvm-svn: 11624
Diffstat (limited to 'llvm/tools/bugpoint/BugDriver.cpp')
-rw-r--r--llvm/tools/bugpoint/BugDriver.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/llvm/tools/bugpoint/BugDriver.cpp b/llvm/tools/bugpoint/BugDriver.cpp
index d3a57f4afe2..07261257a77 100644
--- a/llvm/tools/bugpoint/BugDriver.cpp
+++ b/llvm/tools/bugpoint/BugDriver.cpp
@@ -147,6 +147,16 @@ bool BugDriver::run() {
// Set up the execution environment, selecting a method to run LLVM bytecode.
if (initializeExecutionEnvironment()) return true;
+ // Test to see if we have a code generator crash.
+ std::cout << "Running the code generator to test for a crash: ";
+ try {
+ compileProgram(Program);
+ } catch (ToolExecutionError &TEE) {
+ std::cout << TEE.what();
+ return debugCodeGeneratorCrash();
+ }
+
+
// Run the raw input to see where we are coming from. If a reference output
// was specified, make sure that the raw output matches it. If not, it's a
// problem in the front-end or the code generator.
@@ -189,7 +199,12 @@ bool BugDriver::run() {
std::cout << "\n*** Input program does not match reference diff!\n";
std::cout << "Debugging code generator problem!\n";
- return debugCodeGenerator();
+ try {
+ return debugCodeGenerator();
+ } catch (ToolExecutionError &TEE) {
+ std::cerr << TEE.what();
+ return debugCodeGeneratorCrash();
+ }
}
void BugDriver::PrintFunctionList(const std::vector<Function*> &Funcs) {
OpenPOWER on IntegriCloud