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 @@ -1437,6 +1437,8 @@ static void
1437
1437
collectExportedImports (const ModuleDecl *topLevelModule,
1438
1438
ModuleDecl::ImportCollector &importCollector) {
1439
1439
SmallVector<const ModuleDecl *> stack;
1440
+ SmallPtrSet<const ModuleDecl *, 4 > visited;
1441
+ visited.insert (topLevelModule);
1440
1442
stack.push_back (topLevelModule);
1441
1443
while (!stack.empty ()) {
1442
1444
const ModuleDecl *module = stack.pop_back_val ();
@@ -1468,7 +1470,10 @@ collectExportedImports(const ModuleDecl *topLevelModule,
1468
1470
if (module ->isClangOverlayOf (im.importedModule ))
1469
1471
continue ;
1470
1472
importCollector.collect (im);
1471
- stack.push_back (im.importedModule );
1473
+ if (!visited.contains (im.importedModule )) {
1474
+ visited.insert (im.importedModule );
1475
+ stack.push_back (im.importedModule );
1476
+ }
1472
1477
}
1473
1478
}
1474
1479
}
You can’t perform that action at this time.
0 commit comments