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:
Anton Korobeynikov 2008-03-11 22:51:09 +00:00
parent f1765e8298
commit 5241957b1f

View File

@ -1087,11 +1087,10 @@ static bool LinkAppendingVars(Module *M,
static bool ResolveAliases(Module *Dest) {
for (Module::alias_iterator I = Dest->alias_begin(), E = Dest->alias_end();
I != E; ++I) {
GlobalValue* GV = const_cast<GlobalValue*>(I->getAliasedGlobal());
if (!GV->isDeclaration())
I->replaceAllUsesWith(GV);
}
I != E; ++I)
if (const GlobalValue *GV = I->resolveAliasedGlobal())
if (!GV->isDeclaration())
I->replaceAllUsesWith(const_cast<GlobalValue*>(GV));
return false;
}