[clang] [clang][modules] Avoid calling expensive `SourceManager::translateFile()` (PR #86216)

Jan Svoboda via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 25 15:57:29 PDT 2024


================
@@ -71,6 +71,7 @@
 // CHECK-NEXT:       "context-hash": "{{.*}}",
 // CHECK-NEXT:       "file-deps": [
 // CHECK-NEXT:         "[[PREFIX]]/first/module.modulemap",
+// CHECK-NEXT:         "[[PREFIX]]/second/module.modulemap",
----------------
jansvoboda11 wrote:

This is a side-effect of the change in `CompilerInstance.cpp`. The implicit scan now uses the top-level module map to compile modules instead of the containing module map and that makes it included in file dependencies. This change is a bit unfortunate, since the explicit command line we generate actually only uses the containing module map, not the top-level one. Ideally, we'd either find a way to remove this file dependency or we'd make the explicit compile to also consume the top-level module map (in which case this file dependency would be real).

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


More information about the cfe-commits mailing list