[libc-commits] [libc] 89f5334 - [libc][docs] Dynamically generate time.h documentation (#210197)

via libc-commits libc-commits at lists.llvm.org
Fri Jul 17 00:15:01 PDT 2026


Author: Jeff Bailey
Date: 2026-07-17T08:14:57+01:00
New Revision: 89f5334990c5aa853fcbaa361aefe5b999e63dc5

URL: https://github.com/llvm/llvm-project/commit/89f5334990c5aa853fcbaa361aefe5b999e63dc5
DIFF: https://github.com/llvm/llvm-project/commit/89f5334990c5aa853fcbaa361aefe5b999e63dc5.diff

LOG: [libc][docs] Dynamically generate time.h documentation (#210197)

Removed the static time.rst file.

Added time to docgen_list in libc/docs/CMakeLists.txt. Created
libc/utils/docgen/time.yaml to define the functions.

Assisted-by: Automated tooling, human reviewed.

Added: 
    libc/utils/docgen/time.yaml

Modified: 
    libc/docs/CMakeLists.txt

Removed: 
    libc/docs/headers/time.rst


################################################################################
diff  --git a/libc/docs/CMakeLists.txt b/libc/docs/CMakeLists.txt
index ded99393f9390..261addc0006ff 100644
--- a/libc/docs/CMakeLists.txt
+++ b/libc/docs/CMakeLists.txt
@@ -86,6 +86,7 @@ if (SPHINX_FOUND)
       sys/wait
       termios
       threads
+      time
       uchar
       unistd
       wchar

diff  --git a/libc/docs/headers/time.rst b/libc/docs/headers/time.rst
deleted file mode 100644
index db15edb6b5428..0000000000000
--- a/libc/docs/headers/time.rst
+++ /dev/null
@@ -1,109 +0,0 @@
-======
-time.h
-======
-
----------------
-Source location
----------------
-
--   The main source for time functions is located at: ``libc/src/time``
-
----------------------
-Implementation Status
----------------------
-
-* To check date and time functions enabled for Linux:
-
-  - `linux-x86_64 <https://github.com/llvm/llvm-project/tree/main/libc/config/linux/x86_64/entrypoints.txt>`_
-
-  - `linux-aarch64 <https://github.com/llvm/llvm-project/tree/main/libc/config/linux/aarch64/entrypoints.txt>`_
-
-  - `linux-aarch32 <https://github.com/llvm/llvm-project/tree/main/libc/config/linux/arm/entrypoints.txt>`_
-
-  - `linux-riscv and linux-riscv32 <https://github.com/llvm/llvm-project/tree/main/libc/config/linux/riscv/entrypoints.txt>`_
-
-* To check date and time functions enabled for Windows:
-
-  - `windows-x86_64 <https://github.com/llvm/llvm-project/tree/main/libc/config/windows/entrypoints.txt>`_
-
-  - windows-aarch64 - to be added
-
-* To check date and time functions enabled for macOS:
-
-  - `darwin-x86_64 <https://github.com/llvm/llvm-project/tree/main/libc/config/darwin/x86_64/entrypoints.txt>`_
-
-  - `darwin-aarch64 <https://github.com/llvm/llvm-project/tree/main/libc/config/darwin/aarch64/entrypoints.txt>`_
-
-* To check date and time functions enabled for GPU:
-
-  - `amdgpu-entrypoints <https://github.com/llvm/llvm-project/tree/main/libc/config/gpu/amdgpu/entrypoints.txt>`_
-
-  - `nvptx-entrypoints <https://github.com/llvm/llvm-project/tree/main/libc/config/gpu/nvptx/entrypoints.txt>`_
-
-* To check date and time functions enabled for embedded system:
-
-  - `baremetal-aarch64 <https://github.com/llvm/llvm-project/tree/main/libc/config/baremetal/aarch64/entrypoints.txt>`_
-
-  - `baremetal-aarch32 <https://github.com/llvm/llvm-project/tree/main/libc/config/baremetal/arm/entrypoints.txt>`_
-
-  - `baremetal-riscv32 <https://github.com/llvm/llvm-project/tree/main/libc/config/baremetal/riscv/entrypoints.txt>`_
-
-+---------------------+-----------------------------------------------+-------------------+-------------------+-----------------------------+---------+---------+
-| <Func>              |  Linux                                        | Windows           | MacOS             | Embedded                    | GPU               |
-|                     +---------+---------+---------+-----------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
-|                     | x86_64  | aarch64 | aarch32 | riscv64/riscv32 | x86_64  | aarch64 | x86_64  | aarch64 | aarch64 | aarch32 | riscv32 | AMD     | nVidia  |
-+=====================+=========+=========+=========+=================+=========+=========+=========+=========+=========+=========+=========+=========+=========+
-| asctime             | |check| | |check| |         |     |check|     |         |         |         |         |         |         |         |         |         |
-+---------------------+---------+---------+---------+-----------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
-| asctime_r           | |check| | |check| |         |     |check|     |         |         |         |         |         |         |         |         |         |
-+---------------------+---------+---------+---------+-----------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
-| ctime               | |check| | |check| |         |     |check|     |         |         |         |         |         |         |         |         |         |
-+---------------------+---------+---------+---------+-----------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
-| ctime_r             | |check| | |check| |         |     |check|     |         |         |         |         |         |         |         |         |         |
-+---------------------+---------+---------+---------+-----------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
-| clock               | |check| | |check| |         |     |check|     |         |         |         |         |         |         |         |         |         |
-+---------------------+---------+---------+---------+-----------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
-| clock_getcpuclockid |         |         |         |                 |         |         |         |         |         |         |         |         |         |
-+---------------------+---------+---------+---------+-----------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
-| clock_getres        |         |         |         |                 |         |         |         |         |         |         |         |         |         |
-+---------------------+---------+---------+---------+-----------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
-| clock_gettime       | |check| | |check| |         |     |check|     |         |         |         |         |         |         |         | |check| | |check| |
-+---------------------+---------+---------+---------+-----------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
-| clock_nanosleep     |         |         |         |                 |         |         |         |         |         |         |         |         |         |
-+---------------------+---------+---------+---------+-----------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
-| clock_settime       | |check| | |check| |         |     |check|     |         |         |         |         |         |         |         |         |         |
-+---------------------+---------+---------+---------+-----------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
-| 
diff time            | |check| | |check| |         |     |check|     |         |         |         |         |         |         |         |         |         |
-+---------------------+---------+---------+---------+-----------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
-| getdate             |         |         |         |                 |         |         |         |         |         |         |         |         |         |
-+---------------------+---------+---------+---------+-----------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
-| gmtime              | |check| | |check| |         |     |check|     |         |         |         |         |         |         |         |         |         |
-+---------------------+---------+---------+---------+-----------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
-| gmtime_r            | |check| | |check| |         |     |check|     |         |         |         |         |         |         |         |         |         |
-+---------------------+---------+---------+---------+-----------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
-| localtime           | |check| | |check| |         |     |check|     |         |         |         |         |         |         |         |         |         |
-+---------------------+---------+---------+---------+-----------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
-| localtime_r         | |check| | |check| |         |     |check|     |         |         |         |         |         |         |         |         |         |
-+---------------------+---------+---------+---------+-----------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
-| mktime              | |check| | |check| |         |     |check|     |         |         |         |         |         |         |         |         |         |
-+---------------------+---------+---------+---------+-----------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
-| nanosleep           | |check| | |check| |         |     |check|     |         |         |         |         |         |         |         |         |         |
-+---------------------+---------+---------+---------+-----------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
-| strftime            |         |         |         |                 |         |         |         |         |         |         |         |         |         |
-+---------------------+---------+---------+---------+-----------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
-| strptime            |         |         |         |                 |         |         |         |         |         |         |         |         |         |
-+---------------------+---------+---------+---------+-----------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
-| time                | |check| | |check| |         |     |check|     |         |         |         |         |         |         |         |         |         |
-+---------------------+---------+---------+---------+-----------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
-| timer_create        |         |         |         |                 |         |         |         |         |         |         |         |         |         |
-+---------------------+---------+---------+---------+-----------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
-| timer_delete        |         |         |         |                 |         |         |         |         |         |         |         |         |         |
-+---------------------+---------+---------+---------+-----------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
-| timer_gettime       |         |         |         |                 |         |         |         |         |         |         |         |         |         |
-+---------------------+---------+---------+---------+-----------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
-| timer_getoverrun    |         |         |         |                 |         |         |         |         |         |         |         |         |         |
-+---------------------+---------+---------+---------+-----------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
-| timer_settime       |         |         |         |                 |         |         |         |         |         |         |         |         |         |
-+---------------------+---------+---------+---------+-----------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
-| tzset               |         |         |         |                 |         |         |         |         |         |         |         |         |         |
-+---------------------+---------+---------+---------+-----------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+

diff  --git a/libc/utils/docgen/time.yaml b/libc/utils/docgen/time.yaml
new file mode 100644
index 0000000000000..af3cfed8d889b
--- /dev/null
+++ b/libc/utils/docgen/time.yaml
@@ -0,0 +1,68 @@
+functions:
+  asctime:
+    c-definition: 7.27.2.1
+    in-latest-posix: ''
+  asctime_r:
+    in-latest-posix: ''
+  ctime:
+    c-definition: 7.27.2.2
+    in-latest-posix: ''
+  ctime_r:
+    in-latest-posix: ''
+  clock:
+    c-definition: 7.27.2.1
+    in-latest-posix: ''
+  clock_getcpuclockid:
+    in-latest-posix: ''
+  clock_getres:
+    in-latest-posix: ''
+  clock_gettime:
+    in-latest-posix: ''
+  clock_nanosleep:
+    in-latest-posix: ''
+  clock_settime:
+    in-latest-posix: ''
+  
diff time:
+    c-definition: 7.27.2.2
+    in-latest-posix: ''
+  getdate:
+    in-latest-posix: ''
+  gmtime:
+    c-definition: 7.27.2.3
+    in-latest-posix: ''
+  gmtime_r:
+    in-latest-posix: ''
+  localtime:
+    c-definition: 7.27.2.4
+    in-latest-posix: ''
+  localtime_r:
+    in-latest-posix: ''
+  mktime:
+    c-definition: 7.27.2.3
+    in-latest-posix: ''
+  nanosleep:
+    in-latest-posix: ''
+  strftime:
+    c-definition: 7.27.3.5
+    in-latest-posix: ''
+  strftime_l:
+    in-latest-posix: ''
+  strptime:
+    in-latest-posix: ''
+  time:
+    c-definition: 7.27.2.4
+    in-latest-posix: ''
+  timespec_get:
+    c-definition: 7.27.2.5
+  timer_create:
+    in-latest-posix: ''
+  timer_delete:
+    in-latest-posix: ''
+  timer_gettime:
+    in-latest-posix: ''
+  timer_getoverrun:
+    in-latest-posix: ''
+  timer_settime:
+    in-latest-posix: ''
+  tzset:
+    in-latest-posix: ''


        


More information about the libc-commits mailing list