[PATCH] D140177: [clang][deps] Give the fake file a unique name in by-module-name scans
Jan Svoboda via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Dec 15 16:29:37 PST 2022
jansvoboda11 created this revision.
jansvoboda11 added reviewers: Bigcheese, benlangmuir.
Herald added a subscriber: ributzka.
Herald added a project: All.
jansvoboda11 requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
When scanning dependencies of a module, the command line we're given doesn't have an input file, which the driver needs to be happy. We've been creating a fake in-memory input file named after the module. However, this can hide files/directories on the actual filesystem, leading to errors.
This patch works around that issue by generating a unique file name, which won't collide with the actual file system.
We could also change the driver APIs so that we're able to specify an "assumed" input file. This would be more work, though, since the driver assumes the input name comes from the actual command-line.
Depends on D140176 <https://reviews.llvm.org/D140176>.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D140177
Files:
clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp
clang/test/ClangScanDeps/modules-full-by-mod-name.c
clang/test/ClangScanDeps/modules-full-by-mod-name.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D140177.483385.patch
Type: text/x-patch
Size: 9378 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20221216/0f585d1f/attachment.bin>
More information about the cfe-commits
mailing list