This is an archive of the discontinued LLVM Phabricator instance.

[libc++] Split the various iterator types out of <iterator>
ClosedPublic

Authored by ldionne on Jun 21 2021, 1:54 PM.

Diff Detail

Event Timeline

ldionne created this revision.Jun 21 2021, 1:54 PM
ldionne requested review of this revision.Jun 21 2021, 1:54 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 21 2021, 1:54 PM
Herald added a reviewer: Restricted Project. · View Herald Transcript
Quuxplusone added inline comments.
libcxx/include/__iterator/insert_iterator.h
11–12

/BACK_//

Sure, once buildkite is happy, I'm happy.
It would be a good idea — if you haven't already done so — to diff {i,o}stream_iterator.h, and diff {front,back}_insert_iterator.h, and so on; and try to remove any gratuitous differences in formatting or inclusions or anything.

libcxx/include/__iterator/wrap_iter.h
79–82

I suppose this is just shuffling code around, so OK; but it would make a good followup to investigate why these 4 lines are here, and what breaks if they're removed (if anything). I suspect they're obsolete.
Bonus points if you make all the operator<= etc. into hidden friends, thus shortening this file by a few dozen lines.

ldionne updated this revision to Diff 353704.Jun 22 2021, 10:37 AM
ldionne marked 2 inline comments as done.

Fix CI failures (hopefully).

libcxx/include/__iterator/wrap_iter.h
79–82

I planned on doing that, thanks for reminding me.

Those forward declarations are obsolete, I already checked that the other day.

Note: I am expecting this to fail in the Modules build because I did not add the relevant files to the modulemap. If it doesn't fail, I'll raise an eyebrow.

Note: I am expecting this to fail in the Modules build because I did not add the relevant files to the modulemap. If it doesn't fail, I'll raise an eyebrow.

The modules build doesn't fail - it's a bit suspicious, but as Arthur said in an offline conversation, it appears that those modulemap changes are only necessary when there is some sort of specialization of a type defined in another header or something like that.

ldionne updated this revision to Diff 353816.Jun 22 2021, 4:24 PM

Fix the modulemap

ldionne updated this revision to Diff 353938.Jun 23 2021, 5:53 AM

Fix typo in modulemap

ldionne updated this revision to Diff 354259.Jun 24 2021, 8:05 AM

Proper IWYU

ldionne accepted this revision.Jun 28 2021, 9:24 AM
This revision is now accepted and ready to land.Jun 28 2021, 9:24 AM