Skip to content

Commit 4b1ffa5

Browse files
committed
[NameLookup] Ensure extensions are updated after module load
Call prepareExtensions to make sure we load in any new extensions brought in by modules loaded after-the-fact. This isn't an issue for normal compilations as we load all the modules up-front in import resolution, but clients such as the LLDB REPL may load in modules later. Resolves rdar://64040436.
1 parent 4d705ab commit 4b1ffa5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/AST/NameLookup.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1331,6 +1331,12 @@ DirectLookupRequest::evaluate(Evaluator &evaluator,
13311331

13321332
decl->prepareLookupTable();
13331333

1334+
// If we're allowed to load extensions, call prepareExtensions to ensure we
1335+
// properly invalidate the lazily-complete cache for any extensions brought in
1336+
// by modules loaded after-the-fact. This can happen with the LLDB REPL.
1337+
if (!disableAdditionalExtensionLoading)
1338+
decl->prepareExtensions();
1339+
13341340
auto &Table = *decl->LookupTable;
13351341
if (!useNamedLazyMemberLoading) {
13361342
// Make sure we have the complete list of members (in this nominal and in

0 commit comments

Comments
 (0)