mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Sema] Intro set of import filters for general use
Calling getImportedModules requires to list the desired kind of imports. With the new kind of imports this has become cumbersome. Let's simplify it by offering common sets of imports. Advanced call sites can still list the desired imports explicitly.
This commit is contained in:
@@ -83,11 +83,7 @@ bool swift::emitImportedModules(ModuleDecl *mainModule,
|
||||
if (!clangImporter->importBridgingHeader(implicitHeaderPath, mainModule)) {
|
||||
SmallVector<ImportedModule, 16> imported;
|
||||
clangImporter->getImportedHeaderModule()->getImportedModules(
|
||||
imported, {ModuleDecl::ImportFilterKind::Exported,
|
||||
ModuleDecl::ImportFilterKind::Default,
|
||||
ModuleDecl::ImportFilterKind::ImplementationOnly,
|
||||
ModuleDecl::ImportFilterKind::PackageOnly,
|
||||
ModuleDecl::ImportFilterKind::SPIOnly});
|
||||
imported, ModuleDecl::getImportFilterLocal());
|
||||
|
||||
for (auto IM : imported) {
|
||||
if (auto clangModule = IM.importedModule->findUnderlyingClangModule())
|
||||
|
||||
Reference in New Issue
Block a user