AaronBallman wrote: Thank you for working on cleaning up these APIs! They are definitely a source of confusion in practice, so paying down this tech debt is great!
> The names for the first two are rather verbose; I’m open to suggestions as to > better names for these functions since that was the best that I managed to > come up with... Given the fact that there tend to be custom predicates anyway, what about an API where you pass in the kinds of pointers you're after: ``` enum PointerLikeKind { C = 1U << 0U, ObjC = 1U << 1U, Block = 1U << 2U, Member = 1U << 3U, Reference = 1U << 4U, ... }; bool isPointerLike(unsigned PLK) const; Type *getPointeeFromPointerLike(unsigned PLK); const Type *getPointeeFromPointerLike(unsigned PLK) const; ``` and then people can migrate to that (though we probably want to use the fancy enum class bitmask functionality rather than this style above, but we need to pick something that's not onerous to use at call sites). This would replace `isAnyPointerType()` and friends, so those APIs would go away. As for the array element API, that one is really odd because it does things like strip qualifiers and doesn't handle multidimensional arrays gracefully. There are 17 uses of it, so I wonder if it makes sense to remove that API entirely and just handle the array case explicitly. Would that be something you would be willing to explore to see if it leads to a cleaner end-state? https://github.com/llvm/llvm-project/pull/122938 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits