[PATCH] D132405: [clang][deps] Split translation units into individual -cc1 or other commands

Ben Langmuir via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 30 14:44:48 PDT 2022


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



More information about the cfe-commits mailing list