[libc-commits] [libc] docgen refresh (PR #118709)

via libc-commits libc-commits at lists.llvm.org
Wed Dec 4 14:54:15 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libc

Author: Nick Desaulniers (nickdesaulniers)

<details>
<summary>Changes</summary>

- **[libc][docgen] Use Macro for macro table name**
- **fix setjmp json, otherwise can't regen**
- **regen all docs**


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


7 Files Affected:

- (modified) libc/docs/fenv.rst (+1-1) 
- (modified) libc/docs/setjmp.rst (+30-3) 
- (modified) libc/docs/signal.rst (+1-1) 
- (modified) libc/docs/stdbit.rst (+1-1) 
- (modified) libc/docs/threads.rst (+1-1) 
- (modified) libc/utils/docgen/docgen.py (+4-4) 
- (modified) libc/utils/docgen/setjmp.json (+5-5) 


``````````diff
diff --git a/libc/docs/fenv.rst b/libc/docs/fenv.rst
index e7a5a3fb2c815e..2492e22d2fd78d 100644
--- a/libc/docs/fenv.rst
+++ b/libc/docs/fenv.rst
@@ -12,7 +12,7 @@ Macros
   :align: center
   :header-rows: 1
 
-  * - Function
+  * - Macro
     - Implemented
     - C23 Standard Section
     - POSIX.1-2017 Standard Section
diff --git a/libc/docs/setjmp.rst b/libc/docs/setjmp.rst
index d9188dfe1d5e47..dd7e0aca3b9cda 100644
--- a/libc/docs/setjmp.rst
+++ b/libc/docs/setjmp.rst
@@ -1,7 +1,28 @@
 .. include:: check.rst
 
-setjmp.h Functions
-==================
+========
+setjmp.h
+========
+
+Macros
+======
+
+.. list-table::
+  :widths: auto
+  :align: center
+  :header-rows: 1
+
+  * - Macro
+    - Implemented
+    - C23 Standard Section
+    - POSIX.1-2017 Standard Section
+  * - __STDC_VERSION_SETJMP_H__
+    -
+    - 7.13.2
+    -
+
+Functions
+=========
 
 .. list-table::
   :widths: auto
@@ -10,7 +31,13 @@ setjmp.h Functions
 
   * - Function
     - Implemented
-    - Standard
+    - C23 Standard Section
+    - POSIX.1-2017 Standard Section
   * - longjmp
     - |check|
     - 7.13.2.1
+    -
+  * - setjmp
+    - |check|
+    - 7.13.1.1
+    -
diff --git a/libc/docs/signal.rst b/libc/docs/signal.rst
index d1a7cb60956022..e12f67b0c61c0b 100644
--- a/libc/docs/signal.rst
+++ b/libc/docs/signal.rst
@@ -12,7 +12,7 @@ Macros
   :align: center
   :header-rows: 1
 
-  * - Function
+  * - Macro
     - Implemented
     - C23 Standard Section
     - POSIX.1-2017 Standard Section
diff --git a/libc/docs/stdbit.rst b/libc/docs/stdbit.rst
index 71f9bbfd1d000e..e6b82bb77a14aa 100644
--- a/libc/docs/stdbit.rst
+++ b/libc/docs/stdbit.rst
@@ -12,7 +12,7 @@ Macros
   :align: center
   :header-rows: 1
 
-  * - Function
+  * - Macro
     - Implemented
     - C23 Standard Section
     - POSIX.1-2017 Standard Section
diff --git a/libc/docs/threads.rst b/libc/docs/threads.rst
index 63cd6c40e14551..db0edacf7b4680 100644
--- a/libc/docs/threads.rst
+++ b/libc/docs/threads.rst
@@ -12,7 +12,7 @@ Macros
   :align: center
   :header-rows: 1
 
-  * - Function
+  * - Macro
     - Implemented
     - C23 Standard Section
     - POSIX.1-2017 Standard Section
diff --git a/libc/utils/docgen/docgen.py b/libc/utils/docgen/docgen.py
index 25e22d4d587785..af5d00a5cbf8c7 100755
--- a/libc/utils/docgen/docgen.py
+++ b/libc/utils/docgen/docgen.py
@@ -92,7 +92,7 @@ def load_api(header: Header) -> Dict:
     return json.loads(api)
 
 
-def print_tbl_dir():
+def print_tbl_dir(name):
     print(
         f"""
 .. list-table::
@@ -100,7 +100,7 @@ def print_tbl_dir():
   :align: center
   :header-rows: 1
 
-  * - Function
+  * - {name}
     - Implemented
     - C23 Standard Section
     - POSIX.1-2017 Standard Section"""
@@ -112,7 +112,7 @@ def print_functions_rst(header: Header, functions: Dict):
     print(tbl_hdr)
     print("=" * len(tbl_hdr))
 
-    print_tbl_dir()
+    print_tbl_dir("Function")
 
     for name in sorted(functions.keys()):
         print(f"  * - {name}")
@@ -138,7 +138,7 @@ def print_macros_rst(header: Header, macros: Dict):
     print(tbl_hdr)
     print("=" * len(tbl_hdr))
 
-    print_tbl_dir()
+    print_tbl_dir("Macro")
 
     for name in sorted(macros.keys()):
         print(f"  * - {name}")
diff --git a/libc/utils/docgen/setjmp.json b/libc/utils/docgen/setjmp.json
index 38d4af568926a2..0b9a4e65da4f6a 100644
--- a/libc/utils/docgen/setjmp.json
+++ b/libc/utils/docgen/setjmp.json
@@ -1,15 +1,15 @@
 {
   "macros": {
     "__STDC_VERSION_SETJMP_H__": {
-      "defined": "7.13.2"
-    },
-    "setjmp": {
-      "defined": "7.13.1.1"
+      "c-definition": "7.13.2"
     }
   },
   "functions": {
+    "setjmp": {
+      "c-definition": "7.13.1.1"
+    },
     "longjmp": {
-      "defined": "7.13.2.1"
+      "c-definition": "7.13.2.1"
     }
   }
 }

``````````

</details>


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


More information about the libc-commits mailing list