[opaque pointer type] API migration for GEP constant factories
[oota-llvm.git] / lib / CodeGen / GlobalMerge.cpp
index 32543b7723abe3b862f9e15a1f917ce6b5937987..41953839010212db41df364822df84585cc7cbf2 100644 (file)
@@ -222,7 +222,8 @@ bool GlobalMerge::doMerge(SmallVectorImpl<GlobalVariable*> &Globals,
         ConstantInt::get(Int32Ty, 0),
         ConstantInt::get(Int32Ty, k-i)
       };
-      Constant *GEP = ConstantExpr::getInBoundsGetElementPtr(MergedGV, Idx);
+      Constant *GEP =
+          ConstantExpr::getInBoundsGetElementPtr(MergedTy, MergedGV, Idx);
       Globals[k]->replaceAllUsesWith(GEP);
       Globals[k]->eraseFromParent();