Serialize decls with _specialize(exported:true, target: somefunc(_:), ...) in a list for fast lookup

rdar://71430641
This commit is contained in:
Arnold Schwaighofer
2020-12-11 07:36:45 -08:00
parent f4e74f7907
commit 2b6ba2830c
13 changed files with 98 additions and 40 deletions

View File

@@ -866,6 +866,20 @@ void ModuleFile::getTopLevelDecls(
}
}
void ModuleFile::getExportedPrespecializations(
SmallVectorImpl<Decl *> &results) {
for (DeclID entry : Core->ExportedPrespecializationDecls) {
Expected<Decl *> declOrError = getDeclChecked(entry);
if (!declOrError) {
if (!getContext().LangOpts.EnableDeserializationRecovery)
fatal(declOrError.takeError());
consumeError(declOrError.takeError());
continue;
}
results.push_back(declOrError.get());
}
}
void ModuleFile::getOperatorDecls(SmallVectorImpl<OperatorDecl *> &results) {
PrettyStackTraceModuleFile stackEntry(*this);
if (!Core->OperatorDecls)