Skip to content

[ownership] Ban ValueOwnershipKind::Any in preparation for eliminated ValueOwnershipKind::Trivial #20819

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

Conversation

gottesmm
Copy link
Contributor

This PR eliminates our usage of ValueOwnershipKind::Any's old undef like semantics and temporarily bans ValueOwnershipKind::Any when ownership verification is enabled. This involves:

  1. Changing SILUndef to produce owned ownership if it has a non-trivial type and trivial ownership if it has a trivial type. This involved storing in SILUndef said ValueOwnershipKind since we do not have access to a SILModule when computing the ValueOwnershipKind of a SILValue.

  2. Adding an assert that bans ValueOwnershipKind::Any for /all/ values.

After this commit, I should be able to just do a sed-ish replace of all references to ValueOwnershipKind::Trivial to ValueOwnershipKind::Any and start debriding.

rdar://46294760

…the one that takes the SILModule * the helper method instead of vis-a-versa.

We already assume in the given static method that the module is a non-null
pointer. So rather than us indirecting a ref to a pointer and then dereferencing
the pointer, we instead use the ref in the module implementation and dereference
the pointer.

rdar://46294760
…s and owned for non-trivial values.

This is in preparation for verifying that when ownership verification is enabled
that only enums and trivial values can have any ownership. I am doing this in
preparation for eliminating ValueOwnershipKind::Trivial.

rdar://46294760
@gottesmm gottesmm requested a review from atrick November 28, 2018 01:34
@gottesmm
Copy link
Contributor Author

@swift-ci test

@gottesmm
Copy link
Contributor Author

@swift-ci source compatibility

@gottesmm
Copy link
Contributor Author

@swift-ci Test Source Compatibility

@gottesmm
Copy link
Contributor Author

@swift-ci Please Test Source Compatibility

@gottesmm
Copy link
Contributor Author

@swift-ci smoke benchmark

@gottesmm
Copy link
Contributor Author

(not expecting benchmark changes, just want to run the benchmarks)

@slavapestov
Copy link
Contributor

"and start debriding"

What is debriding?

@gottesmm
Copy link
Contributor Author

@slavapestov https://bit.ly/2BBYpKF

@swift-ci
Copy link
Contributor

Build comment file:

No performance and code size changes


@xwu
Copy link
Collaborator

xwu commented Nov 28, 2018

"and start debriding"

What is debriding?

Debridement is the removal of dead or damaged tissue to improve healing of the remaining healthy tissue. (The most intriguing form of debridement, of course, is maggot therapy.)

While in general I'd be in favor of LMGTFY, searching about debridement comes with certain hazards...

@gottesmm gottesmm requested a review from eeckstein November 28, 2018 21:53
@gottesmm
Copy link
Contributor Author

Talked with Andy. He is going to do post-commit review on this.

@gottesmm gottesmm merged commit c65c540 into swiftlang:master Nov 28, 2018
@gottesmm gottesmm deleted the pr-f46c6ad2fee1ea70f7b25a8f6a89ab7af28c1404 branch November 28, 2018 21:55
Copy link
Contributor

@atrick atrick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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.

5 participants