-
Notifications
You must be signed in to change notification settings - Fork 15.2k
docgen refresh #118709
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
docgen refresh #118709
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Member
nickdesaulniers
commented
Dec 4, 2024
- [libc][docgen] Use Macro for macro table name
- fix setjmp json, otherwise can't regen
- regen all docs
Otherwise we render the table under the Macros section with a column header that says Function when it should say Macro.
@llvm/pr-subscribers-libc Author: Nick Desaulniers (nickdesaulniers) Changes
Full diff: https://github.com/llvm/llvm-project/pull/118709.diff 7 Files Affected:
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"
}
}
}
|
I'm probably going to merge the functionality of docgen into hdrgen, but for now, there's some smaller cleanups I'd like to do first. |
michaelrj-google
approved these changes
Dec 4, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.