Page MenuHomePhabricator

[libc++][NFC] Move some functions from directory_iterator.cpp to filesystem_common.h
ClosedPublic

Authored by ldionne on Jan 26 2022, 8:07 AM.

Details

Reviewers
None
Group Reviewers
Restricted Project
Commits
rG89f03804fae7: [libc++][NFC] Move some functions from directory_iterator.cpp to…
Summary

This move is going to be needed in order to reuse posix_readdir in
another translation unit. This doesn't change any of the code except
for removing an unused function parameter that otherwise triggers a
warning inside our tests.

Diff Detail

Event Timeline

ldionne requested review of this revision.Jan 26 2022, 8:07 AM
ldionne created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptJan 26 2022, 8:07 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript

Did you try moving remove_all into directory_iterator.cpp, and did that not work for some reason?
(If you're just worried about naming, you could s/iterator/iteration/. ;))

Did you try moving remove_all into directory_iterator.cpp, and did that not work for some reason?
(If you're just worried about naming, you could s/iterator/iteration/. ;))

No, I did not, because I like the fact that directory_iterator is implemented in directory_iterator.cpp, and that remove_all is defined in operations.cpp, which all makes sense to me. TBH I think the only reason why these functions were not defined in filesystem_common.h were to avoid including <windows.h> in a header, but since that's a private header, I think that's fine. IMO it could have been there from the start, along with all the other helpers.

ldionne accepted this revision as: Restricted Project.Jan 27 2022, 7:58 AM
This revision was not accepted when it landed; it landed in state Needs Review.Jan 27 2022, 7:58 AM
This revision was automatically updated to reflect the committed changes.