Fix a major regression in my previous checkin
authorChris Lattner <sabre@nondot.org>
Wed, 4 Aug 2004 08:30:43 +0000 (08:30 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 4 Aug 2004 08:30:43 +0000 (08:30 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15486 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Linker/LinkModules.cpp
lib/VMCore/Linker.cpp

index 5eadc388b6d8ac9f141242196987af92a04b6336..d10b2ccd9b34a10a2ae926bca14f78e90ef0536f 100644 (file)
@@ -411,6 +411,8 @@ static bool LinkGlobals(Module *Dest, const Module *Src,
         GlobalsByName.find(SGV->getName());
       if (EGV != GlobalsByName.end())
         DGV = dyn_cast<GlobalVariable>(EGV->second);
+      if (DGV && RecursiveResolveTypes(SGV->getType(), DGV->getType(), ST, ""))
+        DGV = 0;  // FIXME: gross.
     }
 
     assert(SGV->hasInitializer() || SGV->hasExternalLinkage() &&
@@ -589,6 +591,8 @@ static bool LinkFunctionProtos(Module *Dest, const Module *Src,
         GlobalsByName.find(SF->getName());
       if (EF != GlobalsByName.end())
         DF = dyn_cast<Function>(EF->second);
+      if (DF && RecursiveResolveTypes(SF->getType(), DF->getType(), ST, ""))
+        DF = 0;  // FIXME: gross.
     }
 
     if (!DF || SF->hasInternalLinkage() || DF->hasInternalLinkage()) {
index 5eadc388b6d8ac9f141242196987af92a04b6336..d10b2ccd9b34a10a2ae926bca14f78e90ef0536f 100644 (file)
@@ -411,6 +411,8 @@ static bool LinkGlobals(Module *Dest, const Module *Src,
         GlobalsByName.find(SGV->getName());
       if (EGV != GlobalsByName.end())
         DGV = dyn_cast<GlobalVariable>(EGV->second);
+      if (DGV && RecursiveResolveTypes(SGV->getType(), DGV->getType(), ST, ""))
+        DGV = 0;  // FIXME: gross.
     }
 
     assert(SGV->hasInitializer() || SGV->hasExternalLinkage() &&
@@ -589,6 +591,8 @@ static bool LinkFunctionProtos(Module *Dest, const Module *Src,
         GlobalsByName.find(SF->getName());
       if (EF != GlobalsByName.end())
         DF = dyn_cast<Function>(EF->second);
+      if (DF && RecursiveResolveTypes(SF->getType(), DF->getType(), ST, ""))
+        DF = 0;  // FIXME: gross.
     }
 
     if (!DF || SF->hasInternalLinkage() || DF->hasInternalLinkage()) {