[clang][deps] Generate '-fmodule-file=' only for direct dependencies
authorJan Svoboda <jan_svoboda@apple.com>
Sat, 12 Mar 2022 10:32:47 +0000 (11:32 +0100)
committerJan Svoboda <jan_svoboda@apple.com>
Sat, 12 Mar 2022 10:32:51 +0000 (11:32 +0100)
commit7f6af607464e5bcf2bd8b7bc7724a5985d7a0c34
treef024dd587347b28a5498f914e9d0a970e1d86d10
parenta6ef3635461c7e689972337b281d0052331f6150
[clang][deps] Generate '-fmodule-file=' only for direct dependencies

The `clang-scan-deps` tool currently generates `-fmodule-file=` command-line arguments for the whole transitive closure of modular dependencies. This is not necessary, we only need to provide the direct dependencies on the command line. Information about transitive dependencies is stored within the `.pcm` files of direct dependencies. This makes the command lines shorter, but should be a NFC otherwise (unless there are bugs in the loading mechanism for explicit modules).

Depends on D120465.

Reviewed By: Bigcheese

Differential Revision: https://reviews.llvm.org/D118915
clang/include/clang/Tooling/DependencyScanning/DependencyScanningTool.h
clang/include/clang/Tooling/DependencyScanning/ModuleDepCollector.h
clang/lib/Tooling/DependencyScanning/DependencyScanningTool.cpp
clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp
clang/test/ClangScanDeps/modules-full.cpp
clang/test/ClangScanDeps/modules-pch.c
clang/tools/clang-scan-deps/ClangScanDeps.cpp