diff options
| author | Anton Korobeynikov <asl@math.spbu.ru> | 2008-05-06 22:52:54 +0000 |
|---|---|---|
| committer | Anton Korobeynikov <asl@math.spbu.ru> | 2008-05-06 22:52:54 +0000 |
| commit | 09cfb1cf2d951f3dd860545c1d97c08630e80372 (patch) | |
| tree | fe5a6e12652b6aef1232bb5557b9dff18167c91b | |
| parent | 82c02b28f3a1a3adef1638e801999952a2e47f1b (diff) | |
| download | bcm5719-llvm-09cfb1cf2d951f3dd860545c1d97c08630e80372.tar.gz bcm5719-llvm-09cfb1cf2d951f3dd860545c1d97c08630e80372.zip | |
If weak GlobalVariable was bitcast'ed to different type during linking
we will need to strip all casts for intializer lookup.
llvm-svn: 50776
| -rw-r--r-- | llvm/lib/Linker/LinkModules.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Linker/LinkModules.cpp b/llvm/lib/Linker/LinkModules.cpp index a82b266bbdb..ddc9081d654 100644 --- a/llvm/lib/Linker/LinkModules.cpp +++ b/llvm/lib/Linker/LinkModules.cpp @@ -758,7 +758,7 @@ static bool LinkGlobalInits(Module *Dest, const Module *Src, 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) |

