Skip to content

@_addressableForDependencies fixes #78457

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 3 commits into from
Jan 8, 2025

Conversation

jckarter
Copy link
Contributor

@jckarter jckarter commented Jan 7, 2025

  • Only lower nominal types marked with @_addressableForDependencies as such.
  • Change codegen for loading from no-implicit-copy lvalues to avoid spurious consumption errors.

…es` as such.

I accidentally typoed the RecursiveProperties constructor so that every type
was getting treated as addressable-for-dependencies. Oops.
Previously, we would emit this as

  %1 = load [copy] %address
  %2 = moveonly_wrapper_to_copyable [owned] %1

which is difficult for move-only checking to handle, since %2 looks like a
consume of %1, making it difficult to determine %1's true lifetime. Change
this to

  %1 = moveonly_wrapper_to_copyable_addr %address
  %2 = load [copy] %address

which is handled better by move-only checking, improving the accuracy of
existing move-checking as well as fixing a spurious diagnostic when
indirect parameters get passed as by-value arguments to other functions.
@jckarter
Copy link
Contributor Author

jckarter commented Jan 7, 2025

@swift-ci Please test

@jckarter
Copy link
Contributor Author

jckarter commented Jan 7, 2025

@swift-ci Please clean test Linux

@jckarter
Copy link
Contributor Author

jckarter commented Jan 7, 2025

@swift-ci Please smoke test Linux

1 similar comment
@jckarter
Copy link
Contributor Author

jckarter commented Jan 7, 2025

@swift-ci Please smoke test Linux

With the other fixes, it is now possible to build the stdlib without conditionalizing these
behaviors. This will allow libraries to adopt addressability as an experimental feature
without breaking ABI when interacting with other code.
@jckarter
Copy link
Contributor Author

jckarter commented Jan 7, 2025

@swift-ci Please test

@jckarter
Copy link
Contributor Author

jckarter commented Jan 8, 2025

@swift-ci Please smoke test Linux

@jckarter jckarter merged commit bc405c5 into swiftlang:main Jan 8, 2025
4 of 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.

1 participant