[PATCH] D156749: [modules] Fix error about the same module being defined in different .pcm files when using VFS overlays.

Volodymyr Sapsai via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 4 17:26:46 PDT 2023


vsapsai added a comment.

In D156749#4561803 <https://reviews.llvm.org/D156749#4561803>, @jansvoboda11 wrote:

> My suggestion is to use the actual real on-disk path. Not `FileEntryRef::getName()`, but something that always behaves as if `use-external-name` was set to `true`. I believe this would handle your VFS/VFS-use-external-name-true/VFS-use-external-name-false problem. It would also handle another pitfall: two compilations with distinct VFS overlays that redirect two different as-requested module map paths into the same on-disk path.

Do you suggest doing it for the hashing or for ASTWriter or both? We are already doing some module map path canonicalization (added a comment in corresponding place) but it's not pure on-disk path, it takes into account VFS.



================
Comment at: clang/lib/Lex/HeaderSearch.cpp:259-260
     // to lower-case in case we're on a case-insensitive file system.
     SmallString<128> CanonicalPath(ModuleMapPath);
     if (getModuleMap().canonicalizeModuleMapPath(CanonicalPath))
       return {};
----------------
Sort of canonicalization and obtaining real on-disk path we are doing.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D156749/new/

https://reviews.llvm.org/D156749



More information about the cfe-commits mailing list