[clang] [clang][deps][modules] Allocate input file paths lazily (PR #114457)

Jan Svoboda via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 31 13:14:54 PDT 2024


================
@@ -21,6 +21,16 @@ using namespace clang;
 using namespace tooling;
 using namespace dependencies;
 
+void ModuleDeps::forEachFileDep(llvm::function_ref<void(StringRef)> Cb) const {
+  SmallString<0> PathBuf;
+  PathBuf.reserve(256);
----------------
jansvoboda11 wrote:

Curious what people think of having the caller provide this. If the caller used the same buffer for multiple `ModuleDeps` objects, we could avoid even more allocations. I haven't tested the perf of that scheme.

https://github.com/llvm/llvm-project/pull/114457


More information about the cfe-commits mailing list