summaryrefslogtreecommitdiff
path: root/tools/bugpoint/ExtractFunction.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-05-21 19:41:31 +0000
committerChris Lattner <sabre@nondot.org>2003-05-21 19:41:31 +0000
commit28b8ed90c75ce6c271500fa778fef252f267a5ff (patch)
tree8b9153e633607f72ab51d6dd2516f624303d9638 /tools/bugpoint/ExtractFunction.cpp
parentc97a2075d997149f3e5d1eb9c824a7a3faeb95cf (diff)
downloadllvm-28b8ed90c75ce6c271500fa778fef252f267a5ff.tar.gz
llvm-28b8ed90c75ce6c271500fa778fef252f267a5ff.tar.bz2
llvm-28b8ed90c75ce6c271500fa778fef252f267a5ff.tar.xz
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.cpp5
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());