================
@@ -305,18 +305,34 @@ Module *HeaderSearch::lookupModule(StringRef ModuleName,
if (Module || !AllowSearch || !HSOpts.ImplicitModuleMaps)
return Module;
- if (!lookupModuleWithPrivateFallbacks(ModuleName, ImportLoc,
- AllowExtraModuleMapSearch))
+ if (!lookupModuleWithPrivateFallbacks(
+ ModuleName, ImportLoc, AllowExtraModuleMapSearch, /*Load=*/true))
return nullptr;
return ModMap.findOrLoadModule(ModuleName);
}
+OptionalFileEntryRef
+HeaderSearch::lookupModuleMapFileForModule(StringRef ModuleName) {
+ assert(HSOpts.LazyLoadModuleMaps &&
+ "module map lookup requires lazy loading support");
+ if (!ModMap.isModuleKnown(ModuleName)) {
+ if (!HSOpts.ImplicitModuleMaps)
+ return std::nullopt;
+ // If the module map has not already been parsed, look it up.
+ if (!lookupModuleWithPrivateFallbacks(ModuleName, SourceLocation(),
+ /*AllowExtraModuleMapSearch=*/false,
----------------
cyndyishida wrote:
I think this only matters when implicit subdirectory search is enabled. I was
initially on the fence about adding more piping to support it, but I suppose
it's still better to keep parity.
https://github.com/llvm/llvm-project/pull/235835
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits