[PATCH] D117870: [OpaquePtrs] Add getNonOpaquePointerElementType() method

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 21 18:17:24 PST 2022


dblaikie added a comment.

I /very/ vaguely remember having picked one of "getPointerElementType" and "getElementType" as a sort of intentional transformation like this (though adding a new explicit name's a further step along that direction) back when I started the opaque pointer work to help me classify things I'd cleaned up and things I hadn't... (I think I put an assert(false) in the one I hadn't cleaned up to help me find places I still needed to clean up) but I think it's too far back in my brain.

Happy with whatever you/other folks feels good here.



================
Comment at: llvm/include/llvm/IR/Type.h:375-378
+  /// Only use this method in code that is not reachable with opaque pointers,
+  /// or part of deprecated methods that will be removed as part of the opaque
+  /// pointers transition.
+  Type *getNonOpaquePointerElementType() const {
----------------
dexonsmith wrote:
> Given where this should be used, should all uses be required to be documented with a FIXME/TODO/SOMETHING to indicate which of the two cases it is?
> 
> I don't feel strongly (up to you), but it might make it easier to audit them.
Yeah, or possibly have two different function names to self-document those two cases.


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

https://reviews.llvm.org/D117870



More information about the llvm-commits mailing list