Skip to content

Commit d987c26

Browse files
[SIL] Explicitly use uint64_t for maxBitfieldID
The `maxBitfieldID` was defined as `size_t` and used to assert bitfield ID values. The `currentBitfieldID` of `SILFunction` is defined as `uint64_t`, so we should consistently use `uint64_t` for `maxBitfieldID` as well for 32-bit platforms.
1 parent c16855f commit d987c26

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

include/swift/SIL/SILBasicBlock.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ public SwiftObjectHeader {
154154

155155
enum { numCustomBits = std::numeric_limits<CustomBitsType>::digits };
156156

157-
constexpr static const size_t maxBitfieldID =
157+
constexpr static const uint64_t maxBitfieldID =
158158
std::numeric_limits<uint64_t>::max();
159159

160160
/// Gets the ID (= index in the function's block list) of the block.

include/swift/SIL/SILNode.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ class alignas(8) SILNode :
128128

129129
enum { numCustomBits = 20 };
130130

131-
constexpr static const size_t maxBitfieldID =
131+
constexpr static const uint64_t maxBitfieldID =
132132
std::numeric_limits<uint64_t>::max() >> numCustomBits;
133133

134134
protected:

include/swift/SIL/SILValue.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1022,7 +1022,7 @@ class Operand {
10221022
public:
10231023
enum { numCustomBits = 8 };
10241024

1025-
constexpr static const size_t maxBitfieldID =
1025+
constexpr static const uint64_t maxBitfieldID =
10261026
std::numeric_limits<uint64_t>::max() >> numCustomBits;
10271027

10281028
private:

0 commit comments

Comments
 (0)