Serialize local types

Local type declarations are saved in the source file during parsing,
now serialized as decls. Some of these may be defined in DeclContexts
which aren't Decls and previously weren't serialized. Create four new
record kinds:

* PatternBindingInitializer
* DefaultArgumentInitializer
* AbstractClosureExpr
* TopLevelCodeDecl

These new records are used to only preserve enough information for
remangling in the debugger, and parental context relationships.

Finally, provide a lookup API in the module to search by mangled name.
With the new remangling API, the debugging lifecycle for local types
should be complete.

The extra LOCAL_CONTEXT record will compressed back down in a
subsequent patch.

Swift SVN r24739
This commit is contained in:
David Farler
2015-01-27 01:49:54 +00:00
parent 8e1dfcbdfb
commit 51f8070abe
33 changed files with 1594 additions and 275 deletions

View File

@@ -173,6 +173,8 @@ public:
DeclName name, NLKind lookupKind,
SmallVectorImpl<ValueDecl*> &results) const override;
virtual TypeDecl *lookupLocalType(StringRef MangledName) const override;
virtual OperatorDecl *lookupOperator(Identifier name,
DeclKind fixity) const override;
@@ -191,6 +193,9 @@ public:
virtual void getTopLevelDecls(SmallVectorImpl<Decl*> &results) const override;
virtual void
getLocalTypeDecls(SmallVectorImpl<TypeDecl*> &results) const override;
virtual void getDisplayDecls(SmallVectorImpl<Decl*> &results) const override;
virtual void