aboutsummaryrefslogtreecommitdiffstats
path: root/tools/bugpoint
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
commit7c955fdb446fa0629e1341f88f4541ee9a929942 (patch)
tree0c6db2e7f9e1c3c9ca798f52a61a21b3cd41f9d1 /tools/bugpoint
parent8517e1f0beea9b5e47974f083396d53294c390ad (diff)
downloadexternal_llvm-7c955fdb446fa0629e1341f88f4541ee9a929942.zip
external_llvm-7c955fdb446fa0629e1341f88f4541ee9a929942.tar.gz
external_llvm-7c955fdb446fa0629e1341f88f4541ee9a929942.tar.bz2
Be a bit more robust. Explicitly check for a code generator crash.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11624 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/bugpoint')
-rw-r--r--tools/bugpoint/BugDriver.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/tools/bugpoint/BugDriver.cpp b/tools/bugpoint/BugDriver.cpp
index d3a57f4..0726125 100644
--- a/tools/bugpoint/BugDriver.cpp
+++ b/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) {