Give OptionSet an initializer_list constructor.

This makes it easier to specify OptionSet arguments.

Also modify appropriate uses of ModuleDecl::ImportFilter to take
advantage of the new constructor.
This commit is contained in:
Martin Boehme
2020-06-18 15:45:43 +02:00
parent d45047dfb3
commit d806ba53f6
12 changed files with 65 additions and 72 deletions

View File

@@ -355,12 +355,11 @@ ImportDepth::ImportDepth(ASTContext &context,
// Private imports from this module.
// FIXME: only the private imports from the current source file.
ModuleDecl::ImportFilter importFilter;
importFilter |= ModuleDecl::ImportFilterKind::Private;
importFilter |= ModuleDecl::ImportFilterKind::ImplementationOnly;
// FIXME: ImportFilterKind::ShadowedBySeparateOverlay?
SmallVector<ModuleDecl::ImportedModule, 16> mainImports;
main->getImportedModules(mainImports, importFilter);
main->getImportedModules(mainImports,
{ModuleDecl::ImportFilterKind::Private,
ModuleDecl::ImportFilterKind::ImplementationOnly});
for (auto &import : mainImports) {
uint8_t depth = 1;
if (auxImports.count(import.importedModule->getName().str()))