Skip to content

Runtime: Set 'is not bitwise borrowable' bit for raw layout types. #76734

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 30, 2024

Conversation

jckarter
Copy link
Contributor

When initializing metadata for layout-dependent raw layout types, set the "is not bitwise borrowable" bit.

@jckarter
Copy link
Contributor Author

@swift-ci Please test

///
/// No raw layout types are yet, but should we change our mind about that in the future,
/// this flag is here.
BitwiseBorrowable = 0x4,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't all raw layout types not be bitwise borrowable? Can't we just unconditionally set this to false in the init function?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought that having a flag to allow a raw layout type to be bitwise-borrowable in the future would be good future proofing, should we have a reason to do so later.

@@ -0,0 +1,41 @@
// RUN: %target-run-simple-swift(-enable-experimental-feature RawLayout)
// REQUIRES: executable_test
// UNSUPPORTED: use_os_stdlib
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'll also want // UNSUPPORTED: back_deployment_runtime for the full effect.

@@ -2221,7 +2221,7 @@ struct TargetExtendedExistentialTypeShape
bool hasGeneralizationSignature() const {
return Flags.hasGeneralizationSignature();
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bit of whitespace spam.

When initializing metadata for layout-dependent raw layout types, set the
"is not bitwise borrowable" bit.
@jckarter jckarter force-pushed the atomic-layout-runtime branch from 11a6f06 to 6e565b5 Compare September 27, 2024 18:27
@jckarter
Copy link
Contributor Author

@swift-ci Please test

@jckarter
Copy link
Contributor Author

@swift-ci Please test Linux

@jckarter jckarter merged commit 4b3931c into swiftlang:main Sep 30, 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.

3 participants