================
@@ -2710,6 +2710,84 @@ Constant *ConstantExpr::getGetElementPtr(Type *Ty, 
Constant *C,
   return pImpl->ExprConstants.getOrCreate(ReqTy, Key);
 }
 
+Constant *ConstantExpr::getGetElementPtr(const DataLayout &DL, Type *Ty,
+                                         Constant *C, ArrayRef<Constant *> 
Idxs,
+                                         GEPNoWrapFlags NW,
+                                         std::optional<ConstantRange> InRange,
+                                         Type *OnlyIfReducedTy) {
+  // Handle already canonical GEP.
+  if (Ty->isIntegerTy(8) && Idxs[0]->getType() == 
DL.getIndexType(C->getType()))
+    return getPtrAdd(C, Idxs[0], NW, InRange, OnlyIfReducedTy);
+
+  // Some API's require an ArrayRef of Value * instead of Constant *.
----------------
antoniofrighetto wrote:

```suggestion
  // Some APIs require an ArrayRef of Value * instead of Constant *.
```

https://github.com/llvm/llvm-project/pull/224652
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to