[clang][deps] Compute command-lines for dependencies immediately
authorBen Langmuir <blangmuir@apple.com>
Tue, 16 Aug 2022 00:54:00 +0000 (17:54 -0700)
committerBen Langmuir <blangmuir@apple.com>
Tue, 16 Aug 2022 21:25:27 +0000 (14:25 -0700)
commit5482432bf6cc7e334894734ebbdac0a97ee98b19
tree08df497464e1665b885b92a9488c42f11815a66e
parentde6fd169715764f0401d8580b64c11fda45101e1
[clang][deps] Compute command-lines for dependencies immediately

Instead of delaying the generation of command-lines to after all
dependencies are reported, compute them immediately. This is partly in
preparation for splitting the TU driver command into its constituent cc1
and other jobs, but it also just simplifies working with the compiler
invocation for modules if they are not "without paths".

Also change the computation of the default output path in
clang-scan-deps to scrape the implicit module cache from the
command-line rather than get it from the dependency, since that is now
unavailable at the time we make the callback.

Differential Revision: https://reviews.llvm.org/D131934
clang/include/clang/Tooling/DependencyScanning/DependencyScanningTool.h
clang/include/clang/Tooling/DependencyScanning/DependencyScanningWorker.h
clang/include/clang/Tooling/DependencyScanning/ModuleDepCollector.h
clang/lib/Tooling/DependencyScanning/DependencyScanningTool.cpp
clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp
clang/tools/clang-scan-deps/ClangScanDeps.cpp