From 1b5ec068f5f068e4b8e600007e2fa126fafe796f Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Sun, 6 Mar 2011 23:41:34 +0000 Subject: [PATCH] Don't internalize available_externally functions. We already did the right thing for variables. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127138 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/IPO/Internalize.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/Transforms/IPO/Internalize.cpp b/lib/Transforms/IPO/Internalize.cpp index 9b9ebad472..8b7253ed75 100644 --- a/lib/Transforms/IPO/Internalize.cpp +++ b/lib/Transforms/IPO/Internalize.cpp @@ -126,6 +126,8 @@ bool InternalizePass::runOnModule(Module &M) { // FIXME: maybe use private linkage? for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) if (!I->isDeclaration() && // Function must be defined here + // Available externally is really just a "declaration with a body". + !I->hasAvailableExternallyLinkage() && !I->hasLocalLinkage() && // Can't already have internal linkage !ExternalNames.count(I->getName())) {// Not marked to keep external? I->setLinkage(GlobalValue::InternalLinkage); -- 2.11.4.GIT