File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -1473,6 +1473,8 @@ static void
1473
1473
collectExportedImports (const ModuleDecl *topLevelModule,
1474
1474
ModuleDecl::ImportCollector &importCollector) {
1475
1475
SmallVector<const ModuleDecl *> stack;
1476
+ SmallPtrSet<const ModuleDecl *, 4 > visited;
1477
+ visited.insert (topLevelModule);
1476
1478
stack.push_back (topLevelModule);
1477
1479
while (!stack.empty ()) {
1478
1480
const ModuleDecl *module = stack.pop_back_val ();
@@ -1504,7 +1506,10 @@ collectExportedImports(const ModuleDecl *topLevelModule,
1504
1506
if (module ->isClangOverlayOf (im.importedModule ))
1505
1507
continue ;
1506
1508
importCollector.collect (im);
1507
- stack.push_back (im.importedModule );
1509
+ if (!visited.contains (im.importedModule )) {
1510
+ visited.insert (im.importedModule );
1511
+ stack.push_back (im.importedModule );
1512
+ }
1508
1513
}
1509
1514
}
1510
1515
}
You can’t perform that action at this time.
0 commit comments