[clang] [clang][deps] Add module map describing compiled module to file dependencies. (PR #160226)
Jan Svoboda via cfe-commits
cfe-commits at lists.llvm.org
Wed Oct 8 15:14:37 PDT 2025
================
@@ -685,6 +685,13 @@ void ModuleDepCollectorPP::EndOfMainFile() {
if (!MDC.ScanInstance.getPreprocessorOpts().ImplicitPCHInclude.empty())
MDC.addFileDep(MDC.ScanInstance.getPreprocessorOpts().ImplicitPCHInclude);
+ if (Module *CurrentModule = PP.getCurrentModuleImplementation()) {
+ if (OptionalFileEntryRef CurrentModuleMap =
+ PP.getHeaderSearchInfo().getModuleMap().getModuleMapFileForUniquing(
+ CurrentModule))
+ MDC.addFileDep(CurrentModuleMap->getName());
----------------
jansvoboda11 wrote:
The failure is expected. The `"file-deps"` field is intended for consumption by tools that might not understand Clang's virtual filesystem overlays, so the only thing they can reason about is the on-disk path for files (`"external-contents"` in the VFS overlay file). That's of course different from what we put on the command-line for Clang itself, as Ben explained above.
https://github.com/llvm/llvm-project/pull/160226
More information about the cfe-commits
mailing list