[clang] [clang][modulemap] Lazily load module maps by header name (PR #181916)

Jan Svoboda via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 18 14:04:43 PST 2026


================
@@ -2261,6 +2261,10 @@ GlobalModuleIndex *CompilerInstance::loadGlobalModuleIndex(
   // we need to make the global index cover all modules, so we do that here.
   if (!HaveFullGlobalModuleIndex && GlobalIndex && !buildingModule()) {
     ModuleMap &MMap = getPreprocessor().getHeaderSearchInfo().getModuleMap();
+
+    // Load parsed but unloaded modules from the module maps.
----------------
jansvoboda11 wrote:

Not sure we use "unloaded" anywhere else. How about this?

```suggestion
    // Load modules that were parsed from module maps but not loaded yet.
```

Also, why is this even necessary? The code below only handles modules deserialized from a PCM file, which this call should not affect.

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


More information about the cfe-commits mailing list