[clang] [clang][modules] Lazily load by name lookups in module maps (PR #132853)

2025-04-05 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: > > This now makes much more sense after the renames from the prep-commit. > > There are still some naming inconsistencies, though. For example > > `ModuleMap::loadModuleMapFile()` both **parses** and loads a module map > > file, but `ModuleMap::findOrLoadModule()` expects

[clang] [clang][modules] Lazily load by name lookups in module maps (PR #132853)

2025-04-05 Thread Michael Spencer via cfe-commits
@@ -2128,9 +2245,16 @@ bool ModuleMap::loadModuleMapFile(FileEntryRef File, bool IsSystem, // If the module map file wasn't already entered, do so now. if (ID.isInvalid()) { -auto FileCharacter = -IsSystem ? SrcMgr::C_System_ModuleMap : SrcMgr::C_User_ModuleMa

[clang] [clang][modules] Lazily load by name lookups in module maps (PR #132853)

2025-04-05 Thread Jan Svoboda via cfe-commits
@@ -2128,9 +2245,16 @@ bool ModuleMap::loadModuleMapFile(FileEntryRef File, bool IsSystem, // If the module map file wasn't already entered, do so now. if (ID.isInvalid()) { -auto FileCharacter = -IsSystem ? SrcMgr::C_System_ModuleMap : SrcMgr::C_User_ModuleMa

[clang] [clang][modules] Lazily load by name lookups in module maps (PR #132853)

2025-04-03 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese updated https://github.com/llvm/llvm-project/pull/132853 >From d19d7c6314dbb68abfe7cdceebd8e8f65aedddc5 Mon Sep 17 00:00:00 2001 From: Michael Spencer Date: Wed, 29 Jan 2025 12:49:29 -0800 Subject: [PATCH] [clang][modules] Lazily load by name lookups in module maps

[clang] [clang][modules] Lazily load by name lookups in module maps (PR #132853)

2025-04-03 Thread Michael Spencer via cfe-commits
Bigcheese wrote: > This now makes much more sense after the renames from the prep-commit. There > are still some naming inconsistencies, though. For example > `ModuleMap::loadModuleMapFile()` both **parses** and loads a module map file, > but `ModuleMap::findOrLoadModule()` expects the module

[clang] [clang][modules] Lazily load by name lookups in module maps (PR #132853)

2025-03-26 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 commented: This now makes much more sense after the renames from the prep-commit. There are still some naming inconsistencies, though. For example `ModuleMap::loadModuleMapFile()` both **parses** and loads a module map file, but `ModuleMap::findOrLoadModule()` e

[clang] [clang][modules] Lazily load by name lookups in module maps (PR #132853)

2025-03-26 Thread Jan Svoboda via cfe-commits
@@ -373,10 +373,10 @@ Module *HeaderSearch::lookupModule(StringRef ModuleName, StringRef SearchName, SmallString<128> NestedModuleMapDirName; NestedModuleMapDirName = Dir.getDirRef()->getName(); llvm::sys::path::append(NestedModuleMapDirName, ModuleName); -if (

[clang] [clang][modules] Lazily load by name lookups in module maps (PR #132853)

2025-03-26 Thread Jan Svoboda via cfe-commits
@@ -359,11 +359,11 @@ Module *HeaderSearch::lookupModule(StringRef ModuleName, StringRef SearchName, // checked DirectoryEntryRef NormalDir = *Dir.getDirRef(); // Search for a module map file in this directory. -if (loadModuleMapFile(NormalDir, IsSystem, -

[clang] [clang][modules] Lazily load by name lookups in module maps (PR #132853)

2025-03-25 Thread Michael Spencer via cfe-commits
@@ -1801,6 +1801,33 @@ HeaderSearch::loadModuleMapFileImpl(FileEntryRef File, bool IsSystem, return LMM_NewlyLoaded; } +HeaderSearch::LoadModuleMapResult +HeaderSearch::parseModuleMapFileImpl(FileEntryRef File, bool IsSystem, Bigcheese wrote: https://githu

[clang] [clang][modules] Lazily load by name lookups in module maps (PR #132853)

2025-03-24 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese created https://github.com/llvm/llvm-project/pull/132853 Instead of eagerly populating the `clang::ModuleMap` when looking up a module by name, this patch changes `HeaderSearch` to only load the modules that are actually used. This introduces `ModuleMap::findOrLoa

[clang] [clang][modules] Lazily load by name lookups in module maps (PR #132853)

2025-03-24 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang @llvm/pr-subscribers-clang-modules Author: Michael Spencer (Bigcheese) Changes Instead of eagerly populating the `clang::ModuleMap` when looking up a module by name, this patch changes `HeaderSearch` to only load the modules that are actually use