[clang] [clang-tools-extra] [clang] Consistently use "load" to refer to populating clang::ModuleMap (PR #132970)

Jan Svoboda via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 25 11:32:47 PDT 2025


================
@@ -2136,20 +2136,20 @@ bool ModuleMap::parseModuleMapFile(FileEntryRef File, bool IsSystem,
   assert(Target && "Missing target information");
   std::optional<llvm::MemoryBufferRef> Buffer = SourceMgr.getBufferOrNone(ID);
   if (!Buffer)
-    return ParsedModuleMap[File] = true;
+    return LoadedModuleMap[File] = true;
   assert((!Offset || *Offset <= Buffer->getBufferSize()) &&
          "invalid buffer offset");
 
   std::optional<modulemap::ModuleMapFile> MMF =
       modulemap::parseModuleMap(ID, Dir, SourceMgr, Diags, IsSystem, Offset);
   bool Result = false;
   if (MMF) {
-    ModuleMapParser Parser(*MMF, SourceMgr, Diags, *this, ID, Dir, IsSystem);
-    Result = Parser.parseModuleMapFile();
+    ModuleMapLoader Loader(*MMF, SourceMgr, Diags, *this, ID, Dir, IsSystem);
+    Result = Loader.loadModuleMapFile();
   }
-  ParsedModuleMap[File] = Result;
+  LoadedModuleMap[File] = Result;
 
-  // Notify callbacks that we parsed it.
+  // Notify callbacks that we loaded it.
   for (const auto &Cb : Callbacks)
     Cb->moduleMapFileRead(MMF ? MMF->Start : SourceLocation(), File, IsSystem);
----------------
jansvoboda11 wrote:

I was about to suggest that we should come up with a better name for this callback, but in the end it's called for module maps that we failed to load and parse, so "read" here is probably the best name.

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


More information about the cfe-commits mailing list