[llvm-branch-commits] [llvm-branch] r134475 - /llvm/branches/type-system-rewrite/lib/Linker/LinkModules.cpp

Chris Lattner sabre at nondot.org
Tue Jul 5 23:35:36 PDT 2011


Author: lattner
Date: Wed Jul  6 01:35:36 2011
New Revision: 134475

URL: http://llvm.org/viewvc/llvm-project?rev=134475&view=rev
Log:
fix a forgotten type remapping.  We can now handle this part of testlink[12].ll correctly:

a.ll:
%intlist = type { %intlist*, i32 }
@MyIntList = global %intlist { %intlist* null, i32 17 }

b.ll:

%intlist = type { %intlist*, i32 }
@MyIntList = global %intlist { %intlist* null, i32 17 }
@MyIntListPtr = constant { %intlist* } { %intlist* @MyIntList }


Modified:
    llvm/branches/type-system-rewrite/lib/Linker/LinkModules.cpp

Modified: llvm/branches/type-system-rewrite/lib/Linker/LinkModules.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/type-system-rewrite/lib/Linker/LinkModules.cpp?rev=134475&r1=134474&r2=134475&view=diff
==============================================================================
--- llvm/branches/type-system-rewrite/lib/Linker/LinkModules.cpp (original)
+++ llvm/branches/type-system-rewrite/lib/Linker/LinkModules.cpp Wed Jul  6 01:35:36 2011
@@ -258,7 +258,7 @@
                                         cast<FunctionType>(Ty)->isVarArg());
     case Type::StructTyID:
       // Note that this is only reached for anonymous structs.
-      return *Entry = StructType::get(Ty->getContext(),  ElementTypes,
+      return *Entry = StructType::get(Ty->getContext(), ElementTypes,
                                       cast<StructType>(Ty)->isPacked());
     }
   }
@@ -672,7 +672,7 @@
   DGV->setLinkage(NewLinkage);
 
   // Make sure to remember this mapping.
-  ValueMap[SGV] = ConstantExpr::getBitCast(DGV, SGV->getType());
+  ValueMap[SGV] = ConstantExpr::getBitCast(DGV, TypeMap.get(SGV->getType()));
   
   // Destroy the source global's initializer (and convert it to a prototype) so
   // that we don't attempt to copy it over when processing global initializers.





More information about the llvm-branch-commits mailing list