summaryrefslogtreecommitdiffstats
path: root/llvm/tools
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-08-01 16:13:49 +0000
committerChris Lattner <sabre@nondot.org>2003-08-01 16:13:49 +0000
commitf7e125403bcbc2216fdc20eb70f659cafee89061 (patch)
tree728de05cdbee76e3fc570fc30876c1de9b1ed0c1 /llvm/tools
parent89f93976689925fdd8c6456c3f3aa0f20fdb9c0f (diff)
downloadbcm5719-llvm-f7e125403bcbc2216fdc20eb70f659cafee89061.tar.gz
bcm5719-llvm-f7e125403bcbc2216fdc20eb70f659cafee89061.zip
Parameterize the performFinalCleanups a bit
llvm-svn: 7477
Diffstat (limited to 'llvm/tools')
-rw-r--r--llvm/tools/bugpoint/BugDriver.h5
-rw-r--r--llvm/tools/bugpoint/ExtractFunction.cpp6
2 files changed, 6 insertions, 5 deletions
diff --git a/llvm/tools/bugpoint/BugDriver.h b/llvm/tools/bugpoint/BugDriver.h
index 40c170a36af..f86782a0bc9 100644
--- a/llvm/tools/bugpoint/BugDriver.h
+++ b/llvm/tools/bugpoint/BugDriver.h
@@ -147,9 +147,10 @@ private:
/// 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...
+ /// before handing it to the user... if the module parameter is specified, it
+ /// operates directly on the specified Module, modifying it in place.
///
- Module *performFinalCleanups() const;
+ Module *performFinalCleanups(Module *M = 0) const;
/// initializeExecutionEnvironment - This method is used to set up the
/// environment for executing LLVM programs.
diff --git a/llvm/tools/bugpoint/ExtractFunction.cpp b/llvm/tools/bugpoint/ExtractFunction.cpp
index 1aefcefad4b..525c7467f16 100644
--- a/llvm/tools/bugpoint/ExtractFunction.cpp
+++ b/llvm/tools/bugpoint/ExtractFunction.cpp
@@ -79,8 +79,8 @@ Module *BugDriver::deleteInstructionFromProgram(Instruction *I,
/// a series of cleanups intended to get rid of extra cruft on the module
/// before handing it to the user...
///
-Module *BugDriver::performFinalCleanups() const {
- Module *M = CloneModule(Program);
+Module *BugDriver::performFinalCleanups(Module *InM) const {
+ Module *M = InM ? InM : CloneModule(Program);
// Allow disabling these passes if they crash bugpoint.
//
@@ -97,7 +97,7 @@ Module *BugDriver::performFinalCleanups() const {
CleanupPasses.add(createFunctionResolvingPass());
CleanupPasses.add(createGlobalDCEPass());
CleanupPasses.add(createDeadTypeEliminationPass());
- CleanupPasses.add(createDeadArgEliminationPass(true));
+ CleanupPasses.add(createDeadArgEliminationPass(InM == 0));
CleanupPasses.add(createVerifierPass());
CleanupPasses.run(*M);
return M;
OpenPOWER on IntegriCloud