Ultimately resolve aliases during linking, if possible
llvm-svn: 48259
This commit is contained in:
parent
80b53b8f6b
commit
e6d90f5a95
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue