================
@@ -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:

This should go through the `VirtualFileSystem` to be consistent with the code 
that reads module files. The callers of this API should both have easy access 
to a VFS to pass in: for `SimplePCHValidator` it's 
`FileMgr.getVirtualFileSystem()` and for `PCHValidator` it's 
`Reader.getFileManager().getVirtualFileSystem()`.

You could also add a helper method to VirtualFileSystem for `equivalent` that 
does `status(Path1).equivalent(status(Path2))` (plus error handling).

https://github.com/llvm/llvm-project/pull/90925
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to