[llvm] [ADT] Replace Min with variadic std::min (PR #157390)

Jakub Kuderski via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 8 06:35:40 PDT 2025


================
@@ -226,19 +227,13 @@ struct PointerSumTypeHelper : MemberTs... {
   };
 
   // Next we need to compute the number of bits available for the discriminant
-  // by taking the min of the bits available for each member. Much of this
-  // would be amazingly easier with good constexpr support.
-  template <uintptr_t V, uintptr_t... Vs>
-  struct Min : std::integral_constant<
-                   uintptr_t, (V < Min<Vs...>::value ? V : Min<Vs...>::value)> {
-  };
-  template <uintptr_t V>
-  struct Min<V> : std::integral_constant<uintptr_t, V> {};
-  enum { NumTagBits = Min<MemberTs::TraitsT::NumLowBitsAvailable...>::value };
+  // by taking the min of the bits available for each member.
+  static constexpr int NumTagBits =
----------------
kuhar wrote:

This used to be `uintptr_t` -- is `int` better?

https://github.com/llvm/llvm-project/pull/157390


More information about the llvm-commits mailing list