-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[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
[ownership] Ban ValueOwnershipKind::Any in preparation for eliminated ValueOwnershipKind::Trivial #20819
Conversation
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
…anging Trivial to be Any. rdar://46294760
@swift-ci test |
@swift-ci source compatibility |
@swift-ci Test Source Compatibility |
@swift-ci Please Test Source Compatibility |
@swift-ci smoke benchmark |
(not expecting benchmark changes, just want to run the benchmarks) |
"and start debriding" What is debriding? |
Build comment file:No performance and code size changes |
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... |
Talked with Andy. He is going to do post-commit review on this. |
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.
LGTM
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:
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.
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