benlangmuir marked 2 inline comments as done. benlangmuir added inline comments.
================ Comment at: clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp:295 + if (MDC) + MDC->applyDiscoveredDependencies(CI); + LastCC1Arguments = CI.getCC1CommandLine(); ---------------- jansvoboda11 wrote: > I'm not a fan of storing `MDC` as a member, but I don't see any clearly > better alternatives. One option would be to pass `CompilerInvocation` > out-parameter to `ModuleDepCollector`'s constructor and relying on the > collector to apply discovered dependencies, but that's not super obvious. We are applying changes to multiple CompilerInvocations (the scanned one, but also any later ones that are downstream of it), so it's less obvious to me how to do that here. We would need to pass in all of the invocations, but currently only one of them is in-memory at a time. I'm open to other ideas here, but I haven't come up with any great ideas. Maybe there's a refactoring of MDC that splits the scanning state from the state necessary to apply changes to the CI so we would only expose the minimum information needed, but I expect that would be an invasive change so prefer not to attempt it in this patch. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132405/new/ https://reviews.llvm.org/D132405 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits