Don't internalize available_externally functions. We already did the right

thing for variables.

llvm-svn: 127138
This commit is contained in:
Rafael Espindola 2011-03-06 23:41:34 +00:00
parent b86f5f4106
commit 871cfde1c2
1 changed files with 2 additions and 0 deletions

View File

@ -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);