Skip to content

Commit 93ab50a

Browse files
committed
[APInt] Replace enum with static constexpr member variables. NFC
With C++17 we no longer need the enum to prevent ODR use.
1 parent c4c9f39 commit 93ab50a

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

llvm/include/llvm/ADT/APInt.h

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,11 @@ class [[nodiscard]] APInt {
7979
public:
8080
typedef uint64_t WordType;
8181

82-
/// This enum is used to hold the constants we needed for APInt.
83-
enum : unsigned {
84-
/// Byte size of a word.
85-
APINT_WORD_SIZE = sizeof(WordType),
86-
/// Bits in a word.
87-
APINT_BITS_PER_WORD = APINT_WORD_SIZE * CHAR_BIT
88-
};
82+
/// Byte size of a word.
83+
static constexpr unsigned APINT_WORD_SIZE = sizeof(WordType);
84+
85+
/// Bits in a word.
86+
static constexpr unsigned APINT_BITS_PER_WORD = APINT_WORD_SIZE * CHAR_BIT;
8987

9088
enum class Rounding {
9189
DOWN,

0 commit comments

Comments
 (0)