swift
1b08740b - [ownership] Replace ValueOwnershipKind::Trivial with ValueOwnershipKind::Any.

Commit
6 years ago
[ownership] Replace ValueOwnershipKind::Trivial with ValueOwnershipKind::Any. In a previous commit, I banned in the verifier any SILValue from producing ValueOwnershipKind::Any in preparation for this. This change arises out of discussions in between John, Andy, and I around ValueOwnershipKind::Trivial. The specific realization was that this ownership kind was an unnecessary conflation of the a type system idea (triviality) with an ownership idea (@any, an ownership kind that is compatible with any other ownership kind at value merge points and can only create). This caused the ownership model to have to contort to handle the non-payloaded or trivial cases of non-trivial enums. This is unnecessary if we just eliminate the any case and in the verifier separately verify that trivial => @any (notice that we do not verify that @any => trivial). NOTE: This is technically an NFC intended change since I am just replacing Trivial with Any. That is why if you look at the tests you will see that I actually did not need to update anything except removing some @trivial ownership since @any ownership is represented without writing @any in the parsed sil. rdar://46294760
Author
Committer
Parents
Loading