Fix thinko: alias always defines new symbol. Even is aliasee itself is undefined.
authorAnton Korobeynikov <asl@math.spbu.ru>
Tue, 11 Mar 2008 00:24:53 +0000 (00:24 +0000)
committerAnton Korobeynikov <asl@math.spbu.ru>
Tue, 11 Mar 2008 00:24:53 +0000 (00:24 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48203 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Archive/Archive.cpp
lib/Linker/LinkArchives.cpp

index 7df5e48f9fa2a6953d3d7257fa3d2f77f0b54ab5..6c95dbe372e79714e24d286ed03f90af4d8a486a 100644 (file)
@@ -207,10 +207,8 @@ static void getSymbols(Module*M, std::vector<std::string>& symbols) {
   // 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());
+    if (AI->hasName())
+      symbols.push_back(AI->getName());
   }
 }
 
index 308a775acd2c590826abfb340b4889c1a6ad96a0..6cab77c60106b68f27807c012068e05b6e932a9b 100644 (file)
@@ -71,13 +71,8 @@ GetAllUndefinedSymbols(Module *M, std::set<std::string> &UndefinedSymbols) {
 
   for (Module::alias_iterator I = M->alias_begin(), E = M->alias_end();
        I != E; ++I)
-    if (I->hasName()) {
-      const GlobalValue *Aliased = I->getAliasedGlobal();
-      if (Aliased->isDeclaration())
-        UndefinedSymbols.insert(I->getName());
-      else
-        DefinedSymbols.insert(I->getName());
-    }
+    if (I->hasName())
+      DefinedSymbols.insert(I->getName());
 
   // Prune out any defined symbols from the undefined symbols set...
   for (std::set<std::string>::iterator I = UndefinedSymbols.begin();