-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[move-only] Address Only Patches #65604
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
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Specifically, I changed emitRValueForDecl and SILGenProlog to do the right thing. I also added some tests. Some notes: 1. We currently consider using a copyable field of a move only address type to be a consume of that type. I am going to fix that in the next commit to make it easier to understand. 2. I am going to need to write more tests/flesh out the behavior more. I am sure there is more here. rdar://105106470
…ess only type as consuming the address only type. rdar://105106470
…only type used by escaping closures. When we have a loadable type, SILGen always eagerly loads the value, so the move checker handled checking those cases by just looking for loads and emitting the error based off of a load. Of course for address only types, the codegen looks slightly different (we consume the value directly rather than load it). So this change just teaches the checker how to do that. rdar://105106470
This just creates a new SILUndef with the same type as the SILValue. This just prevents one from having to write SILUndef::get(value->getType(), *value->getModule()).
It was actually testing that we properly handle something related to debug info. With subsequent changes, this causes a crash since it doesn't match the expected output.
…nd fields of an address only move only type correctly.
42f0531
to
e4cdc66
Compare
@swift-ci test |
… form. For some reason in a previous commit, this started to work so I just added support. In this PR, it changed again and the test started to fail again. We are not shipping noimplicitcopy in 5.9, so I just changed the error message to the old "I don't understand" error message. I additionally looked at why the failure is occuring. The reason why is that the frontend emits an unchecked_ref_cast since currently the moveonlywrapper_to_copyable instruction does not accept addresses (even though it could) and the field sensitive liveness analysis does not know how to represent an unchecked_ref_cast (which is ok, since we would like it to be rejected).
@swift-ci smoke test |
jckarter
approved these changes
May 3, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
NOTE: In the following when I refer to an address only move only type, I am not referring to a generic type that is move only, instead I am referring to a concrete move only type that is generic over a copyable type T and contains that copyable type T as a field.
This PR contains a few changes needed for address only move only types.
Specifically:
rdar://105106470