This is an archive of the discontinued LLVM Phabricator instance.

[C++20][Modules][8/8] Amend module visibility rules for partitions.
ClosedPublic

Authored by iains on Jan 31 2022, 4:52 AM.

Details

Summary

Implementation partitions bring two extra cases where we have
visibility of module-private data.

  1. When we import a module implementation partition.
  2. When a partition implementation imports the primary module intertace.

We maintain a record of direct imports into the current module since
partition decls from direct imports (but not trasitive ones) are visible.

The rules on decl-reachability are much more relaxed (with the standard
giving permission for an implementation to load dependent modules and for
the decls there to be reachable, but not visible).

Diff Detail

Event Timeline

iains created this revision.Jan 31 2022, 4:52 AM
iains updated this revision to Diff 405601.Feb 3 2022, 5:46 AM

rebased onto import state machine

iains updated this revision to Diff 408766.Feb 15 2022, 1:32 AM

Rebased onto other modules work.

iains updated this revision to Diff 408866.Feb 15 2022, 7:22 AM

update formatting.

iains updated this revision to Diff 408892.Feb 15 2022, 8:36 AM

re-push format changes

iains published this revision for review.Feb 15 2022, 8:37 AM

patch 8 of 8 implementing basic C++20 module partition support.

Herald added a project: Restricted Project. · View Herald TranscriptFeb 15 2022, 8:37 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
iains updated this revision to Diff 409211.Feb 16 2022, 4:39 AM

rebased onto changes in parent patches.

iains retitled this revision from [C++20][Modules] Amend module visibility rules for partitions. to [C++20][Modules][8/8] Amend module visibility rules for partitions..Feb 16 2022, 4:40 AM
This revision is now accepted and ready to land.Feb 17 2022, 1:38 AM
iains updated this revision to Diff 409671.Feb 17 2022, 8:30 AM

rebase onto parent patch changes.

iains updated this revision to Diff 410551.Feb 22 2022, 8:45 AM

rebased

iains updated this revision to Diff 411547.Feb 25 2022, 4:01 PM

rebased

A non-actionable comment out of curiosity for the work

clang/test/Modules/cxx20-10-1-ex2.cpp
15–17 ↗(On Diff #411547)

Should these two tests now be switched on? Missing a RUN: for that IIUC?

iains updated this revision to Diff 411741.Feb 27 2022, 11:41 PM

rebased, fix missing RUN lines for two cases in a test.

iains marked an inline comment as done.Feb 27 2022, 11:43 PM
iains added inline comments.
clang/test/Modules/cxx20-10-1-ex2.cpp
15–17 ↗(On Diff #411547)

good catch, thanks!

This revision was landed with ongoing or failed builds.Mar 1 2022, 12:29 AM
This revision was automatically updated to reflect the committed changes.
iains marked an inline comment as done.