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