Commit Graph

10 Commits

Author SHA1 Message Date
Nate Chandler
9bb0187be1 [SILGen] Add begin_borrow [var_decl] lifetimes. 2023-11-28 07:26:09 -08:00
Michael Gottesman
37d60a08bb [move-only] Rename mark_must_check -> mark_unresolved_non_copyable_value.
I was originally hoping to reuse mark_must_check for multiple types of checkers.
In practice, this is not what happened... so giving it a name specifically to do
with non copyable types makes more sense and makes the code clearer.

Just a pure rename.
2023-08-30 22:29:30 -07:00
Michael Gottesman
59c8cff917 [borrowing] Add support for borrowing/consuming copyable types to be a noimplicitcopy type.
rdar://108383660
2023-06-06 18:12:29 -04:00
Michael Gottesman
07677c252b Revert "add and update tests for Copyable types not having ownership modifiers"
This reverts commit 87f190be20.
2023-06-06 12:37:49 -04:00
Kavon Farvardin
87f190be20 add and update tests for Copyable types not having ownership modifiers
part of resolving rdar://108538971
2023-05-03 13:47:06 -07:00
Nate Chandler
abba5ef857 [SILGen] Consuming a param implies it's eager-move
If a parameter is marked consuming and its type is Copyable, that
parameter has eager-move semantics.  Apply that attribute to the
SILFunctionArgument corresponding to the parameter.

rdar://108385761
2023-04-21 21:59:31 -07:00
Nate Chandler
cda365ca8d [stdlib] Collection types are eagerMove.
Types that have "value semantics" should not have lexical lifetimes.
Value types are not expected to have custom deinits. Are not expected to
expose unsafe interior pointers. And cannot have weak references because
they are structs. Therefore, deinitialization barriers are irrelevant.

rdar://107076869
2023-03-30 11:04:47 -07:00
Joe Groff
643efd0d43 SILGen: Don't DI the box for consuming parameters.
It's always immediately initialized, so there's no need. This also sidesteps
an issue with DI and escaped move-only boxes (rdar://106049211).
2023-03-03 12:02:52 -08:00
Joe Groff
17c803724f Implement consuming and borrowing declaration-level modifiers from SE-0377.
`borrowing func`/`consuming func` control the ownership convention of `self` for
methods.
2023-03-01 11:58:59 -08:00
Joe Groff
2a187f2606 SILGen: Support mutable consuming parameters.
Emit a box like we would for a local variable, and move the parameter value into the box, as
part of the prolog.
2023-02-28 09:16:45 -08:00