summaryrefslogtreecommitdiffstats
path: root/llvm/tools/bugpoint/ExtractFunction.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-11-05 21:15:19 +0000
committerChris Lattner <sabre@nondot.org>2003-11-05 21:15:19 +0000
commitdebac38f5e1cbc1aeb2be41ac429ce7e16a8659e (patch)
treeee1318538c7ccbaeb842049ee18937044089c511 /llvm/tools/bugpoint/ExtractFunction.cpp
parent8055fb3afac2e9f4209787cc919289414bae24e9 (diff)
downloadbcm5719-llvm-debac38f5e1cbc1aeb2be41ac429ce7e16a8659e.tar.gz
bcm5719-llvm-debac38f5e1cbc1aeb2be41ac429ce7e16a8659e.zip
Simplify the performFinalCleanups interface
llvm-svn: 9740
Diffstat (limited to 'llvm/tools/bugpoint/ExtractFunction.cpp')
-rw-r--r--llvm/tools/bugpoint/ExtractFunction.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/llvm/tools/bugpoint/ExtractFunction.cpp b/llvm/tools/bugpoint/ExtractFunction.cpp
index c65b482b01e..2d7747af775 100644
--- a/llvm/tools/bugpoint/ExtractFunction.cpp
+++ b/llvm/tools/bugpoint/ExtractFunction.cpp
@@ -93,15 +93,13 @@ 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(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 @@ Module *BugDriver::performFinalCleanups(Module *InM) const {
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;
}
OpenPOWER on IntegriCloud