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

Michael Spencer via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 18 15:46:56 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.
----------------
Bigcheese wrote:

This ends up rebuilding the global module index which is based on all modules Clang knows about. Without this call it ends up missing modules. Specifically this changes the range the for loop iterates over.

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


More information about the cfe-commits mailing list