[clang] [llvm] [modules] Accept equivalent module caches from different symlink (PR #90925)

Ben Langmuir via llvm-commits llvm-commits at lists.llvm.org
Fri May 3 11:18:01 PDT 2024


================
@@ -839,17 +839,15 @@ static bool checkHeaderSearchOptions(const HeaderSearchOptions &HSOpts,
                                      DiagnosticsEngine *Diags,
                                      const LangOptions &LangOpts,
                                      const PreprocessorOptions &PPOpts) {
-  if (LangOpts.Modules) {
-    if (SpecificModuleCachePath != ExistingModuleCachePath &&
-        !PPOpts.AllowPCHWithDifferentModulesCachePath) {
-      if (Diags)
-        Diags->Report(diag::err_pch_modulecache_mismatch)
-          << SpecificModuleCachePath << ExistingModuleCachePath;
-      return true;
-    }
-  }
-
-  return false;
+  if (!LangOpts.Modules || PPOpts.AllowPCHWithDifferentModulesCachePath ||
+      SpecificModuleCachePath == ExistingModuleCachePath ||
+      llvm::sys::fs::equivalent(SpecificModuleCachePath,
----------------
benlangmuir wrote:

That's fine, it will fail when it tries to read anything from the cache.

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


More information about the llvm-commits mailing list