[libc-commits] [libc] [libc] final edits to newheadergen yaml files (PR #98983)

via libc-commits libc-commits at lists.llvm.org
Wed Jul 17 16:33:29 PDT 2024


https://github.com/RoseZhang03 updated https://github.com/llvm/llvm-project/pull/98983

>From 021d7b7e05854329224c371136e0dcff4a12e1a8 Mon Sep 17 00:00:00 2001
From: Rose Zhang <rosezhang at google.com>
Date: Wed, 17 Jul 2024 00:11:20 +0000
Subject: [PATCH 1/3] fixed mismatched data in yaml files and added statvfs to
 linux x86_64  headers.txt

---
 libc/config/linux/x86_64/headers.txt | 1 +
 libc/newhdrgen/yaml/arpa_inet.yaml   | 5 +----
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/libc/config/linux/x86_64/headers.txt b/libc/config/linux/x86_64/headers.txt
index df276894246c4..0294f62bc2f7a 100644
--- a/libc/config/linux/x86_64/headers.txt
+++ b/libc/config/linux/x86_64/headers.txt
@@ -45,6 +45,7 @@ set(TARGET_PUBLIC_HEADERS
     libc.include.sys_select
     libc.include.sys_socket
     libc.include.sys_stat
+    libc.include.sys_statvfs
     libc.include.sys_syscall
     libc.include.sys_time
     libc.include.sys_types
diff --git a/libc/newhdrgen/yaml/arpa_inet.yaml b/libc/newhdrgen/yaml/arpa_inet.yaml
index 945a602705dba..c01235d4327a5 100644
--- a/libc/newhdrgen/yaml/arpa_inet.yaml
+++ b/libc/newhdrgen/yaml/arpa_inet.yaml
@@ -1,9 +1,6 @@
 header: arpa-inet.h
 macros: []
-types:
-  - type_name: uint32_t
-  - type_name: uint16_t
-  - type_name: inttypes.h
+types: []
 enums: []
 objects: []
 functions:

>From bc29bddec64814eb344a960d6b874ab7adf4b0e3 Mon Sep 17 00:00:00 2001
From: Rose Zhang <rosezhang at google.com>
Date: Wed, 17 Jul 2024 22:02:50 +0000
Subject: [PATCH 2/3] fixed yaml file mismatches

---
 libc/newhdrgen/yaml/assert.yaml                | 1 -
 libc/newhdrgen/yaml/{rpc.yaml => gpu_rpc.yaml} | 0
 libc/newhdrgen/yaml/pthread.yaml               | 7 ++++---
 libc/newhdrgen/yaml/search.yaml                | 1 -
 libc/newhdrgen/yaml/setjmp.yaml                | 2 +-
 5 files changed, 5 insertions(+), 6 deletions(-)
 rename libc/newhdrgen/yaml/{rpc.yaml => gpu_rpc.yaml} (100%)

diff --git a/libc/newhdrgen/yaml/assert.yaml b/libc/newhdrgen/yaml/assert.yaml
index 9ad0f0628274e..58d6c413cebdc 100644
--- a/libc/newhdrgen/yaml/assert.yaml
+++ b/libc/newhdrgen/yaml/assert.yaml
@@ -13,4 +13,3 @@ functions:
       - type: const char *
       - type: unsigned
       - type: const char *
-    guard: __cplusplus
diff --git a/libc/newhdrgen/yaml/rpc.yaml b/libc/newhdrgen/yaml/gpu_rpc.yaml
similarity index 100%
rename from libc/newhdrgen/yaml/rpc.yaml
rename to libc/newhdrgen/yaml/gpu_rpc.yaml
diff --git a/libc/newhdrgen/yaml/pthread.yaml b/libc/newhdrgen/yaml/pthread.yaml
index f22767eb1b752..292d91751e406 100644
--- a/libc/newhdrgen/yaml/pthread.yaml
+++ b/libc/newhdrgen/yaml/pthread.yaml
@@ -8,12 +8,12 @@ types:
   - type_name: pthread_key_t
   - type_name: pthread_condattr_t
   - type_name: __pthread_tss_dtor_t
+  - type_name: pthread_rwlock_t
   - type_name: pthread_rwlockattr_t
   - type_name: pthread_attr_t
   - type_name: __pthread_start_t
   - type_name: __pthread_once_func_t
   - type_name: __atfork_callback_t
-  - type_name: pthread_rwlock_t
 enums: []
 functions:
   - name: pthread_atfork
@@ -106,7 +106,7 @@ functions:
     return_type: int
     arguments:
       - type: const pthread_condattr_t *__restrict
-      - type: clockid_t * __restrict
+      - type: clockid_t *__restrict
   - name: pthread_condattr_getpshared
     standards: 
       - POSIX
@@ -200,7 +200,8 @@ functions:
     standards: 
       - POSIX
     return_type: pthread_t
-    arguments: []
+    arguments:
+      - type: void
   - name: pthread_setname_np
     standards:
       - GNUExtensions
diff --git a/libc/newhdrgen/yaml/search.yaml b/libc/newhdrgen/yaml/search.yaml
index a7983a70bda73..b4fde14f771a2 100644
--- a/libc/newhdrgen/yaml/search.yaml
+++ b/libc/newhdrgen/yaml/search.yaml
@@ -1,7 +1,6 @@
 header: search.h
 macros: []
 types:
-  - type_name: size_t
   - type_name: struct_hsearch_data
   - type_name: ENTRY
   - type_name: ACTION
diff --git a/libc/newhdrgen/yaml/setjmp.yaml b/libc/newhdrgen/yaml/setjmp.yaml
index c750b46fc2088..13c02ef314c26 100644
--- a/libc/newhdrgen/yaml/setjmp.yaml
+++ b/libc/newhdrgen/yaml/setjmp.yaml
@@ -8,7 +8,7 @@ functions:
   - name: longjmp
     standards: 
       - stdc
-    return_type: _Noreturn void
+    return_type: void
     arguments:
       - type: jmp_buf 
       - type: int

>From 83cb8eb384c8332e61225cf0daba8a5edc6b5b1f Mon Sep 17 00:00:00 2001
From: Rose Zhang <rosezhang at google.com>
Date: Wed, 17 Jul 2024 23:20:28 +0000
Subject: [PATCH 3/3] added cbrt math function, create arpa and gpu folder,
 fixed inconsistent types

---
 libc/newhdrgen/yaml/{ => arpa}/arpa_inet.yaml | 0
 libc/newhdrgen/yaml/{ => gpu}/gpu_rpc.yaml    | 0
 libc/newhdrgen/yaml/math.yaml                 | 6 ++++++
 libc/newhdrgen/yaml/setjmp.yaml               | 2 +-
 libc/newhdrgen/yaml/wchar.yaml                | 1 +
 5 files changed, 8 insertions(+), 1 deletion(-)
 rename libc/newhdrgen/yaml/{ => arpa}/arpa_inet.yaml (100%)
 rename libc/newhdrgen/yaml/{ => gpu}/gpu_rpc.yaml (100%)

diff --git a/libc/newhdrgen/yaml/arpa_inet.yaml b/libc/newhdrgen/yaml/arpa/arpa_inet.yaml
similarity index 100%
rename from libc/newhdrgen/yaml/arpa_inet.yaml
rename to libc/newhdrgen/yaml/arpa/arpa_inet.yaml
diff --git a/libc/newhdrgen/yaml/gpu_rpc.yaml b/libc/newhdrgen/yaml/gpu/gpu_rpc.yaml
similarity index 100%
rename from libc/newhdrgen/yaml/gpu_rpc.yaml
rename to libc/newhdrgen/yaml/gpu/gpu_rpc.yaml
diff --git a/libc/newhdrgen/yaml/math.yaml b/libc/newhdrgen/yaml/math.yaml
index 5afde59b6b558..8588389bca4d2 100644
--- a/libc/newhdrgen/yaml/math.yaml
+++ b/libc/newhdrgen/yaml/math.yaml
@@ -7,6 +7,12 @@ types:
 enums: []
 objects: []
 functions:
+  - name: cbrt
+    standards:
+      - stdc
+    return_type: double
+    arguments:
+      - type: double
   - name: cbrtf
     standards:
       - stdc
diff --git a/libc/newhdrgen/yaml/setjmp.yaml b/libc/newhdrgen/yaml/setjmp.yaml
index 13c02ef314c26..c750b46fc2088 100644
--- a/libc/newhdrgen/yaml/setjmp.yaml
+++ b/libc/newhdrgen/yaml/setjmp.yaml
@@ -8,7 +8,7 @@ functions:
   - name: longjmp
     standards: 
       - stdc
-    return_type: void
+    return_type: _Noreturn void
     arguments:
       - type: jmp_buf 
       - type: int
diff --git a/libc/newhdrgen/yaml/wchar.yaml b/libc/newhdrgen/yaml/wchar.yaml
index 663267fb69d73..92ecdc26fbc73 100644
--- a/libc/newhdrgen/yaml/wchar.yaml
+++ b/libc/newhdrgen/yaml/wchar.yaml
@@ -4,6 +4,7 @@ types:
   - type_name: size_t
   - type_name: wint_t
   - type_name: wchar_t
+  - type_name: mbstate_t.h
 enums: []
 objects: []
 functions:



More information about the libc-commits mailing list