Skip to content

Commit 84bfaf5

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 772cff1 commit 84bfaf5

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
@@ -1033,7 +1033,7 @@ class Operand {
10331033
public:
10341034
enum { numCustomBits = 8 };
10351035

1036-
constexpr static const size_t maxBitfieldID =
1036+
constexpr static const uint64_t maxBitfieldID =
10371037
std::numeric_limits<uint64_t>::max() >> numCustomBits;
10381038

10391039
private:

0 commit comments

Comments
 (0)