Skip to content

[addr-move-function] Wire up closure operands to the caller global data flow. #40776

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 11 commits into from
Jan 9, 2022

Conversation

gottesmm
Copy link
Contributor

@gottesmm gottesmm commented Jan 9, 2022

In #40775, I forgot to wire up closure operands to the caller global data flow. I do that in one of the attached commits, fix a few bugs, and more tests for partial apply, casts, and defers.

These operands are not actually consumed. They are instead vars that are
represented as inout_aliasable closure arguments (or defer arguments) that we
convert to @out parameters after performing move checking.
We can always derive isUpwardsUse, isUpwardsConsume from the result downward
scan result within the struct.
…flow and not in the middle of the closure capture analysis.

Just makes jumping around the file less consuing since the topic is consistent
within the closure captured variable analysis.
…lti-block callers.

I just forgot to include this in the previous PR. I added some more tests around
it.
@gottesmm
Copy link
Contributor Author

gottesmm commented Jan 9, 2022

@swift-ci test

…tain destroy_addr to insert compensating destroy_addr.

This doesn't work well if one can potentially not have any input destroy_addr...
I actually already know the address without inferring it, so I changed the code
to just use that.

I also added more tests around defer/without defer that exercise this behavior.
…error on these.

To improve the diagnostics though I think I am going to have to add a closure
operand analysis to copyable values like I did for copyable addresses...
@gottesmm
Copy link
Contributor Author

gottesmm commented Jan 9, 2022

@swift-ci test

@swift-ci
Copy link
Contributor

swift-ci commented Jan 9, 2022

Build failed
Swift Test Linux Platform
Git Sha - cfdfff3

@gottesmm
Copy link
Contributor Author

gottesmm commented Jan 9, 2022

Linux failure is I think unrelated to my PR. Its in the driver.

@gottesmm
Copy link
Contributor Author

gottesmm commented Jan 9, 2022

@swift-ci test linux platform

@gottesmm gottesmm merged commit f69c988 into swiftlang:main Jan 9, 2022
@gottesmm gottesmm deleted the move-function-defer-2 branch January 9, 2022 09:11
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