[libc-commits] [libc] [libc][docs] move docgen from json to yaml (PR #119744)

via libc-commits libc-commits at lists.llvm.org
Thu Dec 12 10:56:44 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libc

Author: Nick Desaulniers (nickdesaulniers)

<details>
<summary>Changes</summary>

That way it can more easily be integrated into hdrgen.


---

Patch is 70.10 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/119744.diff


34 Files Affected:

- (removed) libc/utils/docgen/assert.json (-11) 
- (added) libc/utils/docgen/assert.yaml (+7) 
- (removed) libc/utils/docgen/ctype.json (-102) 
- (added) libc/utils/docgen/ctype.yaml (+72) 
- (modified) libc/utils/docgen/docgen.py (+9-9) 
- (removed) libc/utils/docgen/errno.json (-20) 
- (added) libc/utils/docgen/errno.yaml (+14) 
- (removed) libc/utils/docgen/fenv.json (-136) 
- (added) libc/utils/docgen/fenv.yaml (+97) 
- (removed) libc/utils/docgen/float.json (-201) 
- (modified) libc/utils/docgen/header.py (+2-2) 
- (removed) libc/utils/docgen/inttypes.json (-28) 
- (added) libc/utils/docgen/inttypes.yaml (+20) 
- (removed) libc/utils/docgen/locale.json (-53) 
- (added) libc/utils/docgen/locale.yaml (+37) 
- (removed) libc/utils/docgen/setjmp.json (-23) 
- (added) libc/utils/docgen/setjmp.yaml (+15) 
- (removed) libc/utils/docgen/signal.json (-152) 
- (added) libc/utils/docgen/signal.yaml (+102) 
- (removed) libc/utils/docgen/stdbit.json (-270) 
- (added) libc/utils/docgen/stdbit.yaml (+179) 
- (removed) libc/utils/docgen/stdlib.json (-217) 
- (added) libc/utils/docgen/stdlib.yaml (+158) 
- (removed) libc/utils/docgen/string.json (-130) 
- (added) libc/utils/docgen/string.yaml (+94) 
- (removed) libc/utils/docgen/strings.json (-40) 
- (removed) libc/utils/docgen/threads.json (-120) 
- (added) libc/utils/docgen/threads.yaml (+88) 
- (removed) libc/utils/docgen/uchar.json (-31) 
- (added) libc/utils/docgen/uchar.yaml (+21) 
- (removed) libc/utils/docgen/wchar.json (-198) 
- (added) libc/utils/docgen/wchar.yaml (+131) 
- (removed) libc/utils/docgen/wctype.json (-58) 
- (added) libc/utils/docgen/wctype.yaml (+36) 


``````````diff
diff --git a/libc/utils/docgen/assert.json b/libc/utils/docgen/assert.json
deleted file mode 100644
index ed9249cf426a54..00000000000000
--- a/libc/utils/docgen/assert.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
-  "macros": {
-    "__STDC_VERSION_ASSERT_H__": {
-      "c-definition": "7.2.1"
-    },
-    "assert": {
-      "c-definition": "7.2.1",
-      "in-latest-posix": ""
-    }
-  }
-}
diff --git a/libc/utils/docgen/assert.yaml b/libc/utils/docgen/assert.yaml
new file mode 100644
index 00000000000000..0afd4e2d3c063f
--- /dev/null
+++ b/libc/utils/docgen/assert.yaml
@@ -0,0 +1,7 @@
+macros:
+  __STDC_VERSION_ASSERT_H__:
+    c-definition: 7.2.1
+  assert:
+    c-definition: 7.2.1
+    in-latest-posix: ''
+
diff --git a/libc/utils/docgen/ctype.json b/libc/utils/docgen/ctype.json
deleted file mode 100644
index 7c6137570760fe..00000000000000
--- a/libc/utils/docgen/ctype.json
+++ /dev/null
@@ -1,102 +0,0 @@
-{
-  "functions": {
-    "isalnum": {
-      "c-definition": "7.4.1.1",
-      "in-latest-posix": ""
-    },
-    "isalnum_l": {
-      "in-latest-posix": ""
-    },
-    "isalpha": {
-      "c-definition": "7.4.1.2",
-      "in-latest-posix": ""
-    },
-    "isalpha_l": {
-      "in-latest-posix": ""
-    },
-    "isblank": {
-      "c-definition": "7.4.1.3",
-      "in-latest-posix": ""
-    },
-    "isblank_l": {
-      "in-latest-posix": ""
-    },
-    "iscntrl": {
-      "c-definition": "7.4.1.4",
-      "in-latest-posix": ""
-    },
-    "iscntrl_l": {
-      "in-latest-posix": ""
-    },
-    "isdigit": {
-      "c-definition": "7.4.1.5",
-      "in-latest-posix": ""
-    },
-    "isdigit_l": {
-      "in-latest-posix": ""
-    },
-    "isgraph": {
-      "c-definition": "7.4.1.6",
-      "in-latest-posix": ""
-    },
-    "isgraph_l": {
-      "in-latest-posix": ""
-    },
-    "islower": {
-      "c-definition": "7.4.1.7",
-      "in-latest-posix": ""
-    },
-    "islower_l": {
-      "in-latest-posix": ""
-    },
-    "isprint": {
-      "c-definition": "7.4.1.8",
-      "in-latest-posix": ""
-    },
-    "isprint_l": {
-      "in-latest-posix": ""
-    },
-    "ispunct": {
-      "c-definition": "7.4.1.9",
-      "in-latest-posix": ""
-    },
-    "ispunct_l": {
-      "in-latest-posix": ""
-    },
-    "isspace": {
-      "c-definition": "7.4.1.10",
-      "in-latest-posix": ""
-    },
-    "isspace_l": {
-      "in-latest-posix": ""
-    },
-    "isupper": {
-      "c-definition": "7.4.1.11",
-      "in-latest-posix": ""
-    },
-    "isupper_l": {
-      "in-latest-posix": ""
-    },
-    "isxdigit": {
-      "c-definition": "7.4.1.12",
-      "in-latest-posix": ""
-    },
-    "isxdigit_l": {
-      "in-latest-posix": ""
-    },
-    "tolower" : {
-      "c-definition": "7.4.2.1",
-      "in-latest-posix": ""
-    },
-    "tolower_l" : {
-      "in-latest-posix": ""
-    },
-    "toupper": {
-      "c-definition": "7.4.2.2",
-      "in-latest-posix": ""
-    },
-    "toupper_l": {
-      "in-latest-posix": ""
-    }
-  }
-}
diff --git a/libc/utils/docgen/ctype.yaml b/libc/utils/docgen/ctype.yaml
new file mode 100644
index 00000000000000..027d8f38c71f97
--- /dev/null
+++ b/libc/utils/docgen/ctype.yaml
@@ -0,0 +1,72 @@
+functions:
+  isalnum:
+    c-definition: 7.4.1.1
+    in-latest-posix: ''
+  isalnum_l:
+    in-latest-posix: ''
+  isalpha:
+    c-definition: 7.4.1.2
+    in-latest-posix: ''
+  isalpha_l:
+    in-latest-posix: ''
+  isblank:
+    c-definition: 7.4.1.3
+    in-latest-posix: ''
+  isblank_l:
+    in-latest-posix: ''
+  iscntrl:
+    c-definition: 7.4.1.4
+    in-latest-posix: ''
+  iscntrl_l:
+    in-latest-posix: ''
+  isdigit:
+    c-definition: 7.4.1.5
+    in-latest-posix: ''
+  isdigit_l:
+    in-latest-posix: ''
+  isgraph:
+    c-definition: 7.4.1.6
+    in-latest-posix: ''
+  isgraph_l:
+    in-latest-posix: ''
+  islower:
+    c-definition: 7.4.1.7
+    in-latest-posix: ''
+  islower_l:
+    in-latest-posix: ''
+  isprint:
+    c-definition: 7.4.1.8
+    in-latest-posix: ''
+  isprint_l:
+    in-latest-posix: ''
+  ispunct:
+    c-definition: 7.4.1.9
+    in-latest-posix: ''
+  ispunct_l:
+    in-latest-posix: ''
+  isspace:
+    c-definition: 7.4.1.10
+    in-latest-posix: ''
+  isspace_l:
+    in-latest-posix: ''
+  isupper:
+    c-definition: 7.4.1.11
+    in-latest-posix: ''
+  isupper_l:
+    in-latest-posix: ''
+  isxdigit:
+    c-definition: 7.4.1.12
+    in-latest-posix: ''
+  isxdigit_l:
+    in-latest-posix: ''
+  tolower:
+    c-definition: 7.4.2.1
+    in-latest-posix: ''
+  tolower_l:
+    in-latest-posix: ''
+  toupper:
+    c-definition: 7.4.2.2
+    in-latest-posix: ''
+  toupper_l:
+    in-latest-posix: ''
+
diff --git a/libc/utils/docgen/docgen.py b/libc/utils/docgen/docgen.py
index 5355dff3e2a6d9..09db284ef92824 100755
--- a/libc/utils/docgen/docgen.py
+++ b/libc/utils/docgen/docgen.py
@@ -10,9 +10,9 @@
 from argparse import ArgumentParser, Namespace
 from pathlib import Path
 from typing import Dict
-import json
 import os
 import sys
+import yaml
 
 from header import Header
 
@@ -23,14 +23,14 @@ class DocgenAPIFormatError(Exception):
 
 def check_api(header: Header, api: Dict):
     """
-    Checks that docgen json files are properly formatted. If there are any
+    Checks that docgen yaml files are properly formatted. If there are any
     fatal formatting errors, raises exceptions with error messages useful for
     fixing formatting. Warnings are printed to stderr on non-fatal formatting
     errors. The code that runs after ``check_api(api)`` is called expects that
-    ``check_api`` executed without raising formatting exceptions so the json
+    ``check_api`` executed without raising formatting exceptions so the yaml
     matches the formatting specified here.
 
-    The json file may contain:
+    The yaml file may contain:
     * an optional macros object
     * an optional functions object
 
@@ -49,7 +49,7 @@ def check_api(header: Header, api: Dict):
     this should be a C standard section number. For the ``"posix-definition"`` property,
     this should be a link to the definition.
 
-    :param api: docgen json file contents parsed into a dict
+    :param api: docgen yaml file contents parsed into a dict
     """
     errors = []
     # We require entries to have at least one of these.
@@ -93,8 +93,8 @@ def check_api(header: Header, api: Dict):
 
 
 def load_api(header: Header) -> Dict:
-    api = header.docgen_json.read_text(encoding="utf-8")
-    return json.loads(api)
+    api = header.docgen_yaml.read_text(encoding="utf-8")
+    return yaml.safe_load(api)
 
 
 def print_tbl_dir(name):
@@ -192,12 +192,12 @@ def print_impl_status_rst(header: Header, api: Dict):
         print_functions_rst(header, api["functions"])
 
 
-# This code implicitly relies on docgen.py being in the same dir as the json
+# This code implicitly relies on docgen.py being in the same dir as the yaml
 # files and is likely to need to be fixed when re-integrating docgen into
 # hdrgen.
 def get_choices() -> list:
     choices = []
-    for path in Path(__file__).parent.rglob("*.json"):
+    for path in Path(__file__).parent.rglob("*.yaml"):
         fname = path.with_suffix(".h").name
         if path.parent != Path(__file__).parent:
             fname = path.parent.name + os.sep + fname
diff --git a/libc/utils/docgen/errno.json b/libc/utils/docgen/errno.json
deleted file mode 100644
index 7f13e06ac3285e..00000000000000
--- a/libc/utils/docgen/errno.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
-  "macros": {
-    "EDOM": {
-      "c-definition": "7.5",
-      "in-latest-posix": ""
-    },
-    "EILSEQ": {
-      "c-definition": "7.5",
-      "in-latest-posix": ""
-    },
-    "ERANGE": {
-      "c-definition": "7.5",
-      "in-latest-posix": ""
-    },
-    "errno": {
-      "c-definition": "7.5",
-      "in-latest-posix": ""
-    }
-  }
-}
diff --git a/libc/utils/docgen/errno.yaml b/libc/utils/docgen/errno.yaml
new file mode 100644
index 00000000000000..da41552bc3a180
--- /dev/null
+++ b/libc/utils/docgen/errno.yaml
@@ -0,0 +1,14 @@
+macros:
+  EDOM:
+    c-definition: '7.5'
+    in-latest-posix: ''
+  EILSEQ:
+    c-definition: '7.5'
+    in-latest-posix: ''
+  ERANGE:
+    c-definition: '7.5'
+    in-latest-posix: ''
+  errno:
+    c-definition: '7.5'
+    in-latest-posix: ''
+
diff --git a/libc/utils/docgen/fenv.json b/libc/utils/docgen/fenv.json
deleted file mode 100644
index cf58d70ebcf1eb..00000000000000
--- a/libc/utils/docgen/fenv.json
+++ /dev/null
@@ -1,136 +0,0 @@
-{
-  "macros": {
-    "__STDC_VERSION_FENV_H__": {
-      "c-definition": "7.6.5"
-    },
-    "FE_DIVBYZERO": {
-      "c-definition": "7.6.9",
-      "in-latest-posix": ""
-    },
-    "FE_INEXACT": {
-      "c-definition": "7.6.9",
-      "in-latest-posix": ""
-    },
-    "FE_INVALID": {
-      "c-definition": "7.6.9",
-      "in-latest-posix": ""
-    },
-    "FE_OVERFLOW": {
-      "c-definition": "7.6.9",
-      "in-latest-posix": ""
-    },
-    "FE_UNDERFLOW": {
-      "c-definition": "7.6.9",
-      "in-latest-posix": ""
-    },
-    "FE_ALL_EXCEPT": {
-      "c-definition": "7.6.12",
-      "in-latest-posix": ""
-    },
-    "FE_DFL_MODE": {
-      "c-definition": "7.6.11"
-    },
-    "FE_DOWNWARD": {
-      "c-definition": "7.6.13",
-      "in-latest-posix": ""
-    },
-    "FE_TONEAREST": {
-      "c-definition": "7.6.13",
-      "in-latest-posix": ""
-    },
-    "FE_TONEARESTFROMZERO": {
-      "c-definition": "7.6.13"
-    },
-    "FE_TOWARDZERO": {
-      "c-definition": "7.6.13",
-      "in-latest-posix": ""
-    },
-    "FE_UPWARD": {
-      "c-definition": "7.6.13",
-      "in-latest-posix": ""
-    },
-    "FE_DEC_DOWNWARD": {
-      "c-definition": "7.6.14"
-    },
-    "FE_DEC_TONEAREST": {
-      "c-definition": "7.6.14"
-    },
-    "FE_DEC_TONEARESTFROMZERO": {
-      "c-definition": "7.6.14"
-    },
-    "FE_DEC_TOWARDZERO": {
-      "c-definition": "7.6.14"
-    },
-    "FE_DEC_UPWARD": {
-      "c-definition": "7.6.14"
-    },
-    "FE_DFL_ENV": {
-      "c-definition": "7.6.17",
-      "in-latest-posix": ""
-    }
-  },
-  "functions": {
-    "feclearexcept": {
-      "c-definition": "7.6.4.1",
-      "in-latest-posix": ""
-    },
-    "fegetexceptflag": {
-      "c-definition": "7.6.4.2",
-      "in-latest-posix": ""
-    },
-    "feraiseexcept": {
-      "c-definition": "7.6.4.3",
-      "in-latest-posix": ""
-    },
-    "fesetexcept": {
-      "c-definition": "7.6.4.4"
-    },
-    "fesetexceptflag": {
-      "c-definition": "7.6.4.5",
-      "in-latest-posix": ""
-    },
-    "fetestexceptflag": {
-      "c-definition": "7.6.4.6"
-    },
-    "fetestexcept": {
-      "c-definition": "7.6.4.7",
-      "in-latest-posix": ""
-    },
-    "fegetmode": {
-      "c-definition": "7.6.5.1"
-    },
-    "fegetround": {
-      "c-definition": "7.6.5.2",
-      "in-latest-posix": ""
-    },
-    "fe_dec_getround": {
-      "c-definition": "7.6.5.3"
-    },
-    "fesetmode": {
-      "c-definition": "7.6.5.4"
-    },
-    "fesetround": {
-      "c-definition": "7.6.5.5",
-      "in-latest-posix": ""
-    },
-    "fe_dec_setround": {
-      "c-definition": "7.6.5.6"
-    },
-    "fegetenv": {
-      "c-definition": "7.6.6.1",
-      "in-latest-posix": ""
-    },
-    "feholdexcept": {
-      "c-definition": "7.6.6.2",
-      "in-latest-posix": ""
-    },
-    "fesetenv": {
-      "c-definition": "7.6.6.3",
-      "in-latest-posix": ""
-    },
-    "feupdateenv": {
-      "c-definition": "7.6.6.4",
-      "in-latest-posix": ""
-    }
-  }
-}
diff --git a/libc/utils/docgen/fenv.yaml b/libc/utils/docgen/fenv.yaml
new file mode 100644
index 00000000000000..1d73697f36becf
--- /dev/null
+++ b/libc/utils/docgen/fenv.yaml
@@ -0,0 +1,97 @@
+functions:
+  fe_dec_getround:
+    c-definition: 7.6.5.3
+  fe_dec_setround:
+    c-definition: 7.6.5.6
+  feclearexcept:
+    c-definition: 7.6.4.1
+    in-latest-posix: ''
+  fegetenv:
+    c-definition: 7.6.6.1
+    in-latest-posix: ''
+  fegetexceptflag:
+    c-definition: 7.6.4.2
+    in-latest-posix: ''
+  fegetmode:
+    c-definition: 7.6.5.1
+  fegetround:
+    c-definition: 7.6.5.2
+    in-latest-posix: ''
+  feholdexcept:
+    c-definition: 7.6.6.2
+    in-latest-posix: ''
+  feraiseexcept:
+    c-definition: 7.6.4.3
+    in-latest-posix: ''
+  fesetenv:
+    c-definition: 7.6.6.3
+    in-latest-posix: ''
+  fesetexcept:
+    c-definition: 7.6.4.4
+  fesetexceptflag:
+    c-definition: 7.6.4.5
+    in-latest-posix: ''
+  fesetmode:
+    c-definition: 7.6.5.4
+  fesetround:
+    c-definition: 7.6.5.5
+    in-latest-posix: ''
+  fetestexcept:
+    c-definition: 7.6.4.7
+    in-latest-posix: ''
+  fetestexceptflag:
+    c-definition: 7.6.4.6
+  feupdateenv:
+    c-definition: 7.6.6.4
+    in-latest-posix: ''
+macros:
+  FE_ALL_EXCEPT:
+    c-definition: 7.6.12
+    in-latest-posix: ''
+  FE_DEC_DOWNWARD:
+    c-definition: 7.6.14
+  FE_DEC_TONEAREST:
+    c-definition: 7.6.14
+  FE_DEC_TONEARESTFROMZERO:
+    c-definition: 7.6.14
+  FE_DEC_TOWARDZERO:
+    c-definition: 7.6.14
+  FE_DEC_UPWARD:
+    c-definition: 7.6.14
+  FE_DFL_ENV:
+    c-definition: 7.6.17
+    in-latest-posix: ''
+  FE_DFL_MODE:
+    c-definition: 7.6.11
+  FE_DIVBYZERO:
+    c-definition: 7.6.9
+    in-latest-posix: ''
+  FE_DOWNWARD:
+    c-definition: 7.6.13
+    in-latest-posix: ''
+  FE_INEXACT:
+    c-definition: 7.6.9
+    in-latest-posix: ''
+  FE_INVALID:
+    c-definition: 7.6.9
+    in-latest-posix: ''
+  FE_OVERFLOW:
+    c-definition: 7.6.9
+    in-latest-posix: ''
+  FE_TONEAREST:
+    c-definition: 7.6.13
+    in-latest-posix: ''
+  FE_TONEARESTFROMZERO:
+    c-definition: 7.6.13
+  FE_TOWARDZERO:
+    c-definition: 7.6.13
+    in-latest-posix: ''
+  FE_UNDERFLOW:
+    c-definition: 7.6.9
+    in-latest-posix: ''
+  FE_UPWARD:
+    c-definition: 7.6.13
+    in-latest-posix: ''
+  __STDC_VERSION_FENV_H__:
+    c-definition: 7.6.5
+
diff --git a/libc/utils/docgen/float.json b/libc/utils/docgen/float.json
deleted file mode 100644
index 87746193b29d46..00000000000000
--- a/libc/utils/docgen/float.json
+++ /dev/null
@@ -1,201 +0,0 @@
-{
-  "macros": {
-    "__STDC_VERSION_FLOAT_H__": {
-      "c-definition": "7.7"
-    },
-    "FLT_EVAL_METHOD" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "FLT_ROUNDS" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "FLT_EVAL_METHOD" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "FLT_HAS_SUBNORM" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "DBL_HAS_SUBNORM" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "LDBL_HAS_SUBNORM" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "FLT_RADIX" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "FLT_MANT_DIG" : {
-      "c-definition": "5.3.5.3.3"
-    },
-    "DBL_MANT_DIG" : {
-      "c-definition": "5.3.5.3.3"
-    },
-    "LDBL_MANT_DIG" : {
-      "c-definition": "5.3.5.3.3"
-    },
-    "FLT_DECIMAL_DIG" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "DBL_DECIMAL_DIG" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "LDBL_DECIMAL_DIG" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "DECIMAL_DIG" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "FLT_IS_IEC_60559" : {
-      "c-definition": "5.3.5.3.3"
-    },
-    "DBL_IS_IEC_60559" : {
-      "c-definition": "5.3.5.3.3"
-    },
-    "LDBL_IS_IEC_60559" : {
-      "c-definition": "5.3.5.3.3"
-    },
-    "FLT_DIG" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "DBL_DIG" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "LDBL_DIG" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "FLT_MIN_EXP" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "DBL_MIN_EXP" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "LDBL_MIN_EXP" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "FLT_MIN_10_EXP" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "DBL_MIN_10_EXP" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "LDBL_MIN_10_EXP" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "FLT_MAX_EXP" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "DBL_MAX_EXP" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "LDBL_MAX_EXP" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "FLT_MAX_10_EXP" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "DBL_MAX_10_EXP" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "LDBL_MAX_10_EXP" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "FLT_MAX" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "DBL_MAX" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "LDBL_MAX" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "FLT_NORM_MAX" : {
-      "c-definition": "5.3.5.3.3"
-    },
-    "DBL_NORM_MAX" : {
-      "c-definition": "5.3.5.3.3"
-    },
-    "LDBL_NORM_MAX" : {
-      "c-definition": "5.3.5.3.3"
-    },
-    "FLT_EPSILON" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "DBL_EPSILON" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "LDBL_EPSILON" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "FLT_MIN" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "DBL_MIN" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "LDBL_MIN" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "FLT_SNAN" : {
-      "c-definition": "5.3.5.3.3"
-    },
-    "DBL_SNAN" : {
-      "c-definition": "5.3.5.3.3"
-    },
-    "LDBL_SNAN" : {
-      "c-definition": "5.3.5.3.3"
-    },
-    "FLT_TRUE_MIN" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "DBL_TRUE_MIN" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "LDBL_TRUE_MIN" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "INFINITY" : {
-      "c-definition": "5.3.5.3.3"
-    },
-    "NAN" : {
-      "c-definition": "5.3.5.3.3"
-    }
-  }
-}
diff --git a/libc/utils/docgen/header.py b/libc/utils/docgen/header.py
index 7728a0f1d5b44c..5bf524a64b69ba 100644
--- a/libc/utils/docgen/header.py
+++ b/libc/utils/docgen/header.py
@@ -14,7 +14,7 @@ class Header:
     Maintains implementation information about a standard header file:
     * where does its implementation dir live
     * where is its macros file
-    * where is its docgen json file
+    * where is its docgen yaml file
 
     By convention, the macro-only part of a header file is in a header-specific
     file somewhere in the directory tree with root at
@@ -42,7 +42,7 @@ def __init__(self, header_name: str):
         self.stem = header_name.rstrip(".h")
         self.docgen_root = Path(__file__).parent
         self.libc_root = self.docgen_root.parent.parent
-        self.docgen_json = self.docgen_root / Path(header_name).with_suffix(".json")
+        self.docgen_yaml = self.docgen_root / Path(header_name).with_suffix(".yaml")
         self.fns_dir = Path(self.libc_root, "src", self.stem)
         self.macros_dir = Path(self.libc_root, "include", "llvm-libc-macros")
 
diff --git a/libc/utils/docgen/inttypes.json b/libc/utils/docgen/inttypes.json
deleted file mode 100644
index 4c20d3d5cf3c01..00000000000000
--- a/libc/utils/docgen/inttypes.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
-  "functions": {
-    "imaxabs": {
-      "c-definition": "7.8.2.1",
-      "in-latest-posix": ""
-    },
-    "imaxdiv": {
-      "c-definition": "7.8.2.2",
-      "in-latest-posix": ""
-    },
-    "strtoimax": {
-      "c-definition": "7.8.2.3",
-      "in-latest-posix": ""
-    },
-    "strtoumax": {
-      "c-definition": "7.8.2.3",
-      "in-latest-posix": ""
-    },
-    "wcstoimax": {
-      "...
[truncated]

``````````

</details>


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


More information about the libc-commits mailing list