Skip to content

Commit d17aeeb

Browse files
kazutakahirataDharuniRAcharya
authored andcommitted
[ADT] Use TypeAtIndex in PointerUnion (NFC) (llvm#163036)
This patch replaces GetFirstType with TypeAtIndex.
1 parent 8b20a0f commit d17aeeb

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

llvm/include/llvm/ADT/PointerUnion.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,6 @@ namespace pointer_union_detail {
3838
return std::min<int>({PointerLikeTypeTraits<Ts>::NumLowBitsAvailable...});
3939
}
4040

41-
/// Find the first type in a list of types.
42-
template <typename T, typename...> struct GetFirstType {
43-
using type = T;
44-
};
45-
4641
/// Provide PointerLikeTypeTraits for void* that is used by PointerUnion
4742
/// for the template arguments.
4843
template <typename ...PTs> class PointerUnionUIntTraits {
@@ -264,8 +259,7 @@ struct PointerLikeTypeTraits<PointerUnion<PTs...>> {
264259
// Teach DenseMap how to use PointerUnions as keys.
265260
template <typename ...PTs> struct DenseMapInfo<PointerUnion<PTs...>> {
266261
using Union = PointerUnion<PTs...>;
267-
using FirstInfo =
268-
DenseMapInfo<typename pointer_union_detail::GetFirstType<PTs...>::type>;
262+
using FirstInfo = DenseMapInfo<TypeAtIndex<0, PTs...>>;
269263

270264
static inline Union getEmptyKey() { return Union(FirstInfo::getEmptyKey()); }
271265

0 commit comments

Comments
 (0)