This is an archive of the discontinued LLVM Phabricator instance.

[clang][deps] Stop sharing FileManager across module builds in scanner
ClosedPublic

Authored by benlangmuir on Aug 8 2022, 10:02 AM.

Details

Summary

Sharing the FileManager across implicit module builds currently leaks
paths looked up in an importer into the built module itself. This can
cause non-deterministic results across scans. It is especially bad for
modules since the path can be saved into the pcm file itself, leading to
stateful behaviour if the cache is shared.

This should not impact the number of real filesystem accesses in the
scanner, since it is already caching in the
DependencyScanningWorkerFilesystem.

Note: this change does not affect whether or not the FileManager is
shared across TUs in the scanner, which is a separate issue.

Diff Detail

Event Timeline

benlangmuir created this revision.Aug 8 2022, 10:02 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 8 2022, 10:02 AM
benlangmuir requested review of this revision.Aug 8 2022, 10:02 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 8 2022, 10:02 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
jansvoboda11 accepted this revision.Aug 8 2022, 10:14 AM

LGTM, thanks. (For context, this patch build on top of D131076).

This revision is now accepted and ready to land.Aug 8 2022, 10:14 AM