[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
Mon Jul 31 15:10:21 PDT 2023


vsapsai created this revision.
vsapsai added reviewers: ChuanqiXu, jansvoboda11.
Herald added a subscriber: ributzka.
Herald added a project: All.
vsapsai requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Fix errors like

> module 'MultiPath' is defined in both 'path/to/modules.cache/3JR48BPRU7BCG/MultiPath-1352QHUF8RNMU.pcm' and 'path/to/modules.cache/3JR48BPRU7BCG/MultiPath-20HNSLLIUDDV1.pcm'

To avoid building extra identical modules `-ivfsoverlay` option is not a
part of the hash like "/3JR48BPRU7BCG/". And it is build system's
responsibility to provide `-ivfsoverlay` options that don't cause
observable differences.  We also need to make sure the hash like
"-1352QHUF8RNMU" is not affected by `-ivfsoverlay`. As this hash is
defined by the module map path, use the path prior to any VFS
remappings.

rdar://111921464


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D156749

Files:
  clang/lib/Lex/HeaderSearch.cpp
  clang/lib/Serialization/ASTWriter.cpp
  clang/test/VFS/module-map-path.m

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D156749.545828.patch
Type: text/x-patch
Size: 5592 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230731/c3a9e798/attachment.bin>


More information about the cfe-commits mailing list