[PATCH] D137989: [clang][deps] Avoid leaking modulemap paths across unrelated imports
Ben Langmuir via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Nov 14 14:56:52 PST 2022
benlangmuir created this revision.
benlangmuir added reviewers: jansvoboda11, Bigcheese.
Herald added a project: All.
benlangmuir requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
Use a FileEntryRef when retrieving modulemap paths in the scanner so that we use a path compatible with the original module import, rather than a FileEntry which can allow unrelated modules to leak paths into how we build a module due to FileManager mutating the path.
Note: the current change prevents an "unrelated" path, but does not change how VFS mapped paths are handled (which would be calling getNameAsRequested) nor canonicalize the path. In that sense, this is a narrower version of https://reviews.llvm.org/D135636 that should not be blocked by the VFS concerns.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D137989
Files:
clang/include/clang/Serialization/ASTReader.h
clang/lib/Frontend/FrontendAction.cpp
clang/lib/Serialization/ASTReader.cpp
clang/lib/Serialization/ASTWriter.cpp
clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp
clang/test/ClangScanDeps/modules-symlink-dir-from-module.c
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D137989.475284.patch
Type: text/x-patch
Size: 7864 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20221114/72c72459/attachment.bin>
More information about the cfe-commits
mailing list