mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[AST] Accept SynthesizedFileUnit in populateMemberCache
The differentiation and actor logics insert SynthesizedFileUnit in SourceFile modules. Accepting these file units in populateMemberCache allow to cache all the top-level decls of source file modules.
This commit is contained in:
@@ -276,8 +276,11 @@ void SourceLookupCache::populateMemberCache(const ModuleDecl &Mod) {
|
||||
"populate-module-class-member-cache");
|
||||
|
||||
for (const FileUnit *file : Mod.getFiles()) {
|
||||
auto &SF = *cast<SourceFile>(file);
|
||||
addToMemberCache(SF.getTopLevelDecls());
|
||||
assert(isa<SourceFile>(file) ||
|
||||
isa<SynthesizedFileUnit>(file));
|
||||
SmallVector<Decl *, 8> decls;
|
||||
file->getTopLevelDecls(decls);
|
||||
addToMemberCache(decls);
|
||||
}
|
||||
|
||||
MemberCachePopulated = true;
|
||||
|
||||
Reference in New Issue
Block a user