Commit Graph

4 Commits

Author SHA1 Message Date
Meghana Gupta
79acb5ac47 Fix ownership of move-only enums in SIL 2024-06-29 22:58:45 -07:00
Meghana Gupta
a15d5fea09 Fix ownership of move-only structs in SIL
Not doing this for enums yet because it is tripping the ownership verifier

We dont have move-only tuples yet.
2024-03-13 16:24:57 -07:00
Michael Gottesman
c026e95cce [ownership] Extract out SILOwnershipKind from ValueOwnershipKind into its own type and rename Invalid -> Any.
This makes it easier to understand conceptually why a ValueOwnershipKind with
Any ownership is invalid and also allowed me to explicitly document the lattice
that relates ownership constraints/value ownership kinds.
2020-11-10 14:29:11 -08:00
Michael Gottesman
fed6145922 [sil] Change all single value instructions with forwarding ownership to have static ownership.
Previously we would always calculate these instructions ownership dynamically
when asked and rely on the ownership verifier to catch if we made any
mistakes. Instead with this commit we move to a more static model where the
ownership that these instructions can take are frozen on construction. This is a
more static model that simplifies the ownership model.

I also eliminated a few asserts that are enforced in other places that caused
problems when parsing since we may not have a Function while Parsing (it was
generally asserts if a type was trivial).
2018-11-11 15:23:36 -08:00