Commit Graph

10 Commits

Author SHA1 Message Date
Erik Eckstein
ec64f2a255 SILLocation: replace CleanupLocation::get(loc) with CleanupLocation(loc)
No need to have a static get function - the constructor can be used directly.
NFC
2021-01-29 20:28:21 +01:00
Michael Gottesman
f84f48eb5a [silgen] Make SwitchCaseFullExpr use an ArgumentScope instead of just a Scope.
Otherwise, if we move in a formal access cleanup value into switch emission
using a cleanup cloner, we will improperly have a formal access cleanup that
will be invalidated by a normal Scope which violates SILGen invariants. Also in
a certain sense the bindings performed by SILGenPattern that do this type of
forwarding are arguments in a certain sense so it seems reasonable to do this.

<rdar://problem/70736924>
2020-11-12 23:31:13 -08:00
John McCall
3162b513a9 Strengthen some assertions with cleanup scopes; NFC. 2018-10-25 21:50:00 -07:00
Michael Gottesman
adcf43b98c [silgen] Add the ability to push an RValue through an ArgumentScope.
This comes down to popping the formal evaluation scope and then performing a
popPreservingValue through the resulting normal Scope.

As a cleanup, I changed ArgumentScope.popPreservingValue(ManagedValue) to just
Scope::popPreservingValue instead of reimplementing said functionality.

rdar://31521023
2017-09-04 10:01:03 -07:00
Michael Gottesman
184a6b5eb4 [silgen] Add a verify method to ArgumentScope.
This method just calls verify on FormalArgumentScope.

rdar://31521023
2017-09-04 10:01:03 -07:00
practicalswift
b704f1448b [gardening] Improve header consistency 2017-04-12 15:13:11 +02:00
Michael Gottesman
f9e3b1d6d9 Reapply "[silgen] If we have a direct guaranteed convention and have an owned value, perform a borrow.""
This partially reverts commit 41f425a503.

The key thing is that now it is behind the semantic sil flag. I have an
additional patch that turns this back on in front of the flag, but it requires a
little bit of mandatory pass work that Erik is going to hit this week.

rdar://31145255
2017-03-26 12:56:42 -07:00
Michael Gottesman
41f425a503 Revert "[silgen] If we have a direct guaranteed convention and have an owned value, perform a borrow."
This reverts commit 4c8595b002.
2017-03-20 05:00:31 -07:00
Michael Gottesman
4c8595b002 [silgen] If we have a direct guaranteed convention and have an owned value, perform a borrow.
Now that all arguments are properly scoped, we do not need to worry about this
extending the lifetimes of COW times inappropriately.

rdar://30955427
2017-03-18 18:59:31 -07:00
Michael Gottesman
b99c47c006 [silgen] Scope argument cleanups with a new scope called "ArgumentScope".
Once this is in, I will be able to finish the SILGenApply part of Semantic SIL.

rdar://30955427
2017-03-18 17:03:41 -07:00