[PATCH] D106100: [clang-scan-deps] ignore top-level module dependencies that aren't actually imported
Alex Lorenz via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Jul 15 13:57:12 PDT 2021
arphaman created this revision.
arphaman added reviewers: jansvoboda11, Bigcheese, dexonsmith.
Herald added a subscriber: ributzka.
arphaman requested review of this revision.
Whenever `-fmodule-name=top_level_module` name is parsed, and clang actually tries to import top_level_module, the headers are imported textually and the module isn't actually built. However, the dependency scanner could still record it as a potential dependency if the module was reimported and thus recorded by the preprocessor callbacks. This patch avoids collecting this kind of module as a dependency by verifying that we don't collect top level modules without actual PCM files.
https://reviews.llvm.org/D106100
Files:
clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp
clang/test/ClangScanDeps/Inputs/header3.h
clang/test/ClangScanDeps/Inputs/module.modulemap
clang/test/ClangScanDeps/Inputs/module_fmodule_name_cdb.json
clang/test/ClangScanDeps/modules-fmodule-name-no-module-built.m
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106100.359124.patch
Type: text/x-patch
Size: 4917 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210715/24cc6593/attachment.bin>
More information about the cfe-commits
mailing list