Commit Graph

56 Commits

Author SHA1 Message Date
John McCall
46d35ed288 Change the layout of class existentials to put the instance
pointer first.

This most important effect of this is that accesses to that
field don't need to be dynamically offsetted past an arbitrary
number of value witnesses, which is pretty nice for the
generic value witnesses.

Swift SVN r16243
2014-04-12 02:13:16 +00:00
Joe Groff
5d6a6f6d38 IRGen: Favor high bits when scavenging tag bits for enums.
This is easier to emit optimal code for on our target platforms, and is more likely to find a contiguous range of spare bits to place the tag in.

Swift SVN r12435
2014-01-16 23:57:04 +00:00
John McCall
a1b469ed2f ExplosionKind -> ResilienceExpansion. NFC.
Swift SVN r12364
2014-01-16 00:25:29 +00:00
Joe Groff
13d291e92c Fix up include order dependencies in IRGen's GenEnum.h.
Swift SVN r12304
2014-01-15 00:34:18 +00:00
Joe Groff
5b99962f1e IRGen: Expose APIs for asking about enum layout.
Export EnumImplStrategy from the GenEnum.h header, and add some accessors that LLDB or other interested parties can use to work out how an enum is laid out:

- getElementsWithPayload() and getElementsWithNoPayload(), to pick out the cases that were laid out as nonempty and empty (including those that are considered no-payload due to empty type optimization);

- getBitPatternForNoPayloadElement() to return the unique bit pattern representing a no-payload case; and

- getTagBitsForPayloads() to return the bitmask of the discriminator tag for payload cases.

Swift SVN r12269
2014-01-14 02:08:51 +00:00
Joe Groff
e109124186 Replace 'union' keyword with 'enum'.
This only touches the compiler and tests. Doc updates to follow.

Swift SVN r8478
2013-09-20 01:33:14 +00:00