From c2525020ac47d33b8e07e9ef6e3d88139d9e5005 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Thu, 9 Oct 2025 00:23:03 -0700 Subject: [PATCH] [ADT] Use TypeAtIndex in PointerUnion (NFC) This patch replaces GetFirstType with TypeAtIndex. --- llvm/include/llvm/ADT/PointerUnion.h | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/llvm/include/llvm/ADT/PointerUnion.h b/llvm/include/llvm/ADT/PointerUnion.h index 7b66177373011..d9087dd1c516e 100644 --- a/llvm/include/llvm/ADT/PointerUnion.h +++ b/llvm/include/llvm/ADT/PointerUnion.h @@ -38,11 +38,6 @@ namespace pointer_union_detail { return std::min({PointerLikeTypeTraits::NumLowBitsAvailable...}); } - /// Find the first type in a list of types. - template struct GetFirstType { - using type = T; - }; - /// Provide PointerLikeTypeTraits for void* that is used by PointerUnion /// for the template arguments. template class PointerUnionUIntTraits { @@ -264,8 +259,7 @@ struct PointerLikeTypeTraits> { // Teach DenseMap how to use PointerUnions as keys. template struct DenseMapInfo> { using Union = PointerUnion; - using FirstInfo = - DenseMapInfo::type>; + using FirstInfo = DenseMapInfo>; static inline Union getEmptyKey() { return Union(FirstInfo::getEmptyKey()); }