summaryrefslogtreecommitdiff
path: root/tools/bugpoint/ExtractFunction.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-04-24 22:53:24 +0000
committerChris Lattner <sabre@nondot.org>2003-04-24 22:53:24 +0000
commit44be25716628941b4cccccf56a28ee0ba2606850 (patch)
treef1fde3de54c2bafb1e68facf400095c1b3260025 /tools/bugpoint/ExtractFunction.cpp
parent473a843f31af46de50e7b5747d0f3b41bbfe3fd8 (diff)
downloadllvm-44be25716628941b4cccccf56a28ee0ba2606850.tar.gz
llvm-44be25716628941b4cccccf56a28ee0ba2606850.tar.bz2
llvm-44be25716628941b4cccccf56a28ee0ba2606850.tar.xz
Remove dead functions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5913 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/bugpoint/ExtractFunction.cpp')
-rw-r--r--tools/bugpoint/ExtractFunction.cpp29
1 files changed, 1 insertions, 28 deletions
diff --git a/tools/bugpoint/ExtractFunction.cpp b/tools/bugpoint/ExtractFunction.cpp
index 007b726c2e..2148e405f5 100644
--- a/tools/bugpoint/ExtractFunction.cpp
+++ b/tools/bugpoint/ExtractFunction.cpp
@@ -15,31 +15,6 @@
#include "llvm/Type.h"
#include "llvm/Constant.h"
-/// extractFunctionFromModule - This method is used to extract the specified
-/// (non-external) function from the current program, slim down the module, and
-/// then return it. This does not modify Program at all, it modifies a copy,
-/// which it returns.
-Module *BugDriver::extractFunctionFromModule(Function *F) const {
- Module *Result = CloneModule(Program);
-
- // Translate from the old module to the new copied module...
- Module::iterator RFI = Result->begin(); // Get iterator to corresponding fn
- std::advance(RFI, std::distance(Program->begin(), Module::iterator(F)));
-
- // In addition to just parsing the input from GCC, we also want to spiff it up
- // a little bit. Do this now.
- //
- PassManager Passes;
- Passes.add(createFunctionExtractionPass(RFI)); // Extract the function
- Passes.add(createGlobalDCEPass()); // Delete unreachable globals
- Passes.add(createFunctionResolvingPass()); // Delete prototypes
- Passes.add(createDeadTypeEliminationPass()); // Remove dead types...
- Passes.add(createVerifierPass());
- Passes.run(*Result);
- return Result;
-}
-
-
/// deleteInstructionFromProgram - This method clones the current Program and
/// deletes the specified instruction from the cloned module. It then runs a
/// series of cleanup passes (ADCE and SimplifyCFG) to eliminate any code which
@@ -69,9 +44,7 @@ Module *BugDriver::deleteInstructionFromProgram(Instruction *I,
// Remove the instruction from the program.
I->getParent()->getInstList().erase(I);
- // In addition to just parsing the input from GCC, we also want to spiff it up
- // a little bit. Do this now.
- //
+ // Spiff up the output a little bit.
PassManager Passes;
if (Simplification > 2)
Passes.add(createAggressiveDCEPass()); // Remove dead code...