[clang] [clang-tools-extra] [clang][modules] Remove `Module::ASTFile` (PR #185994)

Ben Langmuir via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 17 10:08:28 PDT 2026


================
@@ -33,6 +33,23 @@
 
 using namespace clang;
 
+std::optional<ModuleFileKey>
+ModuleFileName::makeKey(FileManager &FileMgr) const {
+  if (Separator) {
+    StringRef ModuleCachePath = StringRef(Path).substr(0, *Separator);
+    StringRef ModuleFilePathSuffix = StringRef(Path).substr(*Separator);
+    if (auto ModuleCache = FileMgr.getOptionalDirectoryRef(
+            ModuleCachePath, /*CacheFailure=*/false))
+      return ModuleFileKey(*ModuleCache, ModuleFilePathSuffix);
+  } else {
+    if (auto ModuleFile = FileMgr.getOptionalFileRef(Path, /*OpenFile=*/true,
----------------
benlangmuir wrote:

Why `/*OpenFile=*/true,`?  Are we still playing games trying to always open a module file and keep it open permanently?

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


More information about the cfe-commits mailing list