mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Pass DynamicLookupInfo through VisibleDeclConsumers NFC
This commit adds a new type DynamicLookupInfo that provides information about how a dynamic member lookup found a particular Decl. This is needed to correctly handle KeyPath dynamic member lookups, but for now just plumb it through everywhere.
This commit is contained in:
@@ -1613,7 +1613,8 @@ void SwiftDeclCollector::lookupVisibleDecls(ArrayRef<ModuleDecl *> Modules) {
|
||||
continue;
|
||||
KnownDecls.insert(D);
|
||||
if (auto VD = dyn_cast<ValueDecl>(D))
|
||||
foundDecl(VD, DeclVisibilityKind::DynamicLookup);
|
||||
foundDecl(VD, DeclVisibilityKind::DynamicLookup,
|
||||
DynamicLookupInfo::AnyObject);
|
||||
else
|
||||
processDecl(D);
|
||||
}
|
||||
@@ -1676,7 +1677,8 @@ void SwiftDeclCollector::processValueDecl(ValueDecl *VD) {
|
||||
}
|
||||
}
|
||||
|
||||
void SwiftDeclCollector::foundDecl(ValueDecl *VD, DeclVisibilityKind Reason) {
|
||||
void SwiftDeclCollector::foundDecl(ValueDecl *VD, DeclVisibilityKind Reason,
|
||||
DynamicLookupInfo) {
|
||||
if (VD->getClangMacro()) {
|
||||
// Collect macros, we will sort them afterwards.
|
||||
ClangMacros.push_back(VD);
|
||||
|
||||
@@ -690,7 +690,8 @@ public:
|
||||
std::vector<SDKNode*> createParameterNodes(ParameterList *PL);
|
||||
SDKNode *constructTypeNode(Type T, TypeInitInfo Info = TypeInitInfo());
|
||||
void processValueDecl(ValueDecl *VD);
|
||||
void foundDecl(ValueDecl *VD, DeclVisibilityKind Reason) override;
|
||||
void foundDecl(ValueDecl *VD, DeclVisibilityKind Reason,
|
||||
DynamicLookupInfo dynamicLookupInfo = {}) override;
|
||||
void processDecl(Decl *D);
|
||||
public:
|
||||
void lookupVisibleDecls(ArrayRef<ModuleDecl *> Modules);
|
||||
|
||||
Reference in New Issue
Block a user