This is an archive of the discontinued LLVM Phabricator instance.

[libc][NFC] Start cleanup of time functions
ClosedPublic

Authored by michaelrj on Apr 28 2023, 2:49 PM.

Details

Summary

The time functions have not yet been updated to match our new coding
patterns. This patch removes some unnecessary includes, adjusts the
names of the test targets, and adds several TODO comments. It is my
intention to follow this patch up with additional cleanup.

Diff Detail

Event Timeline

michaelrj created this revision.Apr 28 2023, 2:49 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptApr 28 2023, 2:49 PM
michaelrj requested review of this revision.Apr 28 2023, 2:49 PM
rtenneti accepted this revision.Apr 28 2023, 2:56 PM

Thanks for the changes, they LGTM.

This revision is now accepted and ready to land.Apr 28 2023, 2:56 PM
sivachandra accepted this revision.Apr 28 2023, 3:22 PM

OK after excluding one change from this patch.

libc/include/llvm-libc-types/time_t.h
12 ↗(On Diff #518061)

__INTPTR_TYPE__ might not be the most appropriate, but I am not sure __INT64_TYPE__ is appropriate also? I suggest that you separate this part out to a different patch so that the actual clean up can land while we discuss about the definition of time_t.

michaelrj updated this revision to Diff 518070.Apr 28 2023, 3:33 PM

move time_t change into separate patch.

This revision was landed with ongoing or failed builds.Apr 28 2023, 3:43 PM
This revision was automatically updated to reflect the committed changes.
mcgrathr added inline comments.Apr 28 2023, 8:01 PM
libc/include/llvm-libc-types/time_t.h
12 ↗(On Diff #518061)

Agreed on separating semantic from cosmetic changes.
About the time_t defn, this has traditionally been considered part of the OS ABI.
It probably still needs to be, since things like struct stat and whatnot that you generally want to be OS-provided use the type and you want to match the OS semantics for minimum and maximum values expected to get there.