[llvm] [ADT] Modernize Bitset (NFC) (PR #162430)

Jakub Kuderski via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 8 05:11:37 PDT 2025


================
@@ -28,9 +28,9 @@ namespace llvm {
 /// initialization.
 template <unsigned NumBits>
 class Bitset {
-  typedef uintptr_t BitWord;
+  using BitWord = uintptr_t;
 
-  enum { BITWORD_SIZE = (unsigned)sizeof(BitWord) * CHAR_BIT };
+  static constexpr unsigned BITWORD_SIZE = sizeof(BitWord) * CHAR_BIT;
----------------
kuhar wrote:

While at it, can we add the unit to this define? It's not immediately obvious if it's bits or bytes unless you go to the definition. Maybe `BitwordBits` or `BitwordSizeInBits`?

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


More information about the llvm-commits mailing list