[llvm-commits] [llvm] r47899 - /llvm/trunk/lib/Archive/Archive.cpp

Anton Korobeynikov asl at math.spbu.ru
Tue Mar 4 12:15:35 PST 2008


Author: asl
Date: Tue Mar  4 14:15:35 2008
New Revision: 47899

URL: http://llvm.org/viewvc/llvm-project?rev=47899&view=rev
Log:
Add alias with non-external aliasee to the list of exported symbols of the library.

Modified:
    llvm/trunk/lib/Archive/Archive.cpp

Modified: llvm/trunk/lib/Archive/Archive.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Archive/Archive.cpp?rev=47899&r1=47898&r2=47899&view=diff

==============================================================================
--- llvm/trunk/lib/Archive/Archive.cpp (original)
+++ llvm/trunk/lib/Archive/Archive.cpp Tue Mar  4 14:15:35 2008
@@ -198,11 +198,20 @@
       if (!GI->getName().empty())
         symbols.push_back(GI->getName());
   
-  // Loop over functions.
+  // Loop over functions
   for (Module::iterator FI = M->begin(), FE = M->end(); FI != FE; ++FI)
     if (!FI->isDeclaration() && !FI->hasInternalLinkage())
       if (!FI->getName().empty())
         symbols.push_back(FI->getName());
+
+  // Loop over aliases
+  for (Module::alias_iterator AI = M->alias_begin(), AE = M->alias_end();
+       AI != AE; ++AI) {
+    const GlobalValue *Aliased = AI->getAliasedGlobal();
+    if (!Aliased->isDeclaration())
+      if (AI->hasName())
+        symbols.push_back(AI->getName());
+  }
 }
 
 // Get just the externally visible defined symbols from the bitcode





More information about the llvm-commits mailing list