jansvoboda11 added a comment. Fair enough, iterative implementation will be better.
I simplified it a bit by using the in-out parameter `ModuleFiles` to keep track of visited files. I also switched to using `SmallVector` for the newly discovered (not-yet-visited) imports, which allows using the suggested `pop_back_val` and avoids using (potentially dangling) iterator. The test case is a bit unwieldy, since the old implementation only failed when the `StringMap` got rehashed (with 16 entries). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121533/new/ https://reviews.llvm.org/D121533 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits