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

Chris Lattner lattner at cs.uiuc.edu
Wed Feb 18 14:55:02 PST 2004


Changes in directory llvm/tools/bugpoint:

BugDriver.h updated: 1.23 -> 1.24
ExecutionDriver.cpp updated: 1.35 -> 1.36

---
Log message:

Update comments, if we are running with the CBE, make sure the Interpreter 
variable and the CBE variable are pointer equal.


---
Diffs of the changes:  (+13 -7)

Index: llvm/tools/bugpoint/BugDriver.h
diff -u llvm/tools/bugpoint/BugDriver.h:1.23 llvm/tools/bugpoint/BugDriver.h:1.24
--- llvm/tools/bugpoint/BugDriver.h:1.23	Wed Feb 11 12:37:32 2004
+++ llvm/tools/bugpoint/BugDriver.h	Wed Feb 18 14:52:02 2004
@@ -173,7 +173,8 @@
 
   /// executeProgram - This method runs "Program", capturing the output of the
   /// program to a file, returning the filename of the file.  A recommended
-  /// filename may be optionally specified.
+  /// filename may be optionally specified.  If there is a problem with the code
+  /// generator (e.g., llc crashes), this will throw an exception.
   ///
   std::string executeProgram(std::string RequestedOutputFilename = "",
                              std::string Bytecode = "",
@@ -182,13 +183,15 @@
                              bool *ProgramExitedNonzero = 0);
 
   /// executeProgramWithCBE - Used to create reference output with the C
-  /// backend, if reference output is not provided.
+  /// backend, if reference output is not provided.  If there is a problem with
+  /// the code generator (e.g., llc crashes), this will throw an exception.
   ///
   std::string executeProgramWithCBE(std::string OutputFile = "");
 
   /// diffProgram - This method executes the specified module and diffs the
   /// output against the file specified by ReferenceOutputFile.  If the output
-  /// is different, true is returned.
+  /// is different, true is returned.  If there is a problem with the code
+  /// generator (e.g., llc crashes), this will throw an exception.
   ///
   bool diffProgram(const std::string &BytecodeFile = "",
                    const std::string &SharedObj = "",


Index: llvm/tools/bugpoint/ExecutionDriver.cpp
diff -u llvm/tools/bugpoint/ExecutionDriver.cpp:1.35 llvm/tools/bugpoint/ExecutionDriver.cpp:1.36
--- llvm/tools/bugpoint/ExecutionDriver.cpp:1.35	Wed Feb 11 12:37:32 2004
+++ llvm/tools/bugpoint/ExecutionDriver.cpp	Wed Feb 18 14:52:02 2004
@@ -84,11 +84,12 @@
 
   // Create an instance of the AbstractInterpreter interface as specified on
   // the command line
+  cbe = 0;
   std::string Message;
   switch (InterpreterSel) {
   case AutoPick:
     InterpreterSel = RunCBE;
-    Interpreter = AbstractInterpreter::createCBE(getToolName(), Message);
+    Interpreter = cbe = AbstractInterpreter::createCBE(getToolName(), Message);
     if (!Interpreter) {
       InterpreterSel = RunJIT;
       Interpreter = AbstractInterpreter::createJIT(getToolName(), Message);
@@ -116,7 +117,7 @@
     Interpreter = AbstractInterpreter::createJIT(getToolName(), Message);
     break;
   case RunCBE:
-    Interpreter = AbstractInterpreter::createCBE(getToolName(), Message);
+    Interpreter = cbe = AbstractInterpreter::createCBE(getToolName(), Message);
     break;
   default:
     Message = "Sorry, this back-end is not supported by bugpoint right now!\n";
@@ -125,8 +126,10 @@
   std::cerr << Message;
 
   // Initialize auxiliary tools for debugging
-  cbe = AbstractInterpreter::createCBE(getToolName(), Message);
-  if (!cbe) { std::cout << Message << "\nExiting.\n"; exit(1); }
+  if (!cbe) {
+    cbe = AbstractInterpreter::createCBE(getToolName(), Message);
+    if (!cbe) { std::cout << Message << "\nExiting.\n"; exit(1); }
+  }
   gcc = GCC::create(getToolName(), Message);
   if (!gcc) { std::cout << Message << "\nExiting.\n"; exit(1); }
 





More information about the llvm-commits mailing list