For PR1136: Rename GlobalVariable::isExternal as isDeclaration to avoid

confusion with external linkage types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33663 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Reid Spencer
2007-01-30 20:08:39 +00:00
parent 2574fe5a22
commit 5cbf985dcb
72 changed files with 1197 additions and 1372 deletions
+3 -3
View File
@@ -96,7 +96,7 @@ bool InternalizePass::runOnModule(Module &M) {
//
if (ExternalNames.empty()) {
Function *MainFunc = M.getMainFunction();
if (MainFunc == 0 || MainFunc->isExternal())
if (MainFunc == 0 || MainFunc->isDeclaration())
return false; // No main found, must be a library...
// Preserve main, internalize all else.
@@ -107,7 +107,7 @@ bool InternalizePass::runOnModule(Module &M) {
// Found a main function, mark all functions not named main as internal.
for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
if (!I->isExternal() && // Function must be defined here
if (!I->isDeclaration() && // Function must be defined here
!I->hasInternalLinkage() && // Can't already have internal linkage
!ExternalNames.count(I->getName())) {// Not marked to keep external?
I->setLinkage(GlobalValue::InternalLinkage);
@@ -129,7 +129,7 @@ bool InternalizePass::runOnModule(Module &M) {
// Mark all global variables with initializers as internal as well.
for (Module::global_iterator I = M.global_begin(), E = M.global_end();
I != E; ++I)
if (!I->isExternal() && !I->hasInternalLinkage() &&
if (!I->isDeclaration() && !I->hasInternalLinkage() &&
!ExternalNames.count(I->getName())) {
// Special case handling of the global ctor and dtor list. When we
// internalize it, we mark it constant, which allows elimination of