diff options
author | Anton Korobeynikov <asl@math.spbu.ru> | 2008-03-05 15:11:00 +0000 |
---|---|---|
committer | Anton Korobeynikov <asl@math.spbu.ru> | 2008-03-05 15:11:00 +0000 |
commit | 12cee7195f6c68a89fe1df3cc84f1f4a4a325345 (patch) | |
tree | c387e3ac1381caaad59d3537e037046f412dacef /llvm/lib | |
parent | 5ddd03d88bd3f2095d560eb3ee5988da005dd7c4 (diff) | |
download | bcm5719-llvm-12cee7195f6c68a89fe1df3cc84f1f4a4a325345.tar.gz bcm5719-llvm-12cee7195f6c68a89fe1df3cc84f1f4a4a325345.zip |
Clarify the state-of-the-art
llvm-svn: 47944
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Linker/LinkModules.cpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/llvm/lib/Linker/LinkModules.cpp b/llvm/lib/Linker/LinkModules.cpp index 1ae609d4ab8..260bcb419fb 100644 --- a/llvm/lib/Linker/LinkModules.cpp +++ b/llvm/lib/Linker/LinkModules.cpp @@ -568,22 +568,25 @@ static bool LinkGlobals(Module *Dest, Module *Src, // LinkAlias - Loop through the alias in the src module and link them into the // dest module. static bool LinkAlias(Module *Dest, const Module *Src, std::string *Err) { + // FIXME: Desptie of the name, this function currently does not 'link' stuff, + // but only copies aliases from one Module to another. + // Loop over all alias in the src module for (Module::const_alias_iterator I = Src->alias_begin(), E = Src->alias_end(); I != E; ++I) { const GlobalAlias *GA = I; - GlobalValue *NewAliased = NULL; - const GlobalValue *Aliased = GA->getAliasedGlobal(); - if (isa<GlobalVariable>(*Aliased)) - NewAliased = Dest->getGlobalVariable(Aliased->getName()); - else if (isa<Function>(*Aliased)) - NewAliased = Dest->getFunction(Aliased->getName()); - // FIXME: we should handle the bitcast alias. - assert(NewAliased && "Can't find the aliased GV."); + GlobalValue *NewAliasee = NULL; + const GlobalValue *Aliasee = GA->getAliasedGlobal(); + if (isa<GlobalVariable>(Aliasee)) + NewAliasee = Dest->getGlobalVariable(Aliasee->getName()); + else if (isa<Function>(Aliasee)) + NewAliasee = Dest->getFunction(Aliasee->getName()); + // FIXME: we should handle the bitcasted aliasee. + assert(NewAliasee && "Can't find the aliased GV."); GlobalAlias *NewGA = new GlobalAlias(GA->getType(), GA->getLinkage(), - GA->getName(), NewAliased, Dest); + GA->getName(), NewAliasee, Dest); CopyGVAttributes(NewGA, GA); } return false; |