@@ -1369,7 +1369,38 @@ bool namelookup::finishLookup(const DeclContext *dc, NLOptions options,
13691369 removeShadowedDecls (decls, M);
13701370
13711371 filterForDiscriminator (decls, M->getDebugClient ());
1372+ }
1373+
1374+ static bool finishLookupInNominals (const DeclContext *dc,
1375+ ArrayRef<NominalTypeDecl *> types,
1376+ DeclName member, NLOptions options,
1377+ SmallVectorImpl<ValueDecl *> &decls) {
1378+ finishLookup (dc, options, decls);
1379+ if (auto *debugClient = dc->getParentModule ()->getDebugClient ()) {
1380+ debugClient->finishLookupInNominals (dc, types, member, options, decls);
1381+ }
1382+ // We're done. Report success/failure.
1383+ return !decls.empty ();
1384+ }
13721385
1386+ static bool finishLookupInModule (const DeclContext *dc, ModuleDecl *module ,
1387+ DeclName member, NLOptions options,
1388+ SmallVectorImpl<ValueDecl *> &decls) {
1389+ finishLookup (dc, options, decls);
1390+ if (auto *debugClient = dc->getParentModule ()->getDebugClient ()) {
1391+ debugClient->finishLookupInModule (dc, module , member, options, decls);
1392+ }
1393+ // We're done. Report success/failure.
1394+ return !decls.empty ();
1395+ }
1396+
1397+ static bool finishLookupInAnyObject (const DeclContext *dc, DeclName member,
1398+ NLOptions options,
1399+ SmallVectorImpl<ValueDecl *> &decls) {
1400+ finishLookup (dc, options, decls);
1401+ if (auto *debugClient = dc->getParentModule ()->getDebugClient ()) {
1402+ debugClient->finishLookupInAnyObject (dc, member, options, decls);
1403+ }
13731404 // We're done. Report success/failure.
13741405 return !decls.empty ();
13751406}
@@ -1575,7 +1606,7 @@ bool DeclContext::lookupQualified(ArrayRef<NominalTypeDecl *> typeDecls,
15751606 }
15761607 }
15771608
1578- return finishLookup (this , options, decls);
1609+ return finishLookupInNominals (this , typeDecls, member , options, decls);
15791610}
15801611
15811612bool DeclContext::lookupQualified (ModuleDecl *module , DeclName member,
@@ -1627,7 +1658,7 @@ bool DeclContext::lookupQualified(ModuleDecl *module, DeclName member,
16271658 return !knownDecls.insert (vd).second ;
16281659 }), decls.end ());
16291660
1630- return finishLookup (this , options, decls);
1661+ return finishLookupInModule (this , module , member , options, decls);
16311662}
16321663
16331664bool DeclContext::lookupAnyObject (DeclName member, NLOptions options,
@@ -1682,7 +1713,7 @@ bool DeclContext::lookupAnyObject(DeclName member, NLOptions options,
16821713 decls.push_back (decl);
16831714 }
16841715
1685- return finishLookup (this , options, decls);
1716+ return finishLookupInAnyObject (this , member , options, decls);
16861717}
16871718
16881719void DeclContext::lookupAllObjCMethods (
0 commit comments