[all-commits] [llvm/llvm-project] f9c237: [libc][NFC] Cleanup time.h (#122027)

Michael Jones via All-commits all-commits at lists.llvm.org
Wed Jan 8 12:29:13 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f9c2377fb68e5051b3061186c507f7b87db2a8b2
      https://github.com/llvm/llvm-project/commit/f9c2377fb68e5051b3061186c507f7b87db2a8b2
  Author: Michael Jones <michaelrj at google.com>
  Date:   2025-01-08 (Wed, 08 Jan 2025)

  Changed paths:
    M libc/hdr/types/CMakeLists.txt
    A libc/hdr/types/struct_tm.h
    M libc/src/pthread/pthread_condattr_init.cpp
    M libc/src/pthread/pthread_condattr_setclock.cpp
    M libc/src/time/CMakeLists.txt
    M libc/src/time/asctime.cpp
    M libc/src/time/asctime.h
    M libc/src/time/asctime_r.cpp
    M libc/src/time/asctime_r.h
    M libc/src/time/ctime.cpp
    M libc/src/time/ctime_r.cpp
    M libc/src/time/difftime.h
    M libc/src/time/gmtime.h
    M libc/src/time/gmtime_r.h
    M libc/src/time/mktime.cpp
    M libc/src/time/mktime.h
    M libc/src/time/time.cpp
    A libc/src/time/time_constants.h
    M libc/src/time/time_utils.cpp
    M libc/src/time/time_utils.h
    M libc/test/src/time/CMakeLists.txt
    M libc/test/src/time/TmHelper.h
    M libc/test/src/time/TmMatcher.h
    M libc/test/src/time/asctime_r_test.cpp
    M libc/test/src/time/clock_gettime_test.cpp
    M libc/test/src/time/clock_test.cpp
    M libc/test/src/time/ctime_r_test.cpp
    M libc/test/src/time/difftime_test.cpp
    M libc/test/src/time/gettimeofday_test.cpp
    M libc/test/src/time/gmtime_r_test.cpp
    M libc/test/src/time/gmtime_test.cpp
    M libc/test/src/time/mktime_test.cpp
    M libc/test/src/time/nanosleep_test.cpp

  Log Message:
  -----------
  [libc][NFC] Cleanup time.h (#122027)

While working on strftime I noticed some constants were being defined in
unexpected places. One thing led to another, and I ended up doing a
major cleanup of the time functions.

What's included:
All uses of <time.h> in /src and /test removed (except for LibcTest.cpp)
The various time constants have been moved to time_constants.h, and the
`time_constants` namespace.
struct tm gets its own type indirection header now.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list