Skip to content

[6.0] IRGen: Set a "not bitwise borrowable" bit in value witnesses for @_rawLayout types. #76704

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
merged 1 commit into from
Sep 25, 2024

Conversation

jckarter
Copy link
Contributor

Explanation: For types like Atomic and Mutex, we want to know that even though they are technically bitwise-takable, they differ from other bitwise-takable types until this point because they are not also "bitwise-borrowable"; while borrowed, they are pinned in memory, so they cannot be passed by value as a borrowed parameter, unlike copyable bitwise-takable types. Add a bit to the value witness table flags to record this.
Scope: Backward-compatible ABI change for types like Atomic and Mutex.
Issue: rdar://136396806
Original PR: #76688
Risk: Low. Introduces a new value witness flags bit that is ignored by current and previously-released Swift runtimes.
Testing: Swift CI
Reviewer: @atrick

…awLayout` types.

For types like `Atomic` and `Mutex`, we want to know that even though they are
technically bitwise-takable, they differ from other bitwise-takable types until
this point because they are not also "bitwise-borrowable"; while borrowed,
they are pinned in memory, so they cannot be passed by value as a borrowed
parameter, unlike copyable bitwise-takable types. Add a bit to the value witness
table flags to record this.

Note that this patch does not include any accompanying runtime support for
propagating the flag into runtime-instantiated type metadata. There isn't yet
any runtime functionality that varies based on this flag, so that can
be implemented separately.

rdar://136396806
@jckarter jckarter requested a review from a team as a code owner September 25, 2024 18:16
@jckarter
Copy link
Contributor Author

@swift-ci Please test

@jckarter jckarter merged commit 7c8cd13 into swiftlang:release/6.0 Sep 25, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants