[Sema] Intro @_spiOnly attribute and import filter

Introduce the attribute and basic import filter logic.
This commit is contained in:
Alexis Laferrière
2022-08-25 09:40:58 -07:00
parent cf8f61d76b
commit aaaef3411e
8 changed files with 29 additions and 3 deletions

View File

@@ -195,6 +195,7 @@ ImportSet &ImportCache::getImportSet(const DeclContext *dc) {
file->getImportedModules(imports,
{ModuleDecl::ImportFilterKind::Default,
ModuleDecl::ImportFilterKind::ImplementationOnly,
ModuleDecl::ImportFilterKind::SPIOnly,
ModuleDecl::ImportFilterKind::SPIAccessControl});
}
@@ -279,6 +280,7 @@ ImportCache::getAllAccessPathsNotShadowedBy(const ModuleDecl *mod,
file->getImportedModules(stack,
{ModuleDecl::ImportFilterKind::Default,
ModuleDecl::ImportFilterKind::ImplementationOnly,
ModuleDecl::ImportFilterKind::SPIOnly,
ModuleDecl::ImportFilterKind::SPIAccessControl});
}