IR: Fix a missed case when threading OnlyIfReduced through ConstantExpr
[oota-llvm.git] / include / llvm / IR / Constants.h
index 8591f06c72e5241064f309255ef877c337c336af..5625b3f5d8ec9e3c218c5c7171dd5a65622df22b 100644 (file)
@@ -1036,9 +1036,9 @@ public:
   static Constant *getGetElementPtr(Constant *C, ArrayRef<Constant *> IdxList,
                                     bool InBounds = false,
                                     Type *OnlyIfReducedTy = nullptr) {
-    return getGetElementPtr(C, makeArrayRef((Value * const *)IdxList.data(),
-                                            IdxList.size()),
-                            InBounds);
+    return getGetElementPtr(
+        C, makeArrayRef((Value * const *)IdxList.data(), IdxList.size()),
+        InBounds, OnlyIfReducedTy);
   }
   static Constant *getGetElementPtr(Constant *C, Constant *Idx,
                                     bool InBounds = false,
@@ -1046,7 +1046,7 @@ public:
     // This form of the function only exists to avoid ambiguous overload
     // warnings about whether to convert Idx to ArrayRef<Constant *> or
     // ArrayRef<Value *>.
-    return getGetElementPtr(C, cast<Value>(Idx), InBounds);
+    return getGetElementPtr(C, cast<Value>(Idx), InBounds, OnlyIfReducedTy);
   }
   static Constant *getGetElementPtr(Constant *C, ArrayRef<Value *> IdxList,
                                     bool InBounds = false,