From 514c02eb260bc0e9a7ddfdccc959bbfae79de42c Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 28 Feb 2003 16:13:20 +0000 Subject: * Reduce the number of useless bytecode files produced by bugpoint. - This also speeds it up as the bytecode writer isn't terribly fast. * Add a new cleanup pass after everything else to run -funcresolve -globaldce llvm-svn: 5668 --- llvm/tools/bugpoint/ExtractFunction.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'llvm/tools/bugpoint/ExtractFunction.cpp') diff --git a/llvm/tools/bugpoint/ExtractFunction.cpp b/llvm/tools/bugpoint/ExtractFunction.cpp index 9b5440c0d4e..c99c8f32b5f 100644 --- a/llvm/tools/bugpoint/ExtractFunction.cpp +++ b/llvm/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; +} -- cgit v1.2.3