mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-19 06:31:18 +00:00
Ultimately resolve aliases during linking, if possible
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48259 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f1765e8298
commit
5241957b1f
@ -1087,11 +1087,10 @@ static bool LinkAppendingVars(Module *M,
|
|||||||
|
|
||||||
static bool ResolveAliases(Module *Dest) {
|
static bool ResolveAliases(Module *Dest) {
|
||||||
for (Module::alias_iterator I = Dest->alias_begin(), E = Dest->alias_end();
|
for (Module::alias_iterator I = Dest->alias_begin(), E = Dest->alias_end();
|
||||||
I != E; ++I) {
|
I != E; ++I)
|
||||||
GlobalValue* GV = const_cast<GlobalValue*>(I->getAliasedGlobal());
|
if (const GlobalValue *GV = I->resolveAliasedGlobal())
|
||||||
if (!GV->isDeclaration())
|
if (!GV->isDeclaration())
|
||||||
I->replaceAllUsesWith(GV);
|
I->replaceAllUsesWith(const_cast<GlobalValue*>(GV));
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user