Skip to content

stdlib: repair 32bit non-Darwin build for TypeLayout #62781

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,14 @@ size_t BitVector::count() const {
return total;
}

void BitVector::addPointer(uintptr_t byte) {
#if __POINTER_WIDTH__ == 64
add((uint64_t)byte);
#else
add((uint32_t)byte);
#endif
}

void BitVector::add(uint64_t byte) {
for (size_t i = 0; i < 64; i++)
data.push_back(byte >> (63 - i) & 0x1);
Expand Down Expand Up @@ -391,7 +399,7 @@ BitVector MultiPayloadEnum::spareBits() const {

static BitVector pointerSpareBitMask() {
BitVector bv;
bv.add(heap_object_abi::SwiftSpareBitsMask);
bv.addPointer(heap_object_abi::SwiftSpareBitsMask);
return bv;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@ struct BitVector {
/// Append on a 64bit value
void add(uint64_t values);

/// Append on a pointer-size value
void addPointer(uintptr_t values);

/// Append on a vector of bytes
void add(std::vector<uint8_t> values);

Expand Down