Skip to content

Commit a004e50

Browse files
authored
[libc] corrected yaml files in newhdrgen (llvm#98069)
- fixed little issues in yaml issues through testing - corrected function class in the case there is no attribute
1 parent d3cb277 commit a004e50

16 files changed

+149
-159
lines changed

libc/newhdrgen/class_implementation/classes/function.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def __init__(
2020
]
2121
self.standards = standards
2222
self.guard = guard
23-
self.attributes = attributes or []
23+
self.attributes = attributes or ""
2424

2525
def __str__(self):
2626
attributes_str = self.attributes

libc/newhdrgen/tests/test_integration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def setUp(self):
2323
)
2424

2525
self.maxDiff = None
26-
# Adjust based on your directory structure such as being in build etc.
26+
2727
self.source_dir = Path(__file__).resolve().parent.parent.parent.parent
2828

2929
def run_script(self, yaml_file, h_def_file, output_dir):

libc/newhdrgen/yaml/inttypes.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
header: inttypes.h
2-
macros:
2+
macros: []
33
types:
44
- type_name: imaxdiv_t
55
enums: []

libc/newhdrgen/yaml/pthread.yaml

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -73,23 +73,23 @@ functions:
7373
- POSIX
7474
return_type: int
7575
arguments:
76-
- type: const pthread_attr_t * __restrict
77-
- type: size_t * __restrict
76+
- type: const pthread_attr_t *__restrict
77+
- type: size_t *__restrict
7878
- name: pthread_attr_getstack
7979
standards:
8080
- POSIX
8181
return_type: int
8282
arguments:
83-
- type: const pthread_attr_t * __restrict
84-
- type: void * * __restrict
85-
- type: size_t * __restrict
83+
- type: const pthread_attr_t *__restrict
84+
- type: void **__restrict
85+
- type: size_t *__restrict
8686
- name: pthread_attr_getstacksize
8787
standards:
8888
- POSIX
8989
return_type: int
9090
arguments:
91-
- type: const pthread_attr_t * __restrict
92-
- type: size_t * __restrict
91+
- type: const pthread_attr_t *__restrict
92+
- type: size_t *__restrict
9393
- name: pthread_attr_setdetachstate
9494
standards:
9595
- POSIX
@@ -130,15 +130,15 @@ functions:
130130
- POSIX
131131
return_type: int
132132
arguments:
133-
- type: const pthread_condattr_t * __restrict
133+
- type: const pthread_condattr_t *__restrict
134134
- type: clockid_t * __restrict
135135
- name: pthread_condattr_getpshared
136136
standards:
137137
- POSIX
138138
return_type: int
139139
arguments:
140-
- type: const pthread_condattr_t * __restrict
141-
- type: int * __restrict
140+
- type: const pthread_condattr_t *__restrict
141+
- type: int *__restrict
142142
- name: pthread_condattr_init
143143
standards:
144144
- POSIX
@@ -164,8 +164,8 @@ functions:
164164
- POSIX
165165
return_type: int
166166
arguments:
167-
- type: pthread_t * __restrict
168-
- type: const pthread_attr_t * __restrict
167+
- type: pthread_t *__restrict
168+
- type: const pthread_attr_t *__restrict
169169
- type: __pthread_start_t
170170
- type: void *
171171
- name: pthread_detach
@@ -207,7 +207,7 @@ functions:
207207
return_type: int
208208
arguments:
209209
- type: pthread_t
210-
- type: void * *
210+
- type: void **
211211
- name: pthread_key_create
212212
standards:
213213
- POSIX
@@ -244,8 +244,8 @@ functions:
244244
- POSIX
245245
return_type: int
246246
arguments:
247-
- type: pthread_mutex_t * __restrict
248-
- type: const pthread_mutexattr_t * __restrict
247+
- type: pthread_mutex_t *__restrict
248+
- type: const pthread_mutexattr_t *__restrict
249249
- name: pthread_mutex_lock
250250
standards:
251251
- POSIX
@@ -275,42 +275,42 @@ functions:
275275
- POSIX
276276
return_type: int
277277
arguments:
278-
- type: const pthread_mutexattr_t * __restrict
279-
- type: int * __restrict
278+
- type: const pthread_mutexattr_t *__restrict
279+
- type: int *__restrict
280280
- name: pthread_mutexattr_getrobust
281281
standards:
282282
- POSIX
283283
return_type: int
284284
arguments:
285-
- type: const pthread_mutexattr_t * __restrict
286-
- type: int * __restrict
285+
- type: const pthread_mutexattr_t *__restrict
286+
- type: int *__restrict
287287
- name: pthread_mutexattr_gettype
288288
standards:
289289
- POSIX
290290
return_type: int
291291
arguments:
292-
- type: const pthread_mutexattr_t * __restrict
293-
- type: int * __restrict
292+
- type: const pthread_mutexattr_t *__restrict
293+
- type: int *__restrict
294294
- name: pthread_mutexattr_setpshared
295295
standards:
296296
- POSIX
297297
return_type: int
298298
arguments:
299-
- type: pthread_mutexattr_t * __restrict
299+
- type: pthread_mutexattr_t *__restrict
300300
- type: int
301301
- name: pthread_mutexattr_setrobust
302302
standards:
303303
- POSIX
304304
return_type: int
305305
arguments:
306-
- type: pthread_mutexattr_t * __restrict
306+
- type: pthread_mutexattr_t *__restrict
307307
- type: int
308308
- name: pthread_mutexattr_settype
309309
standards:
310310
- POSIX
311311
return_type: int
312312
arguments:
313-
- type: pthread_mutexattr_t * __restrict
313+
- type: pthread_mutexattr_t *__restrict
314314
- type: int
315315
- name: pthread_once
316316
standards:

libc/newhdrgen/yaml/sched.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ functions:
7777
standards:
7878
- POSIX
7979
return_type: int
80-
arguments: []
80+
arguments:
81+
- type: void
8182
- name: __sched_getcpucount
8283
standards:
8384
- llvm_libc_ext

libc/newhdrgen/yaml/signal.yaml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
header: signal.h
2-
macros:
3-
- macro_name: __need_size_t
4-
macro_value: null
2+
macros: []
53
types:
64
- type_name: pid_t
75
- type_name: stack_t
@@ -32,15 +30,15 @@ functions:
3230
return_type: int
3331
arguments:
3432
- type: int
35-
- type: const struct sigaction * __restrict
36-
- type: struct sigaction * __restrict
33+
- type: const struct sigaction *__restrict
34+
- type: struct sigaction *__restrict
3735
- name: sigaltstack
3836
standards:
3937
- POSIX
4038
return_type: int
4139
arguments:
42-
- type: const stack_t * __restrict
43-
- type: stack_t * __restrict
40+
- type: const stack_t *__restrict
41+
- type: stack_t *__restrict
4442
- name: sigdelset
4543
standards:
4644
- POSIX
@@ -67,8 +65,8 @@ functions:
6765
return_type: int
6866
arguments:
6967
- type: int
70-
- type: const sigset_t * __restrict
71-
- type: sigset_t * __restrict
68+
- type: const sigset_t *__restrict
69+
- type: sigset_t *__restrict
7270
- name: sigfillset
7371
standards:
7472
- POSIX

0 commit comments

Comments
 (0)