Skip to content

Commit 4923aab

Browse files
committed
AST: Add hoisted declarations to unqualified name lookup cache
1 parent fae8f94 commit 4923aab

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/AST/Module.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,7 @@ SourceLookupCache::SourceLookupCache(const SourceFile &SF) {
312312
FrontendStatsTracer tracer(SF.getASTContext().Stats,
313313
"source-file-populate-cache");
314314
addToUnqualifiedLookupCache(SF.getTopLevelDecls(), false);
315+
addToUnqualifiedLookupCache(SF.getHoistedDecls(), false);
315316
}
316317

317318
SourceLookupCache::SourceLookupCache(const ModuleDecl &M) {
@@ -322,8 +323,9 @@ SourceLookupCache::SourceLookupCache(const ModuleDecl &M) {
322323
addToUnqualifiedLookupCache(SFU->getTopLevelDecls(), false);
323324
continue;
324325
}
325-
auto &SF = *cast<SourceFile>(file);
326-
addToUnqualifiedLookupCache(SF.getTopLevelDecls(), false);
326+
auto *SF = cast<SourceFile>(file);
327+
addToUnqualifiedLookupCache(SF->getTopLevelDecls(), false);
328+
addToUnqualifiedLookupCache(SF->getHoistedDecls(), false);
327329
}
328330
}
329331

0 commit comments

Comments
 (0)