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

Chris Lattner sabre at nondot.org
Sun Jul 13 23:52:19 PDT 2008


Author: lattner
Date: Mon Jul 14 01:52:19 2008
New Revision: 53547

URL: http://llvm.org/viewvc/llvm-project?rev=53547&view=rev
Log:
don't do any linkage, not even type resolution, of symbols that have 
internal linkage.

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=53547&r1=53546&r2=53547&view=diff

==============================================================================
--- llvm/trunk/lib/Linker/LinkModules.cpp (original)
+++ llvm/trunk/lib/Linker/LinkModules.cpp Mon Jul 14 01:52:19 2008
@@ -548,13 +548,15 @@
       DGV = cast_or_null<GlobalValue>(DestSymTab.lookup(SGV->getNameStart(),
                                                         SGV->getNameEnd()));
     
+    // If we found a global with the same name in the dest module, but it has
+    // internal linkage, we are really not doing any linkage here.
+    if (DGV && DGV->hasInternalLinkage())
+      DGV = 0;
+    
     // If types don't agree due to opaque types, try to resolve them.
     if (DGV && DGV->getType() != SGV->getType())
       RecursiveResolveTypes(SGV->getType(), DGV->getType());
 
-    if (DGV && DGV->hasInternalLinkage())
-      DGV = 0;
-
     assert((SGV->hasInitializer() || SGV->hasExternalWeakLinkage() ||
             SGV->hasExternalLinkage() || SGV->hasDLLImportLinkage()) &&
            "Global must either be external or have an initializer!");
@@ -901,13 +903,15 @@
       DGV = cast_or_null<GlobalValue>(DestSymTab.lookup(SF->getNameStart(),
                                                         SF->getNameEnd()));
     
+    // If we found a global with the same name in the dest module, but it has
+    // internal linkage, we are really not doing any linkage here.
+    if (DGV && DGV->hasInternalLinkage())
+      DGV = 0;
+
     // If types don't agree due to opaque types, try to resolve them.
     if (DGV && DGV->getType() != SF->getType())
       RecursiveResolveTypes(SF->getType(), DGV->getType());
 
-    if (DGV && DGV->hasInternalLinkage())
-      DGV = 0;
-
     // If there is no linkage to be performed, just bring over SF without
     // modifying it.
     if (DGV == 0) {





More information about the llvm-commits mailing list