@@ -51,10 +51,21 @@ class ModuleNameLookup {
51
51
resolutionKind (resolutionKind),
52
52
respectAccessControl(!ctx.isAccessControlDisabled()) {}
53
53
54
- // / Performs a qualified lookup into the given module and, if necessary, its
55
- // / reexports.
54
+ // / Performs the qualified lookup requested by \p LookupStrategy into the
55
+ // / given module and, if necessary, its reexports.
56
56
// /
57
- // / The results are appended to \p decls.
57
+ // / If 'moduleOrFile' is a ModuleDecl, we search the module and it's
58
+ // / public imports. If 'moduleOrFile' is a SourceFile, we search the
59
+ // / file's parent module, the module's public imports, and the source
60
+ // / file's private imports.
61
+ // /
62
+ // / \param[out] decls Results are appended to this vector.
63
+ // / \param moduleOrFile The module or file unit to search, including imports.
64
+ // / \param accessPath The access path that was imported; if not empty, only
65
+ // / the named declaration will be imported.
66
+ // / \param moduleScopeContext The top-level context from which the lookup is
67
+ // / being performed, for checking access. This must be either a
68
+ // / FileUnit or a Module.
58
69
void lookupInModule (SmallVectorImpl<ValueDecl *> &decls,
59
70
const DeclContext *moduleOrFile,
60
71
ImportPath::Access accessPath,
@@ -77,6 +88,10 @@ class LookupByName : public ModuleNameLookup<LookupByName> {
77
88
const NLKind lookupKind;
78
89
79
90
public:
91
+ // / \param ctx The AST context that the lookup will be performed in.
92
+ // / \param name The name that will be looked up.
93
+ // / \param lookupKind Whether this lookup is qualified or unqualified.
94
+ // / \param resolutionKind What sort of decl is expected.
80
95
LookupByName (ASTContext &ctx, ResolutionKind resolutionKind,
81
96
DeclName name, NLKind lookupKind)
82
97
: Super(ctx, resolutionKind), name(name),
@@ -89,6 +104,10 @@ class LookupByName : public ModuleNameLookup<LookupByName> {
89
104
return true ;
90
105
}
91
106
107
+ // / \param module The module to search for declarations in.
108
+ // / \param path The access path that was imported; if not empty, only the
109
+ // / named declaration will be imported.
110
+ // / \param[out] localDecls Results are appended to this vector.
92
111
void doLocalLookup (ModuleDecl *module , ImportPath::Access path,
93
112
OptionSet<ModuleLookupFlags> flags,
94
113
SmallVectorImpl<ValueDecl *> &localDecls) {
0 commit comments