Commit Graph

160 Commits

Author SHA1 Message Date
Michael Gottesman
5f226ffc59 [silgen] Perform borrow + tuple_extract + copy for SILGenPoly.
Another case of needing a destructure operation.

rdar://29791263
2017-02-08 16:20:02 -08:00
Michael Gottesman
d153f36e48 [silgen] Handle forwarding of direct tuple args using a borrow + extract + copy triple
Once we have a destructure operation this will not be necessary.

rdar://29791263
2017-02-08 16:00:23 -08:00
swift-ci
bfa3cece06 Merge pull request #7310 from gottesmm/alloc_tail_fix 2017-02-07 15:34:56 -08:00
Michael Gottesman
03b8375d83 [silgen] When emitting BuiltinAllocWithTailElems, be sure to create a cleanup.
This is actually a NFC change since we forward the cleanup in most cases and the
forwarding behavior is tested already by SILGen. But what this /does/ do is
prevent us from creating a ManagedValue that is "owned" but does not have a
cleanup.

rdar://29791263
2017-02-07 12:25:58 -08:00
Slava Pestov
3519e0cd25 AST: Introduce new SubstitutionList type to replace ArrayRef<Substitution>
SubstitutionList is going to be a more compact representation of
a SubstitutionMap, suitable for inline allocation inside another
object.

For now, it's just a typedef for ArrayRef<Substitution>.
2017-02-06 21:36:33 -08:00
Michael Gottesman
9bcbe8c299 [silgen] Add a new API called SILGenBuilder::createOwnedPHIArgument.
This new API creates a new PHI argument in the current insertion block of the
SILBuilder with @owned ownership, creates a new ManagedValue with cleanup and
returns that ManagedValue. This eliminates one case where often times in SILGen
people use SILBuilder APIs on SILGenBuilder and then manage their own ownership
instead of gliding lightly on top of pure ManagedValue APIs.

rdar://29791263
2017-02-04 13:40:26 -08:00
Michael Gottesman
77c1dfcb3a [semantic-sil] Use borrow semantics when emitting a struct_extract sequence.
rdar://29791263
2017-01-26 16:46:42 -08:00
practicalswift
7e48c04277 [gardening] Fix inconsistent headers. 2017-01-21 10:59:10 +01:00
Michael Gottesman
0331400f60 [silgen] Store the relevant SILGenFunction instead of the SILGenModule in SILGenBuilder
We already always associate a SILGenBuilder with one function, just like
SILBuilder, so there really is no reason not to store the SILGenFunction. The
reason why I want to do so here though is that I want access to the ManagedValue
APIs on SILGenFunction so I can begin to add Ownership endowed entry points on
SILBuilder that traffic only in ManagedValue instead of SILValue.

rdar://29791263
2017-01-19 13:40:55 -08:00
Michael Gottesman
1dbabed576 [silgen] Extract SILGenBuilder into its own header/cpp file.
NFC.
2017-01-18 16:46:14 -08:00