[PATCH] D103429: [OpaquePtr] Create API to make a copy of a PointerType with some address space

Arthur Eubanks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 1 15:32:20 PDT 2021


aeubanks added inline comments.


================
Comment at: llvm/include/llvm/IR/DerivedTypes.h:667
+  /// transition.
+  static PointerType *getWithSamePointeeType(PointerType *PT,
+                                             unsigned AddressSpace) {
----------------
dblaikie wrote:
> Maybe the "with same pointee type" isn't the high priority aspect of this API? More "get with different address space" and it's assumed the rest of the type remains the same? (opaque to opaque, typed to typed)
> 
> Maybe "getWithAddressSpace" or something like that?
There are already a couple `PointerType::get()` methods which construct a pointer type. This one is different in that it's sorta cloning an existing PointerType. I want to make that super clear via the name somehow. This could be changed to a non-static method to be clearer? IMO Something like `getWithAddressSpace()` is too similar to the existing methods.

And this should be removed after the opaque pointer transition is over.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D103429



More information about the llvm-commits mailing list