Fix major problem with appending linkage changes
authorChris Lattner <sabre@nondot.org>
Wed, 14 May 2003 12:11:51 +0000 (12:11 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 14 May 2003 12:11:51 +0000 (12:11 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6185 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Linker/LinkModules.cpp
lib/Transforms/Utils/Linker.cpp
lib/VMCore/Linker.cpp

index 13afe1fa93c35d6cda65d1f50f342ccceecc0d03..c4d4fc64ce88554c7788aff4335fe31c3e5b0d2b 100644 (file)
@@ -597,7 +597,8 @@ bool LinkModules(Module *Dest, const Module *Src, std::string *ErrorMsg) {
   // Add all of the appending globals already in the Dest module to
   // AppendingVars.
   for (Module::giterator I = Dest->gbegin(), E = Dest->gend(); I != E; ++I)
-    AppendingVars.insert(std::make_pair(I->getName(), I));
+    if (I->hasAppendingLinkage())
+      AppendingVars.insert(std::make_pair(I->getName(), I));
 
   // Insert all of the globals in src into the Dest module... without linking
   // initializers (which could refer to functions not yet mapped over).
index 13afe1fa93c35d6cda65d1f50f342ccceecc0d03..c4d4fc64ce88554c7788aff4335fe31c3e5b0d2b 100644 (file)
@@ -597,7 +597,8 @@ bool LinkModules(Module *Dest, const Module *Src, std::string *ErrorMsg) {
   // Add all of the appending globals already in the Dest module to
   // AppendingVars.
   for (Module::giterator I = Dest->gbegin(), E = Dest->gend(); I != E; ++I)
-    AppendingVars.insert(std::make_pair(I->getName(), I));
+    if (I->hasAppendingLinkage())
+      AppendingVars.insert(std::make_pair(I->getName(), I));
 
   // Insert all of the globals in src into the Dest module... without linking
   // initializers (which could refer to functions not yet mapped over).
index 13afe1fa93c35d6cda65d1f50f342ccceecc0d03..c4d4fc64ce88554c7788aff4335fe31c3e5b0d2b 100644 (file)
@@ -597,7 +597,8 @@ bool LinkModules(Module *Dest, const Module *Src, std::string *ErrorMsg) {
   // Add all of the appending globals already in the Dest module to
   // AppendingVars.
   for (Module::giterator I = Dest->gbegin(), E = Dest->gend(); I != E; ++I)
-    AppendingVars.insert(std::make_pair(I->getName(), I));
+    if (I->hasAppendingLinkage())
+      AppendingVars.insert(std::make_pair(I->getName(), I));
 
   // Insert all of the globals in src into the Dest module... without linking
   // initializers (which could refer to functions not yet mapped over).