Fix PR3667
[oota-llvm.git] / lib / Linker / LinkArchives.cpp
index 308a775acd2c590826abfb340b4889c1a6ad96a0..551cc8c390d86594de9813ec264ef9b488b5a5b7 100644 (file)
@@ -50,7 +50,7 @@ GetAllUndefinedSymbols(Module *M, std::set<std::string> &UndefinedSymbols) {
     if (I->hasName()) {
       if (I->isDeclaration())
         UndefinedSymbols.insert(I->getName());
-      else if (!I->hasInternalLinkage()) {
+      else if (!I->hasLocalLinkage()) {
         assert(!I->hasDLLImportLinkage()
                && "Found dllimported non-external symbol!");
         DefinedSymbols.insert(I->getName());
@@ -62,7 +62,7 @@ GetAllUndefinedSymbols(Module *M, std::set<std::string> &UndefinedSymbols) {
     if (I->hasName()) {
       if (I->isDeclaration())
         UndefinedSymbols.insert(I->getName());
-      else if (!I->hasInternalLinkage()) {
+      else if (!I->hasLocalLinkage()) {
         assert(!I->hasDLLImportLinkage()
                && "Found dllimported non-external symbol!");
         DefinedSymbols.insert(I->getName());
@@ -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();