Commit Graph

64 Commits

Author SHA1 Message Date
Doug Gregor
a2d97719d3 [Runtime] Support nested generic types in mangled name -> type metadata. 2018-01-12 15:35:12 -08:00
Doug Gregor
0b62e4000f [Mangled name -> type] Support simple generic types up to 3 arguments.
Support demangling bound generic types (e.g., Array<Int>) and forming
type metadata for them. For now, only support non-nested generic types
with up to three generic parameters.
2018-01-12 15:35:12 -08:00
Doug Gregor
3405852ef0 [Runtime] Find metadata for substitutions into demangled dependent members.
Extend the protocol descriptor with a (space-separated) list of associated
type names, in the order of their requirements. Use this information in
the runtime to support lookup of associated type witnesses by name when
mapping a mangled name to a type and substituting generic parameters.
2018-01-11 16:04:53 -08:00
Doug Gregor
cd1bd20fce [Runtime mangling -> meadata] Support type parameter substitutions.
Extend _typeByMangledName with support for user-provided type parameter
substitutions, where type parameters that occur in the mangling can be
replaced with specific types.
2018-01-11 11:08:57 -08:00
Doug Gregor
2c86f918de [Runtime] Add tests for demanling never-before-seen types to metadata.
This helps ensure that we're uniquing metadata properly when given
non-constant inputs, for existential types and function types.
2018-01-10 23:12:09 -08:00
Doug Gregor
a08653496f [Runtime demangling] Add test for AnyObject composition case 2018-01-09 22:20:03 -08:00
Doug Gregor
a7fef62a44 [Runtime] Search through protocols to resolve protocol declarations.
Search through the new section containing Swift protocol descriptor
references to resolve protocols by mangled name. Use this
functionality to support protocol composition types within
_typeForMangledName.
2018-01-09 20:17:44 -08:00
Doug Gregor
c9b7ec935f [Runtime] Round up tuple labels allocation size to alignment of a pointer.
The metadata allocation functions assume this alignment, and we
weren't guaranteeing it.
2018-01-08 13:12:25 -08:00
Doug Gregor
909e882110 [Runtime] Support "ModuleName.ClassName" syntax for mangled type lookup. 2018-01-06 23:56:51 -08:00
Doug Gregor
78e8ad87be [Runtime] Find (simple) nominal types based on a mangled name. 2018-01-06 23:30:31 -08:00
Doug Gregor
04a151d8a0 [Runtime] Form existential types and existential types based on mangled names.
Introduce basic support for existential types (just Any and AnyObject), so
we can test those, shared/owned parameters, and existential metatypes.
2018-01-05 16:56:56 -08:00
Doug Gregor
33f89a1344 [Runtime] Form metatypes based on mangled names. 2018-01-05 16:34:55 -08:00
Doug Gregor
83fd37a2d0 [Runtime] Form function types based on mangled names.
Fixes some issues in the type decoder with function flags not getting
set when forming function types.
2018-01-05 16:23:49 -08:00
Doug Gregor
7148e84099 [Runtime] Stub out the implementation of _typeByMangledName().
Introduce a standard library/runtime entry point that produces type metadata
given a mangled name, based on the TypeDecoder logic lifted from the remote
mirrors library.

Implement support for tuple types as a proof-of-concept.
2018-01-05 15:42:45 -08:00