[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:20:45 PDT 2024
https://github.com/RoseZhang03 updated https://github.com/llvm/llvm-project/pull/98983
>From 7d122283f1fdf1db568a89b249992cf80974eb1b Mon Sep 17 00:00:00 2001
From: Rose Zhang <rosezhang at google.com>
Date: Tue, 16 Jul 2024 02:33:28 +0000
Subject: [PATCH 1/4] [libc] final edits to newheadergen yaml files
Performed one last run of integration tests, removing duplicate types
and removing unneeded files.
Currently looked through all sys files, will finish checking other yaml
files this week.
---
libc/newhdrgen/yaml/sys/sys_time.yaml | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/libc/newhdrgen/yaml/sys/sys_time.yaml b/libc/newhdrgen/yaml/sys/sys_time.yaml
index a901cdafd26a1..eb3dd548389b3 100644
--- a/libc/newhdrgen/yaml/sys/sys_time.yaml
+++ b/libc/newhdrgen/yaml/sys/sys_time.yaml
@@ -1,8 +1,7 @@
header: sys-time.h
standards: Linux
macros: []
-types:
- - type_name: struct_timeval
+types: []
enums: []
functions: []
objects: []
>From 59f349d1301498b151a16b7947dfbcbe1d654048 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 2/4] 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 +----
libc/newhdrgen/yaml/sys/sys_random.yaml | 2 +-
3 files changed, 3 insertions(+), 5 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:
diff --git a/libc/newhdrgen/yaml/sys/sys_random.yaml b/libc/newhdrgen/yaml/sys/sys_random.yaml
index 233fb2c7988cb..6d84056d7dd71 100644
--- a/libc/newhdrgen/yaml/sys/sys_random.yaml
+++ b/libc/newhdrgen/yaml/sys/sys_random.yaml
@@ -4,7 +4,7 @@ types:
- type_name: ssize_t
- type_name: size_t
enums: []
-objects:
+objects: []
functions:
- name: getrandom
standards:
>From 511a287c12c140d90048c3f7787ea2b305d32717 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 3/4] fixed yaml file mismatches
---
libc/newhdrgen/yaml/assert.yaml | 1 -
.../newhdrgen/yaml/{rpc.yaml => gpu_rpc.yaml} | 0
libc/newhdrgen/yaml/pthread.yaml | 36 ++++---------------
libc/newhdrgen/yaml/search.yaml | 1 -
libc/newhdrgen/yaml/setjmp.yaml | 2 +-
5 files changed, 7 insertions(+), 33 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 14a562082d5de..292d91751e406 100644
--- a/libc/newhdrgen/yaml/pthread.yaml
+++ b/libc/newhdrgen/yaml/pthread.yaml
@@ -8,38 +8,13 @@ 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
-enums:
- - name: PTHREAD_CREATE_JOINABLE
- value: 0x0
- - name: PTHREAD_CREATE_DETACHED
- value: 0x1
- - name: PTHREAD_MUTEX_NORMAL
- value: 0x0
- - name: PTHREAD_MUTEX_ERRORCHECK
- value: 0x1
- - name: PTHREAD_MUTEX_RECURSIVE
- value: 0x2
- - name: PTHREAD_MUTEX_DEFAULT
- value: 0x0
- - name: PTHREAD_PROCESS_PRIVATE
- value: 0x0
- - name: PTHREAD_PROCESS_SHARED
- value: 0x1
- - name: PTHREAD_MUTEX_STALLED
- value: 0x0
- - name: PTHREAD_MUTEX_ROBUST
- value: 0x1
- - name: PTHREAD_RWLOCK_PREFER_READER_NP
- value: 0
- - name: PTHREAD_RWLOCK_PREFER_WRITER_NP
- value: 1
- - name: PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP
- value: 2
+enums: []
functions:
- name: pthread_atfork
standards:
@@ -131,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
@@ -184,7 +159,7 @@ functions:
- name: pthread_exit
standards:
- POSIX
- return_type: __Noreturn void
+ return_type: _Noreturn void
arguments:
- type: void *
- name: pthread_getname_np
@@ -225,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 fe93f28895ffc89221067bd526b2283d03dfa3d9 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 4/4] 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/time.yaml | 2 +-
libc/newhdrgen/yaml/wchar.yaml | 1 +
6 files changed, 9 insertions(+), 2 deletions(-)
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/time.yaml b/libc/newhdrgen/yaml/time.yaml
index e7f8de65eeb75..220d4328dbbdb 100644
--- a/libc/newhdrgen/yaml/time.yaml
+++ b/libc/newhdrgen/yaml/time.yaml
@@ -15,7 +15,7 @@ functions:
- stdc
return_type: char *
arguments:
- - type: struct tm *
+ - type: const struct tm *
- name: asctime_r
standard:
- stdc
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