an external constant. Since external constants don't have initializers, we
were failing on an assert() call in llvm/GlobalVariable.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7193
91177308-0d34-0410-b5e6-
96231b3b80d8
if (CE->getOpcode() == Instruction::GetElementPtr)
if (ConstantPointerRef *G=dyn_cast<ConstantPointerRef>(CE->getOperand(0)))
if (GlobalVariable *GV = dyn_cast<GlobalVariable>(G->getValue()))
- if (GV->isConstant())
+ if ((GV->isConstant()) && (!(GV->isExternal())))
if (Constant *V = GetGEPGlobalInitializer(GV->getInitializer(), CE))
return ReplaceInstUsesWith(LI, V);
return 0;