Sink private-file import support down to SerializedASTFile

Implementing it in LoadedFile is nice in theory, but causes a leak in
practice because that type is ASTContext-allocated and usually never
destroyed.

https://bugs.swift.org/browse/SR-11366
This commit is contained in:
Jordan Rose
2019-08-23 17:25:44 -07:00
parent e479e1398d
commit 764e2b8ce6
5 changed files with 15 additions and 22 deletions

View File

@@ -955,6 +955,11 @@ void SerializedASTFile::lookupValue(ModuleDecl::AccessPathTy accessPath,
File.lookupValue(name, results);
}
StringRef
SerializedASTFile::getFilenameForPrivateDecl(const ValueDecl *decl) const {
return File.FilenamesForPrivateValues.lookup(decl);
}
TypeDecl *SerializedASTFile::lookupLocalType(llvm::StringRef MangledName) const{
return File.lookupLocalType(MangledName);
}