[llvm-commits] [llvm] r47944 - /llvm/trunk/lib/Linker/LinkModules.cpp

Anton Korobeynikov asl at math.spbu.ru
Wed Mar 5 07:11:01 PST 2008


Author: asl
Date: Wed Mar  5 09:11:00 2008
New Revision: 47944

URL: http://llvm.org/viewvc/llvm-project?rev=47944&view=rev
Log:
Clarify the state-of-the-art

Modified:
    llvm/trunk/lib/Linker/LinkModules.cpp

Modified: llvm/trunk/lib/Linker/LinkModules.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Linker/LinkModules.cpp?rev=47944&r1=47943&r2=47944&view=diff

==============================================================================
--- llvm/trunk/lib/Linker/LinkModules.cpp (original)
+++ llvm/trunk/lib/Linker/LinkModules.cpp Wed Mar  5 09:11:00 2008
@@ -568,22 +568,25 @@
 // 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;





More information about the llvm-commits mailing list