Skip to content

[ownership-value] When passing in a class to materializeForSet, use astore_borrow, rather than a store [init]. #7990

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

Conversation

gottesmm
Copy link
Contributor

@gottesmm gottesmm commented Mar 9, 2017

[ownership-value] When passing in a class to materializeForSet, use astore_borrow, rather than a store [init].

The reason why this needs to be done is that we represent class pointers as
guaranteed, but we need to pass them as inout, violating the guaranteed
assumption. The truth is, we should be passing them in guaranteed but due to the
large required AST changes needed, we do not today.

Since we model this as an inout today, SILGen rightfully tries to use a store
[init] which is consuming. This commit works around that issue by using a
store_guaranteed.

rdar://29791263

… store_borrow, rather than a store [init].

The reason why this needs to be done is that we represent class pointers as
guaranteed, but we need to pass them as inout, violating the guaranteed
assumption. The truth is, we should be passing them in guaranteed but due to the
large required AST changes needed, we do not today.

Since we model this as an inout today, SILGen rightfully tries to use a store
[init] which is consuming. This commit works around that issue by using a
store_guaranteed.

rdar://29791263
@gottesmm
Copy link
Contributor Author

gottesmm commented Mar 9, 2017

@swift-ci Please smoke test and merge

@swift-ci swift-ci merged commit 3b34264 into swiftlang:master Mar 9, 2017
@gottesmm gottesmm deleted the use_store_borrow_instead_store_init_for_class_vars_mutableForSet branch March 9, 2017 02:18
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