[PATCH] D108647: [clang][deps] Use top-level modules as precompiled dependencies
Jan Svoboda via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Aug 24 10:39:45 PDT 2021
jansvoboda11 created this revision.
jansvoboda11 added reviewers: Bigcheese, dexonsmith, arphaman.
jansvoboda11 requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
The `ASTReader` populates `Module::PresumedModuleMapFile` only for top-level modules, not submodules. To avoid generating empty `-fmodule-map-file=` arguments, make discovered modules depend on top-level precompiled modules. The granularity of submodules is not important here.
The documentation of `Module::PresumedModuleMapFile` says this field is non-empty only when building from preprocessed source. This means there can still be cases where the dependency scanner generates empty `-fmodule-map-file=` arguments. That's being addressed in separate patch: D108544 <https://reviews.llvm.org/D108544>.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D108647
Files:
clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp
clang/test/ClangScanDeps/Inputs/modules-pch-common-submodule/cdb_pch.json
clang/test/ClangScanDeps/Inputs/modules-pch-common-submodule/cdb_tu.json
clang/test/ClangScanDeps/Inputs/modules-pch-common-submodule/mod_common.h
clang/test/ClangScanDeps/Inputs/modules-pch-common-submodule/mod_common_sub.h
clang/test/ClangScanDeps/Inputs/modules-pch-common-submodule/mod_tu.h
clang/test/ClangScanDeps/Inputs/modules-pch-common-submodule/module.modulemap
clang/test/ClangScanDeps/Inputs/modules-pch-common-submodule/pch.h
clang/test/ClangScanDeps/Inputs/modules-pch-common-submodule/tu.c
clang/test/ClangScanDeps/modules-pch-common-submodule.c
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D108647.368394.patch
Type: text/x-patch
Size: 9238 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210824/670d2bda/attachment.bin>
More information about the cfe-commits
mailing list