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 {
7575 return total;
7676}
7777
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+
7886void BitVector::add (uint64_t byte) {
7987 for (size_t i = 0 ; i < 64 ; i++)
8088 data.push_back (byte >> (63 - i) & 0x1 );
@@ -391,7 +399,7 @@ BitVector MultiPayloadEnum::spareBits() const {
391399
392400static BitVector pointerSpareBitMask () {
393401 BitVector bv;
394- bv.add (heap_object_abi::SwiftSpareBitsMask);
402+ bv.addPointer (heap_object_abi::SwiftSpareBitsMask);
395403 return bv;
396404}
397405
Original file line number Diff line number Diff line change @@ -159,6 +159,9 @@ struct BitVector {
159159 // / Append on a 64bit value
160160 void add (uint64_t values);
161161
162+ // / Append on a pointer-size value
163+ void addPointer (uintptr_t values);
164+
162165 // / Append on a vector of bytes
163166 void add (std::vector<uint8_t > values);
164167
You can’t perform that action at this time.
0 commit comments