aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Linker
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2008-03-11 22:51:09 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2008-03-11 22:51:09 +0000
commit5241957b1f6876452705f94e0ed60dd2c33a5c84 (patch)
treeb81eda3fe355f0d3cf717b54a394f4bdfcb081d3 /lib/Linker
parentf1765e8298f21ad3bea2a0e301f5ff47802a80bb (diff)
downloadexternal_llvm-5241957b1f6876452705f94e0ed60dd2c33a5c84.zip
external_llvm-5241957b1f6876452705f94e0ed60dd2c33a5c84.tar.gz
external_llvm-5241957b1f6876452705f94e0ed60dd2c33a5c84.tar.bz2
Ultimately resolve aliases during linking, if possible
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48259 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Linker')
-rw-r--r--lib/Linker/LinkModules.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/Linker/LinkModules.cpp b/lib/Linker/LinkModules.cpp
index 3d6e526..32c4990 100644
--- a/lib/Linker/LinkModules.cpp
+++ b/lib/Linker/LinkModules.cpp
@@ -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;
}