diff options
author | Chris Lattner <sabre@nondot.org> | 2003-05-21 19:41:31 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-05-21 19:41:31 +0000 |
commit | 28b8ed90c75ce6c271500fa778fef252f267a5ff (patch) | |
tree | 8b9153e633607f72ab51d6dd2516f624303d9638 /tools/bugpoint/ExtractFunction.cpp | |
parent | c97a2075d997149f3e5d1eb9c824a7a3faeb95cf (diff) |
Increase odds that this won't bork things
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6267 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/bugpoint/ExtractFunction.cpp')
-rw-r--r-- | tools/bugpoint/ExtractFunction.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/bugpoint/ExtractFunction.cpp b/tools/bugpoint/ExtractFunction.cpp index 452ddbc24d..ac893629fb 100644 --- a/tools/bugpoint/ExtractFunction.cpp +++ b/tools/bugpoint/ExtractFunction.cpp @@ -78,6 +78,11 @@ Module *BugDriver::deleteInstructionFromProgram(Instruction *I, /// Module *BugDriver::performFinalCleanups() const { Module *M = CloneModule(Program); + + // Make all functions external, so GlobalDCE doesn't delete them... + for (Module::iterator I = M->begin(), E = M->end(); I != E; ++I) + I->setLinkage(GlobalValue::ExternalLinkage); + PassManager CleanupPasses; CleanupPasses.add(createFunctionResolvingPass()); CleanupPasses.add(createGlobalDCEPass()); |