forked from OSchip/llvm-project
If weak GlobalVariable was bitcast'ed to different type during linking
we will need to strip all casts for intializer lookup. llvm-svn: 50776
This commit is contained in:
parent
82c02b28f3
commit
09cfb1cf2d
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue