mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Change ModuleDecl::getImportedModules to take an option set
...in preparation for me adding a third kind of import, making the existing "All" kind a problem. NFC, except that I did rewrite the ClangModuleUnit implementation of getImportedModules to be simpler!
This commit is contained in:
@@ -1695,24 +1695,12 @@ void ModuleFile::getImportedModules(
|
||||
PrettyStackTraceModuleFile stackEntry(*this);
|
||||
|
||||
for (auto &dep : Dependencies) {
|
||||
switch (filter) {
|
||||
case ModuleDecl::ImportFilter::All:
|
||||
// We're including all imports.
|
||||
break;
|
||||
|
||||
case ModuleDecl::ImportFilter::Private:
|
||||
// Skip @_exported imports.
|
||||
if (dep.isExported())
|
||||
if (dep.isExported()) {
|
||||
if (!filter.contains(ModuleDecl::ImportFilterKind::Public))
|
||||
continue;
|
||||
|
||||
break;
|
||||
|
||||
case ModuleDecl::ImportFilter::Public:
|
||||
// Only include @_exported imports.
|
||||
if (!dep.isExported())
|
||||
} else {
|
||||
if (!filter.contains(ModuleDecl::ImportFilterKind::Private))
|
||||
continue;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
assert(dep.isLoaded());
|
||||
|
||||
Reference in New Issue
Block a user