@@ -46,10 +46,21 @@ class ModuleNameLookup {
46
46
resolutionKind (resolutionKind),
47
47
respectAccessControl(!ctx.isAccessControlDisabled()) {}
48
48
49
- // / Performs a qualified lookup into the given module and, if necessary, its
50
- // / reexports.
49
+ // / Performs the qualified lookup requested by \p LookupStrategy into the
50
+ // / given module and, if necessary, its reexports.
51
51
// /
52
- // / The results are appended to \p decls.
52
+ // / If 'moduleOrFile' is a ModuleDecl, we search the module and it's
53
+ // / public imports. If 'moduleOrFile' is a SourceFile, we search the
54
+ // / file's parent module, the module's public imports, and the source
55
+ // / file's private imports.
56
+ // /
57
+ // / \param[out] decls Results are appended to this vector.
58
+ // / \param moduleOrFile The module or file unit to search, including imports.
59
+ // / \param accessPath The access path that was imported; if not empty, only
60
+ // / the named declaration will be imported.
61
+ // / \param moduleScopeContext The top-level context from which the lookup is
62
+ // / being performed, for checking access. This must be either a
63
+ // / FileUnit or a Module.
53
64
void lookupInModule (SmallVectorImpl<ValueDecl *> &decls,
54
65
const DeclContext *moduleOrFile,
55
66
ImportPath::Access accessPath,
@@ -68,6 +79,10 @@ class LookupByName : public ModuleNameLookup<LookupByName> {
68
79
const NLKind lookupKind;
69
80
70
81
public:
82
+ // / \param ctx The AST context that the lookup will be performed in.
83
+ // / \param name The name that will be looked up.
84
+ // / \param lookupKind Whether this lookup is qualified or unqualified.
85
+ // / \param resolutionKind What sort of decl is expected.
71
86
LookupByName (ASTContext &ctx, ResolutionKind resolutionKind,
72
87
DeclName name, NLKind lookupKind)
73
88
: Super(ctx, resolutionKind), name(name),
@@ -80,6 +95,10 @@ class LookupByName : public ModuleNameLookup<LookupByName> {
80
95
return true ;
81
96
}
82
97
98
+ // / \param module The module to search for declarations in.
99
+ // / \param path The access path that was imported; if not empty, only the
100
+ // / named declaration will be imported.
101
+ // / \param[out] localDecls Results are appended to this vector.
83
102
void doLocalLookup (ModuleDecl *module , ImportPath::Access path,
84
103
SmallVectorImpl<ValueDecl *> &localDecls) {
85
104
// If this import is specific to some named decl ("import Swift.Int")
0 commit comments