[libc] Remove trivial .h.def files (#149466)

Remove all the .h.def files that already express nothing
whatsoever not already expressed in YAML.  Clean up a few YAML
files without materially changing any generated header output.

Many more .h.def files remain that need a bit of conversion in
YAML to express macro requirements and such.
This commit is contained in:
Roland McGrath 2025-07-18 11:35:09 -07:00 committed by GitHub
parent 6acc6991f8
commit 13f7786f72
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
25 changed files with 85 additions and 315 deletions

View File

@ -1,16 +0,0 @@
//===-- POSIX header dirent.h ---------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_LIBC_DIRENT_H
#define LLVM_LIBC_DIRENT_H
#include "__llvm-libc-common.h"
%%public_api()
#endif // LLVM_LIBC_DIRENT_H

View File

@ -1,47 +1,45 @@
header: dirent.h
header_template: dirent.h.def
macros: []
standards:
- posix
types:
- type_name: struct_dirent
- type_name: DIR
- type_name: ino_t
enums: []
objects: []
functions:
- name: alphasort
standards:
- POSIX
- posix
return_type: int
arguments:
- type: const struct dirent **
- type: const struct dirent **
- name: closedir
standards:
- POSIX
- posix
return_type: int
arguments:
- type: DIR *
- name: dirfd
standards:
- POSIX
- posix
return_type: int
arguments:
- type: DIR *
- name: fdopendir
standards:
- POSIX
- posix
return_type: DIR *
arguments:
- type: int
- name: opendir
standards:
- POSIX
- posix
return_type: DIR *
arguments:
- type: const char *
- name: readdir
standards:
- POSIX
- posix
return_type: struct dirent *
arguments:
- type: DIR *

View File

@ -1,18 +0,0 @@
//===-- POSIX header search.h ---------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_LIBC_SEARCH_H
#define LLVM_LIBC_SEARCH_H
#include "__llvm-libc-common.h"
#define __need_size_t
#include <stddef.h>
%%public_api()
#endif // LLVM_LIBC_SEARCH_H

View File

@ -1,6 +1,6 @@
header: search.h
header_template: search.h.def
macros: []
standards:
- posix
types:
- type_name: ACTION
- type_name: ENTRY
@ -12,35 +12,35 @@ objects: []
functions:
- name: hcreate
standards:
- POSIX
- posix
return_type: int
arguments:
- type: size_t
- name: hcreate_r
standards: GNUExtensions
standards: gnu
return_type: int
arguments:
- type: size_t
- type: struct hsearch_data *
- name: hdestroy
standards: GNUExtensions
standards: gnu
return_type: void
arguments: []
- name: hdestroy_r
standards:
- POSIX
- posix
return_type: void
arguments:
- type: struct hsearch_data *
- name: hsearch
standards:
- POSIX
- posix
return_type: ENTRY *
arguments:
- type: ENTRY
- type: ACTION
- name: hsearch_r
standards: GNUExtensions
standards: gnu
return_type: int
arguments:
- type: ENTRY
@ -49,20 +49,20 @@ functions:
- type: struct hsearch_data *
- name: insque
standards:
- POSIX
- posix
return_type: void
arguments:
- type: void *
- type: void *
- name: remque
standards:
- POSIX
- posix
return_type: void
arguments:
- type: void *
- name: lfind
standards:
- POSIX
- posix
return_type: void *
arguments:
- type: const void *
@ -72,7 +72,7 @@ functions:
- type: __search_compare_t
- name: lsearch
standards:
- POSIX
- posix
return_type: void *
arguments:
- type: const void *

View File

@ -1,16 +0,0 @@
//===-- C standard library header setjmp.h --------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_LIBC_SETJMP_H
#define LLVM_LIBC_SETJMP_H
#include "__llvm-libc-common.h"
%%public_api()
#endif // LLVM_LIBC_SETJMP_H

View File

@ -1,10 +1,8 @@
header: setjmp.h
header_template: setjmp.h.def
macros: []
standards:
- stdc
types:
- type_name: jmp_buf
enums: []
objects: []
functions:
- name: longjmp
standards:
@ -23,7 +21,7 @@ functions:
- type: jmp_buf
- name: sigsetjmp
standards:
- POSIX
- posix
return_type: int
attributes:
- _Returns_twice
@ -32,7 +30,7 @@ functions:
- type: int
- name: siglongjmp
standards:
- POSIX
- posix
return_type: _Noreturn void
arguments:
- type: sigjmp_buf

View File

@ -1,16 +0,0 @@
//===-- POSIX header spawn.h ----------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_LIBC_SPAWN_H
#define LLVM_LIBC_SPAWN_H
#include "__llvm-libc-common.h"
%%public_api()
#endif // LLVM_LIBC_SPAWN_H

View File

@ -1,17 +1,15 @@
header: spawn.h
header_template: spawn.h.def
macros: []
standards:
- posix
types:
- type_name: posix_spawn_file_actions_t
- type_name: posix_spawnattr_t
- type_name: pid_t
- type_name: mode_t
enums: []
objects: []
functions:
- name: posix_spawn
standards:
- POSIX
- posix
return_type: int
arguments:
- type: pid_t *__restrict
@ -22,14 +20,14 @@ functions:
- type: char * const * __restrict
- name: posix_spawn_file_actions_addclose
standards:
- POSIX
- posix
return_type: int
arguments:
- type: posix_spawn_file_actions_t *
- type: int
- name: posix_spawn_file_actions_adddup2
standards:
- POSIX
- posix
return_type: int
arguments:
- type: posix_spawn_file_actions_t *
@ -37,7 +35,7 @@ functions:
- type: int
- name: posix_spawn_file_actions_addopen
standards:
- POSIX
- posix
return_type: int
arguments:
- type: posix_spawn_file_actions_t *__restrict
@ -47,13 +45,13 @@ functions:
- type: mode_t
- name: posix_spawn_file_actions_destroy
standards:
- POSIX
- posix
return_type: int
arguments:
- type: posix_spawn_file_actions_t *
- name: posix_spawn_file_actions_init
standards:
- POSIX
- posix
return_type: int
arguments:
- type: posix_spawn_file_actions_t *

View File

@ -1,16 +0,0 @@
//===-- C standard library header string.h --------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_LIBC_STRING_H
#define LLVM_LIBC_STRING_H
#include "__llvm-libc-common.h"
%%public_api()
#endif // LLVM_LIBC_STRING_H

View File

@ -1,5 +1,6 @@
header: string.h
header_template: string.h.def
standards:
- stdc
macros:
- macro_name: NULL
macro_header: null-macro.h
@ -11,7 +12,7 @@ objects: []
functions:
- name: memccpy
standards:
- POSIX
- posix
return_type: void *
arguments:
- type: void *__restrict
@ -61,7 +62,7 @@ functions:
- type: size_t
- name: mempcpy
standards:
- POSIX
- posix
return_type: void *
arguments:
- type: void *__restrict
@ -93,14 +94,14 @@ functions:
- type: size_t
- name: stpcpy
standards:
- POSIX
- posix
return_type: char *
arguments:
- type: char *__restrict
- type: const char *__restrict
- name: stpncpy
standards:
- POSIX
- posix
return_type: char *
arguments:
- type: char *__restrict
@ -243,7 +244,7 @@ functions:
- type: size_t
- name: strnlen
standards:
- POSIX
- posix
return_type: size_t
arguments:
- type: const char *
@ -271,7 +272,7 @@ functions:
- type: const char *__restrict
- name: strsignal
standards:
- POSIX
- posix
return_type: char *
arguments:
- type: int
@ -298,7 +299,7 @@ functions:
- type: const char *__restrict
- name: strtok_r
standards:
- POSIX
- posix
return_type: char *
arguments:
- type: char *__restrict

View File

@ -1,16 +0,0 @@
//===-- C standard library header strings.h -------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_LIBC_STRINGS_H
#define LLVM_LIBC_STRINGS_H
#include "__llvm-libc-common.h"
%%public_api()
#endif // LLVM_LIBC_STRINGS_H

View File

@ -1,15 +1,14 @@
header: strings.h
header_template: strings.h.def
macros: []
standards:
- bsd
- posix
types:
- type_name: size_t
- type_name: locale_t
enums: []
objects: []
functions:
- name: bcmp
standards:
- llvm_libc_ext
- bsd
return_type: int
arguments:
- type: const void *
@ -17,7 +16,7 @@ functions:
- type: size_t
- name: bcopy
standards:
- llvm_libc_ext
- bsd
return_type: void
arguments:
- type: const void *
@ -25,69 +24,61 @@ functions:
- type: size_t
- name: bzero
standards:
- llvm_libc_ext
- bsd
return_type: void
arguments:
- type: void *
- type: size_t
- name: ffs
standards:
- POSIX
- posix
return_type: int
arguments:
- type: int
- name: ffsl
standards:
- POSIX
- posix
return_type: int
arguments:
- type: long
- name: ffsll
standards:
- POSIX
- posix
return_type: int
arguments:
- type: long long
- name: index
standards:
- BSDExtensions
- bsd
return_type: char *
arguments:
- type: const char *
- type: int
- name: rindex
standards:
- BSDExtensions
- bsd
return_type: char *
arguments:
- type: const char *
- type: int
- name: strcasecmp
standards:
- BSDExtensions
return_type: int
arguments:
- type: const char *
- type: const char *
- name: strcasecmp_l
standards:
- BSDExtensions
return_type: int
arguments:
- type: const char *
- type: const char *
- type: locale_t
- name: strncasecmp
standards:
- BSDExtensions
return_type: int
arguments:
- type: const char *
- type: const char *
- type: size_t
- name: strncasecmp_l
standards:
- BSDExtensions
return_type: int
arguments:
- type: const char *

View File

@ -1,16 +0,0 @@
//===-- Linux sys/sendfile.h ----------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_LIBC_SYS_SENDFILE_H
#define LLVM_LIBC_SYS_SENDFILE_H
#include "__llvm-libc-common.h"
%%public_api()
#endif // LLVM_LIBC_SYS_SENDFILE_H

View File

@ -1,16 +1,8 @@
header: sys/sendfile.h
header_template: sendfile.h.def
macros: []
types:
- type_name: ssize_t
- type_name: size_t
- type_name: off_t
enums: []
objects: []
standards:
- linux
functions:
- name: sendfile
standards:
- GNUExtensions
return_type: ssize_t
arguments:
- type: int

View File

@ -1,16 +0,0 @@
//===-- POSIX header statvfs.h --------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_LIBC_SYS_STATVFS_H
#define LLVM_LIBC_SYS_STATVFS_H
#include <__llvm-libc-common.h>
%%public_api()
#endif // LLVM_LIBC_SYS_STATVFS_H

View File

@ -1,23 +1,21 @@
header: sys/statvfs.h
header_template: statvfs.h.def
macros: []
standards:
- posix
types:
- type_name: struct_statvfs
- type_name: fsblkcnt_t
- type_name: fsfilcnt_t
enums: []
objects: []
functions:
- name: fstatvfs
standards:
- POSIX
- posix
return_type: int
arguments:
- type: int
- type: struct statvfs *
- name: statvfs
standards:
- POSIX
- posix
return_type: int
arguments:
- type: const char *__restrict

View File

@ -1,32 +1,28 @@
header: sys/types.h
header_template: types.h.def
standards: POSIX
macros: []
standards:
- posix
types:
- type_name: uid_t
- type_name: time_t
- type_name: pthread_t
- type_name: pthread_rwlock_t
- type_name: pthread_rwlockattr_t
- type_name: pthread_mutex_t
- type_name: blkcnt_t
- type_name: blksize_t
- type_name: clockid_t
- type_name: ssize_t
- type_name: pthread_mutexattr_t
- type_name: ino_t
- type_name: pthread_once_t
- type_name: mode_t
- type_name: dev_t
- type_name: pthread_attr_t
- type_name: gid_t
- type_name: pid_t
- type_name: ino_t
- type_name: mode_t
- type_name: nlink_t
- type_name: suseconds_t
- type_name: off_t
- type_name: size_t
- type_name: pthread_key_t
- type_name: pid_t
- type_name: pthread_attr_t
- type_name: pthread_condattr_t
enums: []
objects: []
functions: []
- type_name: pthread_key_t
- type_name: pthread_mutex_t
- type_name: pthread_mutexattr_t
- type_name: pthread_once_t
- type_name: pthread_rwlock_t
- type_name: pthread_rwlockattr_t
- type_name: pthread_t
- type_name: size_t
- type_name: ssize_t
- type_name: suseconds_t
- type_name: time_t
- type_name: uid_t

View File

@ -1,16 +0,0 @@
//===-- POSIX header uio.h ------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_LIBC_SYS_UIO_H
#define LLVM_LIBC_SYS_UIO_H
#include "__llvm-libc-common.h"
%%public_api()
#endif // LLVM_LIBC_SYS_UIO_H

View File

@ -1,15 +1,13 @@
header: sys/uio.h
header_template: uio.h.def
macros: []
standards:
- posix
types:
- type_name: struct_iovec
- type_name: ssize_t
enums: []
objects: []
functions:
- name: writev
standards:
- POSIX
- posix
return_type: ssize_t
arguments:
- type: int
@ -17,7 +15,7 @@ functions:
- type: int
- name: readv
standards:
- POSIX
- posix
return_type: ssize_t
arguments:
- type: int

View File

@ -1,16 +0,0 @@
//===-- Linux sys/utsname.h -----------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_LIBC_SYS_UTSNAME_H
#define LLVM_LIBC_SYS_UTSNAME_H
#include "__llvm-libc-common.h"
%%public_api()
#endif // LLVM_LIBC_SYS_UTSNAME_H

View File

@ -1,14 +1,12 @@
header: sys/utsname.h
header_template: utsname.h.def
macros: []
standards:
- posix
types:
- type_name: struct_utsname
enums: []
objects: []
functions:
- name: uname
standards:
- POSIX
- posix
return_type: int
arguments:
- type: struct utsname *

View File

@ -1,16 +0,0 @@
//===-- C standard library header threads.h -------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_LIBC_THREADS_H
#define LLVM_LIBC_THREADS_H
#include "__llvm-libc-common.h"
%%public_api()
#endif // LLVM_LIBC_THREADS_H

View File

@ -1,5 +1,6 @@
header: threads.h
header_template: threads.h.def
standards:
- stdc
macros:
- macro_name: ONCE_FLAG_INIT
macro_value: '{0}'

View File

@ -1,16 +0,0 @@
//===-- C standard library header uchar.h ---------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_LIBC_UCHAR_H
#define LLVM_LIBC_UCHAR_H
#include "__llvm-libc-common.h"
%%public_api()
#endif // LLVM_LIBC_UCHAR_H

View File

@ -1,14 +1,9 @@
header: uchar.h
header_template: uchar.h.def
standards:
- stdc
macros: []
types:
- type_name: char32_t
- type_name: char16_t
- type_name: char8_t
- type_name: mbstate_t
- type_name: size_t
enums: []
objects: []
functions: []