[opaque pointer type] API migration for GEP constant factories
[oota-llvm.git] / lib / Transforms / Scalar / SCCP.cpp
index 875a0078741b15fefce6734dc2fc3448d6130605..bc068f78c5765300e688684ad4e3554cb8a1ab0e 100644 (file)
@@ -1012,7 +1012,8 @@ void SCCPSolver::visitGetElementPtrInst(GetElementPtrInst &I) {
 
   Constant *Ptr = Operands[0];
   auto Indices = makeArrayRef(Operands.begin() + 1, Operands.end());
-  markConstant(&I, ConstantExpr::getGetElementPtr(Ptr, Indices));
+  markConstant(&I, ConstantExpr::getGetElementPtr(I.getSourceElementType(), Ptr,
+                                                  Indices));
 }
 
 void SCCPSolver::visitStoreInst(StoreInst &SI) {