Some existing places use getPointerElementType() to create a copy of a
pointer type with some new address space.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/include/llvm/IR/DerivedTypes.h | ||
---|---|---|
667 | 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? |
llvm/include/llvm/IR/DerivedTypes.h | ||
---|---|---|
667 | 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. |
llvm/include/llvm/IR/DerivedTypes.h | ||
---|---|---|
667 | Yeah, happy for this to go away after the opaque pointer transition - when nothing significant from the old pointer type would be used to make the new pointer type anyway (since the only interesting property of the opaque pointer is its address space). I don't too much mind it being a non-static member - it is different in that it's derived from the current pointer type so it can readily be a non-static member function. |
Eh, either way - see what you mean about the existing name. And since it'll be relatively short-lived (maybe modify the comment to say "delete this after the opaque pointer transition" rather than the more passive "this is only useful ... " ?) the current name you've got seems OK.
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?