mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user