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

@@ -434,6 +434,10 @@ void SerializedASTFile::lookupValue(Module::AccessPathTy accessPath,
File.lookupValue(name, results);
}
TypeDecl *SerializedASTFile::lookupLocalType(llvm::StringRef MangledName) const{
return File.lookupLocalType(MangledName);
}
OperatorDecl *SerializedASTFile::lookupOperator(Identifier name,
DeclKind fixity) const {
return File.lookupOperator(name, fixity);
@@ -462,10 +466,16 @@ SerializedASTFile::getCommentForDecl(const Decl *D) const {
return File.getCommentForDecl(D);
}
void SerializedASTFile::getTopLevelDecls(SmallVectorImpl<Decl*> &results) const{
void
SerializedASTFile::getTopLevelDecls(SmallVectorImpl<Decl*> &results) const {
File.getTopLevelDecls(results);
}
void
SerializedASTFile::getLocalTypeDecls(SmallVectorImpl<TypeDecl*> &results) const{
File.getLocalTypeDecls(results);
}
void SerializedASTFile::getDisplayDecls(SmallVectorImpl<Decl*> &results) const {
File.getDisplayDecls(results);
}