diff --git a/include/swift/SIL/SILBasicBlock.h b/include/swift/SIL/SILBasicBlock.h index d582b76509dee..22438ec3fac27 100644 --- a/include/swift/SIL/SILBasicBlock.h +++ b/include/swift/SIL/SILBasicBlock.h @@ -153,7 +153,9 @@ public SwiftObjectHeader { ~SILBasicBlock(); enum { numCustomBits = std::numeric_limits::digits }; - enum { maxBitfieldID = std::numeric_limits::max() }; + + constexpr static const size_t maxBitfieldID = + std::numeric_limits::max(); /// Gets the ID (= index in the function's block list) of the block. /// diff --git a/include/swift/SIL/SILNode.h b/include/swift/SIL/SILNode.h index ebfa18af953cd..cd62e83723858 100644 --- a/include/swift/SIL/SILNode.h +++ b/include/swift/SIL/SILNode.h @@ -127,7 +127,9 @@ class alignas(8) SILNode : enum { NumMarkDependenceKindBits = 2 }; enum { numCustomBits = 20 }; - enum { maxBitfieldID = std::numeric_limits::max() >> numCustomBits }; + + constexpr static const size_t maxBitfieldID = + std::numeric_limits::max() >> numCustomBits; protected: friend class SILInstruction; diff --git a/include/swift/SIL/SILValue.h b/include/swift/SIL/SILValue.h index 3d04109af7b44..1e6e118164500 100644 --- a/include/swift/SIL/SILValue.h +++ b/include/swift/SIL/SILValue.h @@ -1021,7 +1021,9 @@ ValueOwnershipKind::getForwardingOperandOwnership(bool allowUnowned) const { class Operand { public: enum { numCustomBits = 8 }; - enum { maxBitfieldID = std::numeric_limits::max() >> numCustomBits }; + + constexpr static const size_t maxBitfieldID = + std::numeric_limits::max() >> numCustomBits; private: template friend class SILBitfield;