llvm-project
2d216a94 - [ADT] Simplify CastInfo<To, PointerUnion<PTs...>> (NFC) (#156274)

Commit
7 days ago
[ADT] Simplify CastInfo<To, PointerUnion<PTs...>> (NFC) (#156274) This patch simplifies CastInfo<To, PointerUnion<PTs...>> by "inlining" CastInfoPointerUnionImpl into the CastInfo specialization. Here is a brief background: https://reviews.llvm.org/D125609 added support for CastInfo<To, PointerUnion<PTs...>> along with helper struct CastInfoPointerUnionImpl. During the review, we did discuss the idea of implementing the CastInfo specialization without the helper struct, but the suggested solution did not work. This patch attempts to simplify the CastInfo specialization again by making CastInfo a friend of PointerUnion: template <typename To, typename From, typename Enable> friend struct CastInfo; This gives CastInfo more access to PointerUnion than strictly necessary, but the ability to simplify the CastInfo specialization outweighs the risk.
Parents
Loading