mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[NamedLazyMemberLoading] Add loadNamedMembers method and stub implementations.
This commit is contained in:
@@ -218,12 +218,23 @@ class alignas(void*) LazyMemberLoader {
|
||||
public:
|
||||
virtual ~LazyMemberLoader() = default;
|
||||
|
||||
/// Populates the given vector with all member decls for \p D.
|
||||
/// Populates a given decl \p D with all of its members.
|
||||
///
|
||||
/// The implementation should add the members to D.
|
||||
virtual void
|
||||
loadAllMembers(Decl *D, uint64_t contextData) = 0;
|
||||
|
||||
/// Populates a vector with all members of \p D that have DeclName
|
||||
/// matching \p N.
|
||||
///
|
||||
/// Returns true if an error occurred \em or the set of returned
|
||||
/// \p Members is otherwise incomplete, due to implementation limitations
|
||||
/// (eg. the implementation is unable to do named lookup at all, or within
|
||||
/// the particular type of Decl that \p D is).
|
||||
virtual bool
|
||||
loadNamedMembers(const Decl *D, DeclName N, uint64_t contextData,
|
||||
TinyPtrVector<ValueDecl *> &Members) = 0;
|
||||
|
||||
/// Populates the given vector with all conformances for \p D.
|
||||
///
|
||||
/// The implementation should \em not call setConformances on \p D.
|
||||
|
||||
@@ -700,6 +700,11 @@ public:
|
||||
virtual void loadAllMembers(Decl *D,
|
||||
uint64_t contextData) override;
|
||||
|
||||
virtual bool
|
||||
loadNamedMembers(const Decl *D, DeclName N,
|
||||
uint64_t contextData,
|
||||
TinyPtrVector<ValueDecl *> &Members) override;
|
||||
|
||||
virtual void
|
||||
loadAllConformances(const Decl *D, uint64_t contextData,
|
||||
SmallVectorImpl<ProtocolConformance*> &Conforms) override;
|
||||
|
||||
@@ -7994,6 +7994,13 @@ ClangImporter::Implementation::loadAllMembers(Decl *D, uint64_t extra) {
|
||||
loadAllMembersIntoExtension(D, extra);
|
||||
}
|
||||
|
||||
bool ClangImporter::Implementation::loadNamedMembers(
|
||||
const Decl *D, DeclName N, uint64_t contextData,
|
||||
TinyPtrVector<ValueDecl *> &Members) {
|
||||
// Not presently supported.
|
||||
return true;
|
||||
}
|
||||
|
||||
void ClangImporter::Implementation::loadAllMembersIntoExtension(
|
||||
Decl *D, uint64_t extra) {
|
||||
// We have extension.
|
||||
|
||||
@@ -1122,6 +1122,10 @@ public:
|
||||
virtual void
|
||||
loadAllMembers(Decl *D, uint64_t unused) override;
|
||||
|
||||
virtual bool
|
||||
loadNamedMembers(const Decl *D, DeclName N, uint64_t contextData,
|
||||
TinyPtrVector<ValueDecl *> &Members) override;
|
||||
|
||||
private:
|
||||
void
|
||||
loadAllMembersOfObjcContainer(Decl *D,
|
||||
|
||||
@@ -4678,6 +4678,13 @@ void ModuleFile::loadAllMembers(Decl *container, uint64_t contextData) {
|
||||
}
|
||||
}
|
||||
|
||||
bool ModuleFile::loadNamedMembers(const Decl *D, DeclName N,
|
||||
uint64_t contextData,
|
||||
TinyPtrVector<ValueDecl *> &Members) {
|
||||
// Not presently supported.
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
ModuleFile::loadAllConformances(const Decl *D, uint64_t contextData,
|
||||
SmallVectorImpl<ProtocolConformance*> &conformances) {
|
||||
|
||||
Reference in New Issue
Block a user