@@ -1127,18 +1127,15 @@ bool ModuleDecl::isSystemModule() const {
1127
1127
return false ;
1128
1128
}
1129
1129
1130
- static bool forAllImportedModules (ModuleDecl *topLevel,
1131
- ModuleDecl::AccessPathTy thisPath,
1132
- llvm::function_ref<bool (ModuleDecl::ImportedModule)> fn) {
1133
- using ImportedModule = ModuleDecl::ImportedModule;
1134
-
1130
+ bool ModuleDecl::forAllVisibleModules (AccessPathTy thisPath,
1131
+ llvm::function_ref<bool (ImportedModule)> fn) {
1135
1132
llvm::SmallSet<ImportedModule, 32 , ModuleDecl::OrderImportedModules> visited;
1136
1133
SmallVector<ImportedModule, 32 > stack;
1137
1134
1138
- topLevel-> getImportedModules (stack, ModuleDecl::ImportFilter::Public);
1135
+ getImportedModules (stack, ModuleDecl::ImportFilter::Public);
1139
1136
1140
1137
// Make sure the top-level module is first; we want pre-order-ish traversal.
1141
- stack.push_back (ImportedModule (thisPath, topLevel ));
1138
+ stack.push_back (ImportedModule (thisPath, this ));
1142
1139
1143
1140
while (!stack.empty ()) {
1144
1141
auto next = stack.pop_back_val ();
@@ -1167,11 +1164,6 @@ static bool forAllImportedModules(ModuleDecl *topLevel,
1167
1164
return true ;
1168
1165
}
1169
1166
1170
- bool ModuleDecl::forAllVisibleModules (AccessPathTy thisPath,
1171
- llvm::function_ref<bool (ImportedModule)> fn) {
1172
- return forAllImportedModules (this , thisPath, fn);
1173
- }
1174
-
1175
1167
bool FileUnit::forAllVisibleModules (
1176
1168
llvm::function_ref<bool (ModuleDecl::ImportedModule)> fn) {
1177
1169
if (!getParentModule ()->forAllVisibleModules (ModuleDecl::AccessPathTy (), fn))
0 commit comments