[clang] [clang][deps] Add module map describing compiled module to file dependencies. (PR #160226)

Ben Langmuir via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 6 16:49:40 PDT 2025


================
@@ -444,9 +444,11 @@ void ModuleDepCollector::applyDiscoveredDependencies(CompilerInvocation &CI) {
       if (OptionalFileEntryRef CurrentModuleMap =
               PP.getHeaderSearchInfo()
                   .getModuleMap()
-                  .getModuleMapFileForUniquing(CurrentModule))
+                  .getModuleMapFileForUniquing(CurrentModule)) {
         CI.getFrontendOpts().ModuleMapFiles.emplace_back(
             CurrentModuleMap->getNameAsRequested());
+        Consumer.handleFileDependency(CurrentModuleMap->getNameAsRequested());
----------------
benlangmuir wrote:

I think @jansvoboda11 is right. The difference here is that this is an *output path* for consumption by external tools, which don't know how to map the requested path to the real on-disk location, while the commit you referenced is changing an *input* to the compiler, which needs to have the virtual path and knows how to map it as needed.

https://github.com/llvm/llvm-project/pull/160226


More information about the cfe-commits mailing list