-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[move-only] A group of batched changes #65353
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
[move-only] A group of batched changes #65353
Conversation
@swift-ci test |
In a forthcoming commit, the 2nd commit will come into play, I am just peeling the onion |
@swift-ci smoke test |
eb19ee7
to
0ac6fac
Compare
@swift-ci test |
@swift-ci test source compatibility |
0ac6fac
to
1f1f250
Compare
@swift-ci test |
@swift-ci test source compatibility |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only reviewed the commit "[move-only] Instead of using AccessUseVisitor to visit addresses"
Looks good. Just a few comments inline.
Ideally the starting address producers would be in sync with AccessUseDefChainVisitor<Impl, Result>::visit
. We're just missing a few of the unusual cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine overall. Just some API suggestions and questions.
…lization that makes it easy to look for errors around specialization.
1f1f250
to
02c0ebd
Compare
…TransitiveAddressVisitor. This makes it so that the move address checker is not dependent on starting the traversal at a base object. I also included verifier checks that the API can visit all address uses for: 1. project_box. 2. alloc_stack. 3. ref_element_addr. 4. ref_tail_addr. 5. global_addr_inst. this is because this visitor is now apart of the SIL API definition as being able to enumerate /all/ addresses derived from a specific chosen address value. This is a refactoring NFCI change. rdar://108510644
…d move only types were removed.
…py] instead of a load_borrow. The reason why I am doing this is that otherwise if one has a function that takes both a guaranteed and an owned parameter, we will break OSSA invariants since the load [take] will invalidate the load_borrow. So instead, we put in a load_borrow knowing that the move checker will convert it to a load_borrow assuming that the two pass exclusivity checking. NOTE: Because of some missing functionality in subsequent tests, I had to disable one test (moveonly_escaping_definite_initialization.swift) and also add some checks for copy of noncopyable object errors. They will go away in the next 2 commits. rdar://108510987
…opyable checking in the closure. The reason why I am doing this is that currently SILGen knows when emitting said closure that we are going to emit an error (that it does not have enough information to emit itself since it doesn't know the caller), so doesn't emit move checking markers. The result is that the move checker will not eliminate any copies in the closure and thus will emit a "copy of noncopyable type found" error and tell the user to file a bug. This just suppresses that. rdar://108511866
…ble type, always emit mark_must_check. The reason to do this is that: 1. Otherwise, we do not emit markers when someone attempts to consume the let. We need the no_consume_or_assign to be there. 2. We need to insert assign_but_not_consuming so that DI can properly check lets that are conditionally initialized and convert them to initable_but_not_consuming. I included a full definite_init SIL test that validates that we get the correct codegen after DI in this case and emit the appropriate error as well. rdar://108511534
…scaping closure behavior. NOTE: We consider consuming closures that are marked without escaping as non-escaping. We shouldn't do this, but for now I just included them so that their behavior is in some test and we at least don't crash.
I left in the __owned tests of course. rdar://108511703
…, do not suggest to the user to make a local copy. It doesn't make sense to give this note since one can't make a copy of a noncopyable type. rdar://108511627
These are the same semantically, just the mangling is slightly different. The benefit of doing this is that we are actually testing what we expect our users to do. rdar://108511703
That PR was for rdar://108385761
02c0ebd
to
9c8d224
Compare
@swift-ci test |
@swift-ci test source compatibility |
I discovered a small issue where I introduced an optnone by mistake. I am going to remove it in a follow on smoke test change. |
Actually I was wrong about the optnone. It was in my local branch that I am working with on top of this. |
I took a look at the compatibility failure. One was a UPASS that showed up on the actual bot. |
The other failure is distributed actors which is also failing on other PRs due to misconfiguration. I talked with Konrad and he agreed I can ignore it. |
may cause the user to think there is a bug in the compiler.