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

Anton Korobeynikov asl at math.spbu.ru
Tue May 6 15:52:54 PDT 2008


Author: asl
Date: Tue May  6 17:52:54 2008
New Revision: 50776

URL: http://llvm.org/viewvc/llvm-project?rev=50776&view=rev
Log:
If weak GlobalVariable was bitcast'ed to different type during linking
we will need to strip all casts for intializer lookup.

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=50776&r1=50775&r2=50776&view=diff

==============================================================================
--- llvm/trunk/lib/Linker/LinkModules.cpp (original)
+++ llvm/trunk/lib/Linker/LinkModules.cpp Tue May  6 17:52:54 2008
@@ -758,7 +758,7 @@
       Constant *SInit =
         cast<Constant>(RemapOperand(SGV->getInitializer(), ValueMap));
 
-      GlobalVariable *DGV = cast<GlobalVariable>(ValueMap[SGV]);
+      GlobalVariable *DGV = cast<GlobalVariable>(StripPointerCasts(ValueMap[SGV]));
       if (DGV->hasInitializer()) {
         if (SGV->hasExternalLinkage()) {
           if (DGV->getInitializer() != SInit)





More information about the llvm-commits mailing list