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

via libc-commits libc-commits at lists.llvm.org
Thu Jul 16 23:57:10 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libc

Author: Jeff Bailey (kaladron)

<details>
<summary>Changes</summary>

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.

---
Full diff: https://github.com/llvm/llvm-project/pull/210197.diff


3 Files Affected:

- (modified) libc/docs/CMakeLists.txt (+1) 
- (removed) libc/docs/headers/time.rst (-109) 
- (added) libc/utils/docgen/time.yaml (+68) 


``````````diff
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|     |         |         |         |         |         |         |         |         |         |
-+---------------------+---------+---------+---------+-----------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
-| difftime            | |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: ''
+  difftime:
+    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: ''

``````````

</details>


https://github.com/llvm/llvm-project/pull/210197


More information about the libc-commits mailing list