Commit Graph

19 Commits

Author SHA1 Message Date
Slava Pestov
85b94a4300 SILGen: Refactor emitMemberInitializers() to use Initialization
Instead of constructing an LValue and storing the result of the
stored property initializer to the lvalue, let's emit the call
of the stored property initializer directly into an initialization
pointing at the stored properties named by the pattern.
2020-10-11 12:48:30 -04:00
Arnold Schwaighofer
f6651d6d45 IRGen: Enable TypeLayout based value witness generation
rdar://51988441
2020-02-25 12:31:30 -08:00
zoecarver
ed3442adf3 Fix tests 2020-01-21 17:30:34 -08:00
zoecarver
e19f40a25c Use getMetadataLayout offset instead of manual gep 2020-01-14 14:57:40 -08:00
Michael Gottesman
fd4828e40a Eliminate -assume-parsing-unqualified-ownership-sil from tests.
I am doing this separately from the actual change to eliminate the option to
make it easier to review.
2018-12-19 12:54:13 -08:00
Erik Eckstein
39bb14b094 change mangling prefix from $S to $s
This is the final ABI mangling prefix

rdar://problem/38471478
2018-09-19 13:55:11 -07:00
Pavel Yaskevich
3c2d342ccd [IRGen] NFC: Fix tests to reflect struct field vector size changes 2018-04-03 18:50:56 -07:00
John McCall
976401157f Bind layout type metadata correctly in outlined helper functions.
Fixes a regression in the source compatibility suite which I had a
lot of trouble extracting into a separate test case.

Most of this patch is just moving the outlining code into a separate
file and organizing it into a helper class instead of copy/pasting
so much code.  The main functional change is implicit in the difference
between collecting formal metadata and collecting it for layout, which
then is exploited in bindMetadataParameters.

As a secondary change, stop collecting metadata for class-bounded
archetypes; we don't actually need it to do value operations.
2018-03-27 15:14:12 -04:00
Slava Pestov
c31620d302 IRGen: Mangle generic signature and type for outlined thunks 2018-03-26 19:39:26 -07:00
Slava Pestov
8d6b60f8f5 Mangling: Use WO namespace for outlined value operations to declutter W namespace 2018-03-26 19:39:25 -07:00
John McCall
31f2eec044 Change type metadata accessors to support incomplete metadata.
This includes global generic and non-generic global access
functions, protocol associated type access functions,
swift_getGenericMetadata, and generic type completion functions.

The main part of this change is that the functions now need to take
a MetadataRequest and return a MetadataResponse, which is capable
of expressing that the request can fail.  The state of the returned
metadata is reported as an second, independent return value; this
allows the caller to easily check the possibility of failure without
having to mask it out from the returned metadata pointer, as well
as allowing it to be easily ignored.

Also, change metadata access functions to use swiftcc to ensure that
this return value is indeed returned in two separate registers.

Also, change protocol associated conformance access functions to use
swiftcc.  This isn't really related, but for some reason it snuck in.
Since it's clearly the right thing to do, and since I really didn't
want to retroactively tease that back out from all the rest of the
test changes, I've left it in.

Also, change generic metadata access functions to either pass all
the generic arguments directly or pass them all indirectly.  I don't
know how we ended up with the hybrid approach.  I needed to change all
the code-generation and calls here anyway in order to pass the request
parameter, and I figured I might as well change the ABI to something
sensible.
2018-03-18 21:38:08 -04:00
Pavel Yaskevich
6d3c29881b [IRGen] Reorder generic struct metadata so that field offsets follow generic parameters
Right now, field offsets come before generic arguments in instances
of a struct's metadata. It would be more resilient to put the generic
arguments first, since they're always used by compiler-generated code,
and cannot change resiliently, unlike fields.

Resolves: rdar://problem/36560486
2018-01-28 23:57:24 -08:00
Arnold Schwaighofer
9ade875ac8 Use named pattern match in test test/IRGen/generic_structs.swift 2018-01-13 16:05:12 -08:00
Arnold Schwaighofer
4cd16ae489 IRGen: Empty fields do have an entry in the field offset vector
This is an error introduced as the result of a refactoring a while ago
and means that we will store dependently typed stored properties at the
wrong offset in a generic struct if it has stored properties of empty
types before said property.

rdar://36384871
2018-01-12 13:00:13 -08:00
Michael Gottesman
20dd563efb [semantic-arc] Update tests for qualified/unqualified ownership and SILGen emission of copy_value, destroy_value. 2016-10-29 20:11:09 -07:00
Manav Gabhawala
9d7ec8799a Fixes SR-78 Compiler Seg Fault 2015-12-07 22:29:08 -05:00
Nadav Rotem
66713ea929 Revert "Fixes [SR-78] swift compiler seg fault" 2015-12-07 12:54:02 -08:00
Manav Gabhawala
8017cd2164 Added empty newline at the end of test case 2015-12-07 13:52:52 -05:00
Manav Gabhawala
9eee1df2a8 Fixes [SR-78] swift compiler seg fault
Fixes a segmentation fault where the IRGen module would crash when a
generic (empty) struct was part of the source code because it tried to
call std::next on an end iterator.
2015-12-07 01:08:45 -05:00