mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-21 08:17:40 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user