From: Chris Lattner Date: Wed, 21 May 2003 19:41:31 +0000 (+0000) Subject: Increase odds that this won't bork things X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=28b8ed90c75ce6c271500fa778fef252f267a5ff;p=oota-llvm.git 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 --- diff --git a/tools/bugpoint/ExtractFunction.cpp b/tools/bugpoint/ExtractFunction.cpp index 452ddbc24d8..ac893629fb5 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());