[NFC] Adopt new ImportPath types and terminology

# Conflicts:
#	lib/IDE/CodeCompletion.cpp
This commit is contained in:
Brent Royal-Gordon
2020-09-10 19:05:40 -07:00
parent 1ed3caece6
commit cff4ddf13a
52 changed files with 375 additions and 361 deletions

View File

@@ -52,7 +52,7 @@ public:
/// The results are appended to \p decls.
void lookupInModule(SmallVectorImpl<ValueDecl *> &decls,
const DeclContext *moduleOrFile,
ModuleDecl::AccessPathTy accessPath,
ImportPath::Access accessPath,
const DeclContext *moduleScopeContext);
};
@@ -79,11 +79,11 @@ private:
return true;
}
void doLocalLookup(ModuleDecl *module, ModuleDecl::AccessPathTy path,
void doLocalLookup(ModuleDecl *module, ImportPath::Access path,
SmallVectorImpl<ValueDecl *> &localDecls) {
// If this import is specific to some named decl ("import Swift.Int")
// then filter out any lookups that don't match.
if (!ModuleDecl::matchesAccessPath(path, name))
if (!path.matches(name))
return;
module->lookupValue(name, lookupKind, localDecls);
}
@@ -110,7 +110,7 @@ private:
return false;
}
void doLocalLookup(ModuleDecl *module, ModuleDecl::AccessPathTy path,
void doLocalLookup(ModuleDecl *module, ImportPath::Access path,
SmallVectorImpl<ValueDecl *> &localDecls) {
VectorDeclConsumer consumer(localDecls);
module->lookupVisibleDecls(path, consumer, lookupKind);
@@ -123,7 +123,7 @@ template <typename LookupStrategy>
void ModuleNameLookup<LookupStrategy>::lookupInModule(
SmallVectorImpl<ValueDecl *> &decls,
const DeclContext *moduleOrFile,
ModuleDecl::AccessPathTy accessPath,
ImportPath::Access accessPath,
const DeclContext *moduleScopeContext) {
assert(moduleOrFile->isModuleScopeContext());
@@ -187,7 +187,7 @@ void ModuleNameLookup<LookupStrategy>::lookupInModule(
if (import.accessPath.empty())
import.accessPath = accessPath;
else if (!accessPath.empty() &&
!ModuleDecl::isSameAccessPath(import.accessPath, accessPath))
!import.accessPath.isSameAs(accessPath))
return;
getDerived()->doLocalLookup(import.importedModule, import.accessPath,
@@ -202,7 +202,7 @@ void ModuleNameLookup<LookupStrategy>::lookupInModule(
if (auto *loader = ctx.getClangModuleLoader()) {
headerImportModule = loader->getImportedHeaderModule();
if (headerImportModule) {
ModuleDecl::ImportedModule import{ModuleDecl::AccessPathTy(),
ModuleDecl::ImportedModule import{ImportPath::Access(),
headerImportModule};
visitImport(import, nullptr);
}
@@ -274,7 +274,7 @@ void namelookup::lookupInModule(const DeclContext *moduleOrFile,
void namelookup::lookupVisibleDeclsInModule(
const DeclContext *moduleOrFile,
ModuleDecl::AccessPathTy accessPath,
ImportPath::Access accessPath,
SmallVectorImpl<ValueDecl *> &decls,
NLKind lookupKind,
ResolutionKind resolutionKind,