@@ -1369,7 +1369,38 @@ bool namelookup::finishLookup(const DeclContext *dc, NLOptions options,
1369
1369
removeShadowedDecls (decls, M);
1370
1370
1371
1371
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
+ }
1372
1385
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
+ }
1373
1404
// We're done. Report success/failure.
1374
1405
return !decls.empty ();
1375
1406
}
@@ -1575,7 +1606,7 @@ bool DeclContext::lookupQualified(ArrayRef<NominalTypeDecl *> typeDecls,
1575
1606
}
1576
1607
}
1577
1608
1578
- return finishLookup (this , options, decls);
1609
+ return finishLookupInNominals (this , typeDecls, member , options, decls);
1579
1610
}
1580
1611
1581
1612
bool DeclContext::lookupQualified (ModuleDecl *module, DeclName member,
@@ -1627,7 +1658,7 @@ bool DeclContext::lookupQualified(ModuleDecl *module, DeclName member,
1627
1658
return !knownDecls.insert (vd).second ;
1628
1659
}), decls.end ());
1629
1660
1630
- return finishLookup (this , options, decls);
1661
+ return finishLookupInModule (this , module, member , options, decls);
1631
1662
}
1632
1663
1633
1664
bool DeclContext::lookupAnyObject (DeclName member, NLOptions options,
@@ -1682,7 +1713,7 @@ bool DeclContext::lookupAnyObject(DeclName member, NLOptions options,
1682
1713
decls.push_back (decl);
1683
1714
}
1684
1715
1685
- return finishLookup (this , options, decls);
1716
+ return finishLookupInAnyObject (this , member , options, decls);
1686
1717
}
1687
1718
1688
1719
void DeclContext::lookupAllObjCMethods (
0 commit comments