diff options
Diffstat (limited to 'tools/bugpoint/ExtractFunction.cpp')
-rw-r--r-- | tools/bugpoint/ExtractFunction.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tools/bugpoint/ExtractFunction.cpp b/tools/bugpoint/ExtractFunction.cpp index 9b5440c0d4..c99c8f32b5 100644 --- a/tools/bugpoint/ExtractFunction.cpp +++ b/tools/bugpoint/ExtractFunction.cpp @@ -81,3 +81,16 @@ Module *BugDriver::deleteInstructionFromProgram(Instruction *I, Passes.run(*Result); return Result; } + +/// 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... +/// +Module *BugDriver::performFinalCleanups() const { + PassManager CleanupPasses; + CleanupPasses.add(createFunctionResolvingPass()); + CleanupPasses.add(createGlobalDCEPass()); + Module *M = CloneModule(Program); + CleanupPasses.run(*M); + return M; +} |