Commit Graph

5 Commits

Author SHA1 Message Date
Michael Gottesman
40a09c9c21 Fixup tests for -assume-parsing-unqualified-ownership-sil => [ossa] transition. 2018-12-18 00:49:32 -08:00
Michael Gottesman
9e13779702 [ownership] Remove most -enable-sil-ownership from SILGen now that %target-swift-emit-silgen does it automatically.
I did this using a sed pattern and verified by hand that I was only touching
target-swift-emit-silgen lines.
2018-12-13 11:54:54 -08:00
Michael Gottesman
0af0d5fddc [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
2018-12-04 23:01:43 -08:00
Slava Pestov
084b0e07ee SILGen: Strip __owned from parameter types when emitting SE-0110 tuple splat
Instead of using composeInput(), build a tuple type containing
the element types only, dropping ownership qualifiers and
asserting that there are no inout or vararg elements.

This is correct because we already promote +0 values to +1, or
clean up +1 values that are only used as +0 as needed.

Fixes <rdar://problem/44915136>.
2018-10-03 02:43:28 -04:00
Slava Pestov
62a94f6660 SILGen: Wean reabstraction thunk emission off getFunctionInputType()
Treat the top level of the parameter list specially, instead of
looking at FunctionType::getInput().

There are three cases where we don't translate parameters 1-1:

- Imploding the parameter list into a single value when reabstracting
  a function with the opaque abstraction pattern. This will go away
  once Swift 3 compatibility is fully removed.

- Exploding the parameter list from a single value. This is the dual of
  the above.

- Exploding the parameter list for an SE-0110 "tuple splat" conversion.
  This is the one case that will need to be supported on an on-going
  basis, but it is not too bad to handle directly.
2018-09-25 23:13:20 -07:00