Commit Graph

54 Commits

Author SHA1 Message Date
Slava Pestov
d2a5fbd94a Implement reflection on instances of empty and single-payload enums
This change attempts to introduce the functionality without being too
disruptive. After we branch, I want to consolidate some of the runtime
functions and implement this functionality for multi-payload enums
as well, which requires adding new runtime metadata.

Example:

(swift) enum Color { case Red, Green, Blue(Int) }
(swift) print(Color.Red)
REPL.Color.Red
(swift) print(Color.Blue(5))
REPL.Color.Blue(5)

Implements <rdar://problem/18334936>.

Swift SVN r28430
2015-05-11 18:21:39 +00:00
Joe Groff
889b8d3826 IRGen: Fix implementation of emitValueCaseTest for multi-payload enums.
Empty cases are packed into the payload under a minimal number of tags, instead of having once case per tag, as for payload cases.

Swift SVN r27813
2015-04-27 19:37:18 +00:00
Joe Groff
4afbe78d59 Runtime: Entry points for dynamic multi-payload enums.
Swift SVN r27791
2015-04-27 00:35:10 +00:00
Dmitri Hrybenko
350248dae5 Reorganize the directory structure under 'stdlib'
The standard library has grown significantly, and we need a new
directory structure that clearly reflects the role of the APIs, and
allows future growth.

See stdlib/{public,internal,private}/README.txt for more information.

Swift SVN r25876
2015-03-09 05:26:05 +00:00