This is an archive of the discontinued LLVM Phabricator instance.

[clang][modules] Don't depend on sharing FileManager during module build
ClosedPublic

Authored by benlangmuir on Aug 3 2022, 9:15 AM.

Details

Summary

Sharing the FileManager between the importer and the module build should only be an optimization. Add a cc1 option -fno-modules-share-filemanager to allow us to test this. Fix the path to modulemap files, which previously depended on the shared FileManager when using path mapped to an external file in a VFS.

Diff Detail

Event Timeline

benlangmuir created this revision.Aug 3 2022, 9:15 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 3 2022, 9:16 AM
benlangmuir requested review of this revision.Aug 3 2022, 9:16 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 3 2022, 9:16 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
bnbarham accepted this revision.Aug 3 2022, 1:01 PM
bnbarham added inline comments.
clang/test/ClangScanDeps/modulemap-via-vfs.m
45

Nitpick: ' vs " in the rest of the file, doesn't really matter though.

clang/test/Modules/submodule-in-private-mmap-vfs.m
39

Nitpick: no new line

This revision is now accepted and ready to land.Aug 3 2022, 1:01 PM
  • Updates for review feedback
  • Attempt to fix one of the Windows path issues - I'm just guessing based on what other VFS tests are doing. I don't know what the other windows failure is about, and probably need to debug it.

Attempt to fix test failure seen on Windows. It revealed two bugs

  • Avoid reusing the FileManager at the top-level in clang-scan-deps to make the test behave as expected
  • Make the FileManager return the cached redirecting entry, to match how it behaves when it's a new file, and test this case explicitly.

I think it was mostly luck of exactly which file lookups happen that we didn't hit this on other platforms.

Split out the FileManager change into https://reviews.llvm.org/D131273

This revision was landed with ongoing or failed builds.Aug 5 2022, 12:32 PM
This revision was automatically updated to reflect the committed changes.