[llvm-commits] [llvm] r110306 - in /llvm/trunk/tools/bugpoint: BugDriver.h CrashDebugger.cpp ExecutionDriver.cpp

Rafael Espindola rafael.espindola at gmail.com
Wed Aug 4 20:00:22 PDT 2010


Author: rafael
Date: Wed Aug  4 22:00:22 2010
New Revision: 110306

URL: http://llvm.org/viewvc/llvm-project?rev=110306&view=rev
Log:
Add const to compileProgram and to the various test functions in CrashDebugger.

Modified:
    llvm/trunk/tools/bugpoint/BugDriver.h
    llvm/trunk/tools/bugpoint/CrashDebugger.cpp
    llvm/trunk/tools/bugpoint/ExecutionDriver.cpp

Modified: llvm/trunk/tools/bugpoint/BugDriver.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/BugDriver.h?rev=110306&r1=110305&r2=110306&view=diff
==============================================================================
--- llvm/trunk/tools/bugpoint/BugDriver.h (original)
+++ llvm/trunk/tools/bugpoint/BugDriver.h Wed Aug  4 22:00:22 2010
@@ -165,7 +165,7 @@
   /// setting Error if an error occurs.  This is used for code generation
   /// crash testing.
   ///
-  void compileProgram(Module *M, std::string *Error);
+  void compileProgram(Module *M, std::string *Error) const;
 
   /// executeProgram - This method runs "Program", capturing the output of the
   /// program to a file.  A recommended filename may be optionally specified.

Modified: llvm/trunk/tools/bugpoint/CrashDebugger.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/CrashDebugger.cpp?rev=110306&r1=110305&r2=110306&view=diff
==============================================================================
--- llvm/trunk/tools/bugpoint/CrashDebugger.cpp (original)
+++ llvm/trunk/tools/bugpoint/CrashDebugger.cpp Wed Aug  4 22:00:22 2010
@@ -106,10 +106,10 @@
   ///
   class ReduceCrashingGlobalVariables : public ListReducer<GlobalVariable*> {
     BugDriver &BD;
-    bool (*TestFn)(BugDriver &, Module *);
+    bool (*TestFn)(const BugDriver &, Module *);
   public:
     ReduceCrashingGlobalVariables(BugDriver &bd,
-                                  bool (*testFn)(BugDriver &, Module *))
+                                  bool (*testFn)(const BugDriver &, Module *))
       : BD(bd), TestFn(testFn) {}
 
     virtual TestResult doTest(std::vector<GlobalVariable*> &Prefix,
@@ -176,10 +176,10 @@
   ///
   class ReduceCrashingFunctions : public ListReducer<Function*> {
     BugDriver &BD;
-    bool (*TestFn)(BugDriver &, Module *);
+    bool (*TestFn)(const BugDriver &, Module *);
   public:
     ReduceCrashingFunctions(BugDriver &bd,
-                            bool (*testFn)(BugDriver &, Module *))
+                            bool (*testFn)(const BugDriver &, Module *))
       : BD(bd), TestFn(testFn) {}
 
     virtual TestResult doTest(std::vector<Function*> &Prefix,
@@ -249,9 +249,10 @@
   ///
   class ReduceCrashingBlocks : public ListReducer<const BasicBlock*> {
     BugDriver &BD;
-    bool (*TestFn)(BugDriver &, Module *);
+    bool (*TestFn)(const BugDriver &, Module *);
   public:
-    ReduceCrashingBlocks(BugDriver &bd, bool (*testFn)(BugDriver &, Module *))
+    ReduceCrashingBlocks(BugDriver &bd,
+                         bool (*testFn)(const BugDriver &, Module *))
       : BD(bd), TestFn(testFn) {}
 
     virtual TestResult doTest(std::vector<const BasicBlock*> &Prefix,
@@ -348,10 +349,10 @@
   ///
   class ReduceCrashingInstructions : public ListReducer<const Instruction*> {
     BugDriver &BD;
-    bool (*TestFn)(BugDriver &, Module *);
+    bool (*TestFn)(const BugDriver &, Module *);
   public:
-    ReduceCrashingInstructions(BugDriver &bd, bool (*testFn)(BugDriver &,
-                                                             Module *))
+    ReduceCrashingInstructions(BugDriver &bd,
+                               bool (*testFn)(const BugDriver &, Module *))
       : BD(bd), TestFn(testFn) {}
 
     virtual TestResult doTest(std::vector<const Instruction*> &Prefix,
@@ -422,7 +423,8 @@
 /// DebugACrash - Given a predicate that determines whether a component crashes
 /// on a program, try to destructively reduce the program while still keeping
 /// the predicate true.
-static bool DebugACrash(BugDriver &BD, bool (*TestFn)(BugDriver &, Module *),
+static bool DebugACrash(BugDriver &BD,
+                        bool (*TestFn)(const BugDriver &, Module *),
                         std::string &Error) {
   // See if we can get away with nuking some of the global variable initializers
   // in the program...
@@ -607,7 +609,7 @@
   return false;
 }
 
-static bool TestForOptimizerCrash(BugDriver &BD, Module *M) {
+static bool TestForOptimizerCrash(const BugDriver &BD, Module *M) {
   return BD.runPasses(M);
 }
 
@@ -635,7 +637,7 @@
   return Success;
 }
 
-static bool TestForCodeGenCrash(BugDriver &BD, Module *M) {
+static bool TestForCodeGenCrash(const BugDriver &BD, Module *M) {
   std::string Error;
   BD.compileProgram(M, &Error);
   if (!Error.empty()) {

Modified: llvm/trunk/tools/bugpoint/ExecutionDriver.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/ExecutionDriver.cpp?rev=110306&r1=110305&r2=110306&view=diff
==============================================================================
--- llvm/trunk/tools/bugpoint/ExecutionDriver.cpp (original)
+++ llvm/trunk/tools/bugpoint/ExecutionDriver.cpp Wed Aug  4 22:00:22 2010
@@ -293,7 +293,7 @@
 /// setting Error if an error occurs.  This is used for code generation
 /// crash testing.
 ///
-void BugDriver::compileProgram(Module *M, std::string *Error) {
+void BugDriver::compileProgram(Module *M, std::string *Error) const {
   // Emit the program to a bitcode file...
   sys::Path BitcodeFile (OutputPrefix + "-test-program.bc");
   std::string ErrMsg;





More information about the llvm-commits mailing list