This is an archive of the discontinued LLVM Phabricator instance.

[clang][deps] Give the fake file a unique name in by-module-name scans
ClosedPublic

Authored by jansvoboda11 on Dec 15 2022, 4:29 PM.

Details

Summary

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.

Diff Detail

Event Timeline

jansvoboda11 created this revision.Dec 15 2022, 4:29 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 15 2022, 4:29 PM
Herald added a subscriber: ributzka. · View Herald Transcript
jansvoboda11 requested review of this revision.Dec 15 2022, 4:29 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 15 2022, 4:29 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript

Improve tests

artemcm accepted this revision.Dec 16 2022, 11:38 AM
This revision is now accepted and ready to land.Dec 16 2022, 11:38 AM
clang/test/ClangScanDeps/modules-full-by-mod-name.c