Commit Graph

162 Commits

Author SHA1 Message Date
Slava Pestov
13a50c2d2d ASTDemangler: Add support for lowered metatypes 2019-01-29 19:15:17 -05:00
Doug Gregor
23886ba579 [Metadata reader] Form demangle trees for generic extension contexts.
Translate the metadata for the generic requirements of an extension context
into a demangle tree that is associated with the demangling of an extension.

Teach the ASTDemangler how to handle class layout constraints as well.

With this, RemoteAST can resolve types nested within most constrained
extensions.
2019-01-26 23:25:51 -08:00
Slava Pestov
b6951932b4 ASTDemangler: Implement type alias types
Debug info uses a special mangling where type aliases can be
represented without being desugared; attempt to reconstruct
the TypeAliasType in this case.
2019-01-25 21:59:48 -05:00
Slava Pestov
d80caceec3 ASTDemangler: Fix local type lookup 2019-01-25 21:45:17 -05:00
Slava Pestov
0f5233dad1 ASTDemangler: Implement extension lookup 2019-01-25 21:44:02 -05:00
Slava Pestov
55605ceab9 ASTDemangler: Implement DynamicSelfType 2019-01-25 21:44:02 -05:00
Slava Pestov
9516575d1c ASTDemangler: Simplify createBoundGenericType()
It's clever how it leverages the type checker to check generic arguments,
but calling checkGenericArguments() would have been simpler, and it doesn't
work for interface types anyway, so we would fail to demangle those.

Let's just cut this all out for now and build a BoundGenericType directly.
2019-01-25 21:44:02 -05:00
Slava Pestov
bbe6a56e22 ASTDemangler: Implement builtin types 2019-01-25 21:44:02 -05:00
Slava Pestov
2d21233378 ASTDemangler: Implement unresolved DependentMemberType
The debug mangling emits these when the type parameter only
conforms to one protocol having an associated type with this
name.
2019-01-25 21:44:02 -05:00
Slava Pestov
8df0d8ea63 ASTDemangler: Fix import-as-member types
When an enum is imported as an error, the imported type itself becomes
a nested type 'Code' of its wrapper type, so you get a type like
'MyError.Code'. However in the mangling grammar the type is a
child of a module and not another type.

This was tripping up TypeDecoder, which would check parent types for
validity and throw out the demangling since it looked invalid.

However since this case really is valid, just skip the whole parent
type mess when the type is imported and non-generic.
2019-01-25 21:44:02 -05:00
Slava Pestov
4fb5ccf40e AST: Rename RemoteASTTypeBuilder to ASTBuilder 2018-11-02 18:19:40 -04:00
Slava Pestov
9c50867370 Move RemoteAST's RemoteASTTypeBuilder to lib/AST/ASTDemangler.cpp 2018-11-02 18:19:40 -04:00