[PATCH] D123104: [Modules] Use looked-up filename when looking for module maps

Ben Barham via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 4 17:20:18 PDT 2022

bnbarham created this revision.
bnbarham added a reviewer: dexonsmith.
Herald added a project: All.
bnbarham requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Prevent possible modulemap collisions by making sure to always use the
looked-up filename, regardless of any possible overlays.

Upstreamed from apple#llvm-project
72cf785051fb1b3ef22eee4dd33366e41a275981. As well as preventing the
collisions as above, it also highlighted an issue with the recent change
to narrow the FileManager hack of setting the `DirectoryEntry` in
`FileEntry` to the most recently looked up directory
(3fda0edc51fd68192a30e302d45db081bb02d7f9 <https://reviews.llvm.org/rG3fda0edc51fd68192a30e302d45db081bb02d7f9>). Specifically, it would cause
the incorrect path to be used in `DoFrameworkLookup` in a crash

- Crash reproducers have `use-external-names` set to false
- `File->getFileEntry().getDir()->getName()` would then be the *cached* path, not the just looked up one
- `crash-vfs-umbrella-frameworks.m` fails with this change since the correct path is now looked up and causes B to be loaded twice

  rG LLVM Github Monorepo



actor(@bnbarham) application(Differential) author(@bnbarham) herald(H423) herald(H576) herald(H864) monogram(D123104) object-type(DREV) phid(PHID-DREV-h3pufxsxbgppzpajqza7) reviewer(@dexonsmith) revision-repository(rG) revision-status(needs-review) subscriber(@cfe-commits) tag(#all) tag(#clang) via(conduit)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D123104.420356.patch
Type: text/x-patch
Size: 4298 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220405/9f398842/attachment-0001.bin>

More information about the cfe-commits mailing list