[llvm-commits] CVS: llvm/tools/bugpoint/BugDriver.h CodeGeneratorBug.cpp CrashDebugger.cpp ExtractFunction.cpp
Chris Lattner
lattner at cs.uiuc.edu
Wed Nov 5 15:16:01 PST 2003
Changes in directory llvm/tools/bugpoint:
BugDriver.h updated: 1.19 -> 1.20
CodeGeneratorBug.cpp updated: 1.29 -> 1.30
CrashDebugger.cpp updated: 1.22 -> 1.23
ExtractFunction.cpp updated: 1.17 -> 1.18
---
Log message:
Simplify the performFinalCleanups interface
---
Diffs of the changes: (+11 -13)
Index: llvm/tools/bugpoint/BugDriver.h
diff -u llvm/tools/bugpoint/BugDriver.h:1.19 llvm/tools/bugpoint/BugDriver.h:1.20
--- llvm/tools/bugpoint/BugDriver.h:1.19 Mon Oct 20 12:57:12 2003
+++ llvm/tools/bugpoint/BugDriver.h Wed Nov 5 15:15:19 2003
@@ -158,11 +158,11 @@
Module *deleteInstructionFromProgram(Instruction *I, unsigned Simp) const;
/// performFinalCleanups - This method clones the current Program and performs
- /// a series of cleanups intended to get rid of extra cruft on the module
- /// before handing it to the user... if the module parameter is specified, it
- /// operates directly on the specified Module, modifying it in place.
+ /// a series of cleanups intended to get rid of extra cruft on the module. If
+ /// the MayModifySemantics argument is true, then the cleanups is allowed to
+ /// modify how the code behaves.
///
- Module *performFinalCleanups(Module *M = 0) const;
+ void performFinalCleanups(Module *M, bool MayModifySemantics = false) const;
/// initializeExecutionEnvironment - This method is used to set up the
/// environment for executing LLVM programs.
Index: llvm/tools/bugpoint/CodeGeneratorBug.cpp
diff -u llvm/tools/bugpoint/CodeGeneratorBug.cpp:1.29 llvm/tools/bugpoint/CodeGeneratorBug.cpp:1.30
--- llvm/tools/bugpoint/CodeGeneratorBug.cpp:1.29 Mon Oct 20 14:43:47 2003
+++ llvm/tools/bugpoint/CodeGeneratorBug.cpp Wed Nov 5 15:15:19 2003
@@ -224,8 +224,8 @@
}
// Clean up the modules, removing extra cruft that we don't need anymore...
- SafeModule = BD.performFinalCleanups(SafeModule);
- TestModule = BD.performFinalCleanups(TestModule);
+ BD.performFinalCleanups(SafeModule);
+ BD.performFinalCleanups(TestModule);
if (BD.writeProgramToFile(TestModuleBC, TestModule)) {
std::cerr << "Error writing bytecode to `" << SafeModuleBC << "'\nExiting.";
Index: llvm/tools/bugpoint/CrashDebugger.cpp
diff -u llvm/tools/bugpoint/CrashDebugger.cpp:1.22 llvm/tools/bugpoint/CrashDebugger.cpp:1.23
--- llvm/tools/bugpoint/CrashDebugger.cpp:1.22 Sun Oct 26 22:44:59 2003
+++ llvm/tools/bugpoint/CrashDebugger.cpp Wed Nov 5 15:15:19 2003
@@ -378,7 +378,8 @@
// Try to clean up the testcase by running funcresolve and globaldce...
std::cout << "\n*** Attempting to perform final cleanups: ";
- Module *M = performFinalCleanups();
+ Module *M = CloneModule(Program);
+ performFinalCleanups(M, true);
std::swap(Program, M);
// Find out if the pass still crashes on the cleaned up program...
Index: llvm/tools/bugpoint/ExtractFunction.cpp
diff -u llvm/tools/bugpoint/ExtractFunction.cpp:1.17 llvm/tools/bugpoint/ExtractFunction.cpp:1.18
--- llvm/tools/bugpoint/ExtractFunction.cpp:1.17 Thu Oct 23 10:42:55 2003
+++ llvm/tools/bugpoint/ExtractFunction.cpp Wed Nov 5 15:15:19 2003
@@ -93,15 +93,13 @@
/// a series of cleanups intended to get rid of extra cruft on the module
/// before handing it to the user...
///
-Module *BugDriver::performFinalCleanups(Module *InM) const {
- Module *M = InM ? InM : CloneModule(Program);
-
+void BugDriver::performFinalCleanups(Module *M, bool MayModifySemantics) const {
// Allow disabling these passes if they crash bugpoint.
//
// FIXME: This should eventually run these passes in a pass list to prevent
// them from being able to crash bugpoint at all!
//
- if (NoFinalCleanup) return M;
+ if (NoFinalCleanup) return;
// Make all functions external, so GlobalDCE doesn't delete them...
for (Module::iterator I = M->begin(), E = M->end(); I != E; ++I)
@@ -113,8 +111,7 @@
CleanupPasses.add(createFunctionResolvingPass());
CleanupPasses.add(createGlobalDCEPass());
CleanupPasses.add(createDeadTypeEliminationPass());
- CleanupPasses.add(createDeadArgEliminationPass(InM == 0));
+ CleanupPasses.add(createDeadArgEliminationPass(MayModifySemantics));
CleanupPasses.add(createVerifierPass());
CleanupPasses.run(*M);
- return M;
}
More information about the llvm-commits
mailing list