From 19fd833caf1f95f704d51eec5e2d64ddd74ae818 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Mon, 15 Sep 2025 00:01:03 -0700 Subject: [PATCH] [ADT] Use std::conditional_t to simplify ilist_select_iterator_type (NFC) Without this patch, ilist_select_iterator_type uses a boolean template parameter to select one of two types. This patch converts that to std::conditional_t, which is simpler than the two-class solution. --- llvm/include/llvm/ADT/ilist_node.h | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/llvm/include/llvm/ADT/ilist_node.h b/llvm/include/llvm/ADT/ilist_node.h index 67384546a9275..8d78d5dbbda44 100644 --- a/llvm/include/llvm/ADT/ilist_node.h +++ b/llvm/include/llvm/ADT/ilist_node.h @@ -52,14 +52,10 @@ template class ilist_sentinel; // Selector for which iterator type to pick given the iterator-bits node option. template -class ilist_select_iterator_type { -public: - using type = ilist_iterator; -}; -template -class ilist_select_iterator_type { -public: - using type = ilist_iterator_w_bits; +struct ilist_select_iterator_type { + using type = std::conditional_t, + ilist_iterator>; }; /// Implementation for an ilist node.