Skip to content

Commit d5eca6c

Browse files
authored
Merge pull request #62781 from kateinoigakukun/pr-1c50f837dff8c45e643bd7cc67d17b9ad80e3f43
stdlib: repair 32bit non-Darwin build for TypeLayout
2 parents 0620226 + 76981b4 commit d5eca6c

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

stdlib/toolchain/CompatibilityBytecodeLayouts/BytecodeLayouts.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff 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+
7886
void 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

392400
static BitVector pointerSpareBitMask() {
393401
BitVector bv;
394-
bv.add(heap_object_abi::SwiftSpareBitsMask);
402+
bv.addPointer(heap_object_abi::SwiftSpareBitsMask);
395403
return bv;
396404
}
397405

stdlib/toolchain/CompatibilityBytecodeLayouts/BytecodeLayouts.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)