[PATCH] D57173: [opaque pointer types] Pass value type to GetElementPtr creation.

James Y Knight via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 27 21:03:17 PST 2019


jyknight added inline comments.


================
Comment at: llvm/include/llvm/IR/Constants.h:1153
   /// \param OnlyIfReducedTy see \a getWithOperands() docs.
+  static Constant *getGetElementPtr(std::nullptr_t, Constant *C,
+                                    ArrayRef<Constant *> IdxList,
----------------
dblaikie wrote:
> What overload sets are these nullptr+delete versions meant to account for?
This change was not intended to be in this patch (and is now removed).

But it'll be back in a future patch, so I'll explain anyhow. Unlike the other instructions (Load, Call, Invoke), the GEP creation APIs mostly already have a mandatory Type argument -- but unfortunately allow it to be nullptr, in which case it defaults to the pointee type. These overloads (which are copies of all the GEP-creation APIs, with Type* -> nullptr) are to help catch and fix those callers.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57173/new/

https://reviews.llvm.org/D57173





More information about the llvm-commits mailing list