File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
stdlib/toolchain/CompatibilityBytecodeLayouts Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -75,6 +75,14 @@ size_t BitVector::count() const {
75
75
return total;
76
76
}
77
77
78
+ void BitVector::addPointer (uintptr_t byte) {
79
+ #if __POINTER_WIDTH__ == 64
80
+ add ((uint64_t )byte);
81
+ #else
82
+ add ((uint32_t )byte);
83
+ #endif
84
+ }
85
+
78
86
void BitVector::add (uint64_t byte) {
79
87
for (size_t i = 0 ; i < 64 ; i++)
80
88
data.push_back (byte >> (63 - i) & 0x1 );
@@ -391,7 +399,7 @@ BitVector MultiPayloadEnum::spareBits() const {
391
399
392
400
static BitVector pointerSpareBitMask () {
393
401
BitVector bv;
394
- bv.add (heap_object_abi::SwiftSpareBitsMask);
402
+ bv.addPointer (heap_object_abi::SwiftSpareBitsMask);
395
403
return bv;
396
404
}
397
405
Original file line number Diff line number Diff line change @@ -159,6 +159,9 @@ struct BitVector {
159
159
// / Append on a 64bit value
160
160
void add (uint64_t values);
161
161
162
+ // / Append on a pointer-size value
163
+ void addPointer (uintptr_t values);
164
+
162
165
// / Append on a vector of bytes
163
166
void add (std::vector<uint8_t > values);
164
167
You can’t perform that action at this time.
0 commit comments