Skip to content

Conversation

kazutakahirata
Copy link
Contributor

This patch modernizes BitWord and BITWORD_SIZE with "using" and
"static constexpr", respectively.

This patch modernizes BitWord and BITWORD_SIZE with "using" and
"static constexpr", respectively.
@llvmbot
Copy link
Member

llvmbot commented Oct 8, 2025

@llvm/pr-subscribers-llvm-adt

Author: Kazu Hirata (kazutakahirata)

Changes

This patch modernizes BitWord and BITWORD_SIZE with "using" and
"static constexpr", respectively.


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

1 Files Affected:

  • (modified) llvm/include/llvm/ADT/Bitset.h (+2-2)
diff --git a/llvm/include/llvm/ADT/Bitset.h b/llvm/include/llvm/ADT/Bitset.h
index ecb6b149f0494..d9f750ff55185 100644
--- a/llvm/include/llvm/ADT/Bitset.h
+++ b/llvm/include/llvm/ADT/Bitset.h
@@ -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;
 
   static_assert(BITWORD_SIZE == 64 || BITWORD_SIZE == 32,
                 "Unsupported word size");

@kazutakahirata kazutakahirata merged commit b7921f8 into llvm:main Oct 8, 2025
9 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_20251007_ADT_Bitset branch October 8, 2025 15:21
svkeerthy pushed a commit that referenced this pull request Oct 9, 2025
This patch modernizes BitWord and BITWORD_SIZE with "using" and
"static constexpr", respectively.
clingfei pushed a commit to clingfei/llvm-project that referenced this pull request Oct 10, 2025
This patch modernizes BitWord and BITWORD_SIZE with "using" and
"static constexpr", respectively.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants