This is an archive of the discontinued LLVM Phabricator instance.

[libc] Make close function of the internal File class cleanup the file object.
ClosedPublic

Authored by sivachandra on Jun 20 2023, 2:50 PM.

Details

Summary

Before this change, a separate static method named cleanup was used to
cleanup the file. Instead, now the close method cleans up the full file
object using the platform's close function.

Diff Detail

Event Timeline

sivachandra created this revision.Jun 20 2023, 2:50 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJun 20 2023, 2:50 PM
sivachandra requested review of this revision.Jun 20 2023, 2:50 PM
lntue accepted this revision.Jun 20 2023, 4:05 PM
lntue added inline comments.
libc/src/__support/File/file.h
242–244

Aren't these equivalent to return result;? So I think you can simply change it to:

return platform_close(this);
This revision is now accepted and ready to land.Jun 20 2023, 4:05 PM
sivachandra marked an inline comment as done.

Address comment.

This revision was landed with ongoing or failed builds.Jun 20 2023, 10:05 PM
This revision was automatically updated to reflect the committed changes.