summaryrefslogtreecommitdiffstats
path: root/llvm/tools/bugpoint/ExtractFunction.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools/bugpoint/ExtractFunction.cpp')
-rw-r--r--llvm/tools/bugpoint/ExtractFunction.cpp6
1 files changed, 3 insertions, 3 deletions
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