summaryrefslogtreecommitdiffstats
path: root/llvm/tools/bugpoint/ExtractFunction.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-02-28 16:13:20 +0000
committerChris Lattner <sabre@nondot.org>2003-02-28 16:13:20 +0000
commit514c02eb260bc0e9a7ddfdccc959bbfae79de42c (patch)
tree6a98ed6c8db64bfbf69e4c6aa34f8a108fdf58ac /llvm/tools/bugpoint/ExtractFunction.cpp
parent32a39c26e0117d895621f0727643812379054961 (diff)
downloadbcm5719-llvm-514c02eb260bc0e9a7ddfdccc959bbfae79de42c.tar.gz
bcm5719-llvm-514c02eb260bc0e9a7ddfdccc959bbfae79de42c.zip
* 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
Diffstat (limited to 'llvm/tools/bugpoint/ExtractFunction.cpp')
-rw-r--r--llvm/tools/bugpoint/ExtractFunction.cpp13
1 files changed, 13 insertions, 0 deletions
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;
+}
OpenPOWER on IntegriCloud