[llvm-commits] CVS: llvm/tools/bugpoint/BugDriver.cpp

Chris Lattner lattner at cs.uiuc.edu
Thu Feb 19 11:04:06 PST 2004


Changes in directory llvm/tools/bugpoint:

BugDriver.cpp updated: 1.27 -> 1.28

---
Log message:

Be a bit more robust.  Explicitly check for a code generator crash.


---
Diffs of the changes:  (+16 -1)

Index: llvm/tools/bugpoint/BugDriver.cpp
diff -u llvm/tools/bugpoint/BugDriver.cpp:1.27 llvm/tools/bugpoint/BugDriver.cpp:1.28
--- llvm/tools/bugpoint/BugDriver.cpp:1.27	Thu Feb 19 01:39:26 2004
+++ llvm/tools/bugpoint/BugDriver.cpp	Thu Feb 19 11:03:49 2004
@@ -147,6 +147,16 @@
   // 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 @@
 
   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) {





More information about the llvm-commits mailing list