diff --git a/libc/include/endian.h.def b/libc/include/endian.h.def deleted file mode 100644 index f331f08edc68..000000000000 --- a/libc/include/endian.h.def +++ /dev/null @@ -1,17 +0,0 @@ -//===-- POSIX header endian.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_ENDIAN_H -#define LLVM_LIBC_ENDIAN_H - -#include "__llvm-libc-common.h" -#include "llvm-libc-macros/endian-macros.h" - -%%public_api() - -#endif // LLVM_LIBC_ENDIAN_H diff --git a/libc/include/endian.yaml b/libc/include/endian.yaml index 6497f897b639..b50d4255c217 100644 --- a/libc/include/endian.yaml +++ b/libc/include/endian.yaml @@ -1,9 +1,41 @@ header: endian.h -header_template: endian.h.def standards: - - POSIX -macros: [] -types: [] + - posix +macros: + - macro_name: BYTE_ORDER + macro_header: endian-macros.h + - macro_name: LITTLE_ENDIAN + macro_header: endian-macros.h + - macro_name: BIG_ENDIAN + macro_header: endian-macros.h + - macro_name: be16toh + macro_header: endian-macros.h + - macro_name: be32toh + macro_header: endian-macros.h + - macro_name: be64toh + macro_header: endian-macros.h + - macro_name: htobe16 + macro_header: endian-macros.h + - macro_name: htobe32 + macro_header: endian-macros.h + - macro_name: htobe64 + macro_header: endian-macros.h + - macro_name: htole16 + macro_header: endian-macros.h + - macro_name: htole32 + macro_header: endian-macros.h + - macro_name: htole64 + macro_header: endian-macros.h + - macro_name: le16toh + macro_header: endian-macros.h + - macro_name: le32toh + macro_header: endian-macros.h + - macro_name: le64toh + macro_header: endian-macros.h +types: + - type_name: uint16_t + - type_name: uint32_t + - type_name: uint64_t enums: [] objects: [] functions: [] diff --git a/libc/include/features.h.def b/libc/include/features.h.def deleted file mode 100644 index 238b88d4b90f..000000000000 --- a/libc/include/features.h.def +++ /dev/null @@ -1,17 +0,0 @@ -//===-- C standard library header features.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_FEATURES_H -#define LLVM_LIBC_FEATURES_H - -#include "__llvm-libc-common.h" -#include "llvm-libc-macros/features-macros.h" - -%%public_api() - -#endif // LLVM_LIBC_FEATURES_H diff --git a/libc/include/features.yaml b/libc/include/features.yaml index 726320a40881..f5f17bf2a71f 100644 --- a/libc/include/features.yaml +++ b/libc/include/features.yaml @@ -1,7 +1,6 @@ header: features.h -header_template: features.h.def standards: - - stdc + - gnu macros: [] types: [] enums: [] diff --git a/libc/include/float.h.def b/libc/include/float.h.def deleted file mode 100644 index 3bcd7f5e3f98..000000000000 --- a/libc/include/float.h.def +++ /dev/null @@ -1,14 +0,0 @@ -//===-- C standard library header float.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_FLOAT_H -#define LLVM_LIBC_FLOAT_H - -#include "llvm-libc-macros/float-macros.h" - -#endif // LLVM_LIBC_FLOAT_H diff --git a/libc/include/float.yaml b/libc/include/float.yaml index 21df6513e77e..0829c3bb18c8 100644 --- a/libc/include/float.yaml +++ b/libc/include/float.yaml @@ -1,8 +1,87 @@ header: float.h -header_template: float.h.def standards: - stdc -macros: [] +macros: + - macro_name: FLT_RADIX + macro_header: float-macros.h + - macro_name: FLT_EVAL_METHOD + macro_header: float-macros.h + - macro_name: FLT_ROUNDS + macro_header: float-macros.h + - macro_name: FLT_DECIMAL_DIG + macro_header: float-macros.h + - macro_name: DBL_DECIMAL_DIG + macro_header: float-macros.h + - macro_name: LDBL_DECIMAL_DIG + macro_header: float-macros.h + - macro_name: DECIMAL_DIG + macro_header: float-macros.h + - macro_name: FLT_DIG + macro_header: float-macros.h + - macro_name: DBL_DIG + macro_header: float-macros.h + - macro_name: LDBL_DIG + macro_header: float-macros.h + - macro_name: FLT_MANT_DIG + macro_header: float-macros.h + - macro_name: DBL_MANT_DIG + macro_header: float-macros.h + - macro_name: LDBL_MANT_DIG + macro_header: float-macros.h + - macro_name: FLT_MIN + macro_header: float-macros.h + - macro_name: DBL_MIN + macro_header: float-macros.h + - macro_name: LDBL_MIN + macro_header: float-macros.h + - macro_name: FLT_MAX + macro_header: float-macros.h + - macro_name: DBL_MAX + macro_header: float-macros.h + - macro_name: LDBL_MAX + macro_header: float-macros.h + - macro_name: FLT_TRUE_MIN + macro_header: float-macros.h + - macro_name: DBL_TRUE_MIN + macro_header: float-macros.h + - macro_name: LDBL_TRUE_MIN + macro_header: float-macros.h + - macro_name: FLT_EPSILON + macro_header: float-macros.h + - macro_name: DBL_EPSILON + macro_header: float-macros.h + - macro_name: LDBL_EPSILON + macro_header: float-macros.h + - macro_name: FLT_MIN_EXP + macro_header: float-macros.h + - macro_name: DBL_MIN_EXP + macro_header: float-macros.h + - macro_name: LDBL_MIN_EXP + macro_header: float-macros.h + - macro_name: FLT_MIN_10_EXP + macro_header: float-macros.h + - macro_name: DBL_MIN_10_EXP + macro_header: float-macros.h + - macro_name: LDBL_MIN_10_EXP + macro_header: float-macros.h + - macro_name: FLT_MAX_EXP + macro_header: float-macros.h + - macro_name: DBL_MAX_EXP + macro_header: float-macros.h + - macro_name: LDBL_MAX_EXP + macro_header: float-macros.h + - macro_name: FLT_MAX_10_EXP + macro_header: float-macros.h + - macro_name: DBL_MAX_10_EXP + macro_header: float-macros.h + - macro_name: LDBL_MAX_10_EXP + macro_header: float-macros.h + - macro_name: FLT_HAS_SUBNORM + macro_header: float-macros.h + - macro_name: DBL_HAS_SUBNORM + macro_header: float-macros.h + - macro_name: LDBL_HAS_SUBNORM + macro_header: float-macros.h types: [] enums: [] objects: [] diff --git a/libc/include/stdckdint.h.def b/libc/include/stdckdint.h.def deleted file mode 100644 index d4a9d829a3c9..000000000000 --- a/libc/include/stdckdint.h.def +++ /dev/null @@ -1,18 +0,0 @@ -//===-- C standard library header stdckdint.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_STDCKDINT_H -#define LLVM_LIBC_STDCKDINT_H - -#include "__llvm-libc-common.h" - -%%public_api() - -#include "llvm-libc-macros/stdckdint-macros.h" - -#endif // LLVM_LIBC_STDCKDINT_H diff --git a/libc/include/stdckdint.yaml b/libc/include/stdckdint.yaml index e8b2e80ee029..67fb1d53a650 100644 --- a/libc/include/stdckdint.yaml +++ b/libc/include/stdckdint.yaml @@ -1,8 +1,13 @@ header: stdckdint.h -header_template: stdckdint.h.def standards: - stdc -macros: [] +macros: + - macro_name: ckd_add + macro_header: stdckdint-macros.h + - macro_name: ckd_sub + macro_header: stdckdint-macros.h + - macro_name: ckd_mul + macro_header: stdckdint-macros.h types: [] enums: [] objects: [] diff --git a/libc/include/stdint.h.def b/libc/include/stdint.h.def deleted file mode 100644 index d7660860c91f..000000000000 --- a/libc/include/stdint.h.def +++ /dev/null @@ -1,14 +0,0 @@ -//===-- C standard library header stdint.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_STDINT_H -#define LLVM_LIBC_STDINT_H - -#include "llvm-libc-macros/stdint-macros.h" - -#endif // LLVM_LIBC_STDINT_H diff --git a/libc/include/stdint.yaml b/libc/include/stdint.yaml index d583a104af37..26c8142805ff 100644 --- a/libc/include/stdint.yaml +++ b/libc/include/stdint.yaml @@ -1,8 +1,129 @@ header: stdint.h -header_template: stdint.h.def standards: - stdc -macros: [] +macros: + - macro_name: INT8_MAX + macro_header: stdint-macros.h + - macro_name: INT16_MAX + macro_header: stdint-macros.h + - macro_name: INT32_MAX + macro_header: stdint-macros.h + - macro_name: INT64_MAX + macro_header: stdint-macros.h + - macro_name: INT8_MIN + macro_header: stdint-macros.h + - macro_name: INT16_MIN + macro_header: stdint-macros.h + - macro_name: INT32_MIN + macro_header: stdint-macros.h + - macro_name: INT64_MIN + macro_header: stdint-macros.h + - macro_name: UINT8_MAX + macro_header: stdint-macros.h + - macro_name: UINT16_MAX + macro_header: stdint-macros.h + - macro_name: UINT32_MAX + macro_header: stdint-macros.h + - macro_name: UINT64_MAX + macro_header: stdint-macros.h + - macro_name: INT_LEAST8_MAX + macro_header: stdint-macros.h + - macro_name: INT_LEAST16_MAX + macro_header: stdint-macros.h + - macro_name: INT_LEAST32_MAX + macro_header: stdint-macros.h + - macro_name: INT_LEAST64_MAX + macro_header: stdint-macros.h + - macro_name: INT_LEAST8_MIN + macro_header: stdint-macros.h + - macro_name: INT_LEAST16_MIN + macro_header: stdint-macros.h + - macro_name: INT_LEAST32_MIN + macro_header: stdint-macros.h + - macro_name: INT_LEAST64_MIN + macro_header: stdint-macros.h + - macro_name: UINT_LEAST8_MAX + macro_header: stdint-macros.h + - macro_name: UINT_LEAST16_MAX + macro_header: stdint-macros.h + - macro_name: UINT_LEAST32_MAX + macro_header: stdint-macros.h + - macro_name: UINT_LEAST64_MAX + macro_header: stdint-macros.h + - macro_name: INT_FAST8_MAX + macro_header: stdint-macros.h + - macro_name: INT_FAST16_MAX + macro_header: stdint-macros.h + - macro_name: INT_FAST32_MAX + macro_header: stdint-macros.h + - macro_name: INT_FAST64_MAX + macro_header: stdint-macros.h + - macro_name: INT_FAST8_MIN + macro_header: stdint-macros.h + - macro_name: INT_FAST16_MIN + macro_header: stdint-macros.h + - macro_name: INT_FAST32_MIN + macro_header: stdint-macros.h + - macro_name: INT_FAST64_MIN + macro_header: stdint-macros.h + - macro_name: UINT_FAST8_MAX + macro_header: stdint-macros.h + - macro_name: UINT_FAST16_MAX + macro_header: stdint-macros.h + - macro_name: UINT_FAST32_MAX + macro_header: stdint-macros.h + - macro_name: UINT_FAST64_MAX + macro_header: stdint-macros.h + - macro_name: INTPTR_MAX + macro_header: stdint-macros.h + - macro_name: INTPTR_MIN + macro_header: stdint-macros.h + - macro_name: UINTPTR_MAX + macro_header: stdint-macros.h + - macro_name: INTMAX_MAX + macro_header: stdint-macros.h + - macro_name: INTMAX_MIN + macro_header: stdint-macros.h + - macro_name: UINTMAX_MAX + macro_header: stdint-macros.h + - macro_name: PTRDIFF_MAX + macro_header: stdint-macros.h + - macro_name: PTRDIFF_MIN + macro_header: stdint-macros.h + - macro_name: SIG_ATOMIC_MAX + macro_header: stdint-macros.h + - macro_name: SIG_ATOMIC_MIN + macro_header: stdint-macros.h + - macro_name: SIZE_MAX + macro_header: stdint-macros.h + - macro_name: WCHAR_MAX + macro_header: stdint-macros.h + - macro_name: WCHAR_MIN + macro_header: stdint-macros.h + - macro_name: WINT_MAX + macro_header: stdint-macros.h + - macro_name: WINT_MIN + macro_header: stdint-macros.h + - macro_name: INT8_C + macro_header: stdint-macros.h + - macro_name: INT16_C + macro_header: stdint-macros.h + - macro_name: INT32_C + macro_header: stdint-macros.h + - macro_name: INT64_C + macro_header: stdint-macros.h + - macro_name: UINT8_C + macro_header: stdint-macros.h + - macro_name: UINT16_C + macro_header: stdint-macros.h + - macro_name: UINT32_C + macro_header: stdint-macros.h + - macro_name: UINT64_C + macro_header: stdint-macros.h + - macro_name: INTMAX_C + macro_header: stdint-macros.h + - macro_name: UINTMAX_C + macro_header: stdint-macros.h types: [] enums: [] objects: [] diff --git a/libc/include/sys/auxv.h.def b/libc/include/sys/auxv.h.def deleted file mode 100644 index d790160e9031..000000000000 --- a/libc/include/sys/auxv.h.def +++ /dev/null @@ -1,18 +0,0 @@ -//===-- GNU header auxv.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_AUXV_H -#define LLVM_LIBC_SYS_AUXV_H - -#include "__llvm-libc-common.h" - -#include "../llvm-libc-macros/sys-auxv-macros.h" - -%%public_api() - -#endif // LLVM_LIBC_SYS_AUXV_H diff --git a/libc/include/sys/auxv.yaml b/libc/include/sys/auxv.yaml index 82ecee75c40a..0c515d0d2e09 100644 --- a/libc/include/sys/auxv.yaml +++ b/libc/include/sys/auxv.yaml @@ -1,13 +1,14 @@ header: sys/auxv.h -header_template: auxv.h.def -macros: [] +standards: + - gnu +macros: + - macro_name: AT_NULL + macro_header: sys-auxv-macros.h types: [] enums: [] objects: [] functions: - name: getauxval - standards: - - GNUExtensions return_type: unsigned long arguments: - type: unsigned long diff --git a/libc/include/sys/epoll.h.def b/libc/include/sys/epoll.h.def deleted file mode 100644 index 2240fe46f2af..000000000000 --- a/libc/include/sys/epoll.h.def +++ /dev/null @@ -1,18 +0,0 @@ -//===-- Linux header epoll.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_EPOLL_H -#define LLVM_LIBC_SYS_EPOLL_H - -#include "__llvm-libc-common.h" - -#include "../llvm-libc-macros/sys-epoll-macros.h" - -%%public_api() - -#endif // LLVM_LIBC_SYS_EPOLL_H diff --git a/libc/include/sys/epoll.yaml b/libc/include/sys/epoll.yaml index 996eb785bc71..aaf3354e645d 100644 --- a/libc/include/sys/epoll.yaml +++ b/libc/include/sys/epoll.yaml @@ -1,6 +1,9 @@ header: sys/epoll.h -header_template: epoll.h.def -macros: [] +standards: + - linux +macros: + - macro_name: EPOLLIN + macro_header: sys-epoll-macros.h types: - type_name: struct_epoll_event - type_name: struct_epoll_data @@ -10,20 +13,14 @@ enums: [] objects: [] functions: - name: epoll_create - standards: - - Linux return_type: int arguments: - type: int - name: epoll_create1 - standards: - - Linux return_type: int arguments: - type: int - name: epoll_ctl - standards: - - Linux return_type: int arguments: - type: int @@ -31,8 +28,6 @@ functions: - type: int - type: struct epoll_event * - name: epoll_pwait - standards: - - Linux return_type: int arguments: - type: int @@ -41,8 +36,6 @@ functions: - type: int - type: const sigset_t * - name: epoll_pwait2 - standards: - - Linux return_type: int arguments: - type: int @@ -51,8 +44,6 @@ functions: - type: const struct timespec * - type: const sigset_t * - name: epoll_wait - standards: - - Linux return_type: int arguments: - type: int diff --git a/libc/include/sys/ioctl.h.def b/libc/include/sys/ioctl.h.def deleted file mode 100644 index 133efcdca06b..000000000000 --- a/libc/include/sys/ioctl.h.def +++ /dev/null @@ -1,18 +0,0 @@ -//===-- POSIX header ioctl.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_IOCTL_H -#define LLVM_LIBC_SYS_IOCTL_H - -#include "__llvm-libc-common.h" - -#include "../llvm-libc-macros/sys-ioctl-macros.h" - -%%public_api() - -#endif // LLVM_LIBC_SYS_IOCTL_H diff --git a/libc/include/sys/ioctl.yaml b/libc/include/sys/ioctl.yaml index 7eb66b657664..1757e47663d7 100644 --- a/libc/include/sys/ioctl.yaml +++ b/libc/include/sys/ioctl.yaml @@ -1,14 +1,14 @@ header: sys/ioctl.h -header_template: ioctl.h.def -standards: POSIX -macros: [] +standards: + - linux +macros: + - macro_name: FIONREAD + macro_header: sys-ioctl-macros.h types: [] enums: [] objects: [] functions: - name: ioctl - standards: - - Linux return_type: int arguments: - type: int diff --git a/libc/include/sys/mman.h.def b/libc/include/sys/mman.h.def deleted file mode 100644 index 55f5cb68a200..000000000000 --- a/libc/include/sys/mman.h.def +++ /dev/null @@ -1,18 +0,0 @@ -//===-- POSIX header mman.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_MMAN_H -#define LLVM_LIBC_SYS_MMAN_H - -#include "__llvm-libc-common.h" - -#include "../llvm-libc-macros/sys-mman-macros.h" - -%%public_api() - -#endif // LLVM_LIBC_SYS_MMAN_H diff --git a/libc/include/sys/mman.yaml b/libc/include/sys/mman.yaml index f9ab0c1001c3..6adc2c2d5bfa 100644 --- a/libc/include/sys/mman.yaml +++ b/libc/include/sys/mman.yaml @@ -1,6 +1,9 @@ header: sys/mman.h -header_template: mman.h.def -macros: [] +standards: + - posix +macros: + - macro_name: MAP_FAILED + macro_header: sys-mman-macros.h types: - type_name: mode_t - type_name: size_t diff --git a/libc/include/sys/random.h.def b/libc/include/sys/random.h.def deleted file mode 100644 index 456048f1a818..000000000000 --- a/libc/include/sys/random.h.def +++ /dev/null @@ -1,18 +0,0 @@ -//===-- Linux sys/random.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_RANDOM_H -#define LLVM_LIBC_SYS_RANDOM_H - -#include "__llvm-libc-common.h" - -#include "../llvm-libc-macros/sys-random-macros.h" - -%%public_api() - -#endif // LLVM_LIBC_SYS_RANDOM_H diff --git a/libc/include/sys/random.yaml b/libc/include/sys/random.yaml index a97266a5481d..c57a6fe7ccc7 100644 --- a/libc/include/sys/random.yaml +++ b/libc/include/sys/random.yaml @@ -1,6 +1,9 @@ header: sys/random.h -header_template: random.h.def -macros: [] +standards: + - linux +macros: + - macro_name: GRND_RANDOM + macro_header: sys-random-macros.h types: - type_name: ssize_t - type_name: size_t @@ -8,8 +11,6 @@ enums: [] objects: [] functions: - name: getrandom - standards: - - Linux return_type: ssize_t arguments: - type: void * @@ -17,7 +18,7 @@ functions: - type: unsigned int - name: getentropy standards: - - GNUExtensions + - gnu return_type: int arguments: - type: void * diff --git a/libc/include/sys/resource.h.def b/libc/include/sys/resource.h.def deleted file mode 100644 index 119c47971fb9..000000000000 --- a/libc/include/sys/resource.h.def +++ /dev/null @@ -1,18 +0,0 @@ -//===-- POSIX header resource.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_RESOURCE_H -#define LLVM_LIBC_SYS_RESOURCE_H - -#include "__llvm-libc-common.h" - -#include "../llvm-libc-macros/sys-resource-macros.h" - -%%public_api() - -#endif // LLVM_LIBC_SYS_RESOURCE_H diff --git a/libc/include/sys/resource.yaml b/libc/include/sys/resource.yaml index e7645a3b4f0b..636cb0c59f8a 100644 --- a/libc/include/sys/resource.yaml +++ b/libc/include/sys/resource.yaml @@ -1,6 +1,9 @@ header: sys/resource.h -header_template: resource.h.def -macros: [] +standards: + - posix +macros: + - macro_name: RLIMIT_CPU + macro_header: sys-resource-macros.h types: - type_name: struct_rlimit - type_name: rlim_t diff --git a/libc/include/sys/select.h.def b/libc/include/sys/select.h.def deleted file mode 100644 index c9bf382b676a..000000000000 --- a/libc/include/sys/select.h.def +++ /dev/null @@ -1,18 +0,0 @@ -//===-- Linux sys/select.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_SELECT_H -#define LLVM_LIBC_SYS_SELECT_H - -#include "__llvm-libc-common.h" - -#include "../llvm-libc-macros/sys-select-macros.h" - -%%public_api() - -#endif // LLVM_LIBC_SYS_SELECT_H diff --git a/libc/include/sys/select.yaml b/libc/include/sys/select.yaml index 6066fd341f07..58fdb2a879a1 100644 --- a/libc/include/sys/select.yaml +++ b/libc/include/sys/select.yaml @@ -1,6 +1,9 @@ header: sys/select.h -header_template: select.h.def -macros: [] +standards: + - posix +macros: + - macro_name: FD_SETSIZE + macro_header: sys-select-macros.h types: - type_name: struct_timeval - type_name: struct_timespec diff --git a/libc/include/sys/socket.h.def b/libc/include/sys/socket.h.def deleted file mode 100644 index 54efa1ed4b2e..000000000000 --- a/libc/include/sys/socket.h.def +++ /dev/null @@ -1,18 +0,0 @@ -//===-- POSIX header sys/socket.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_SOCKET_H -#define LLVM_LIBC_SYS_SOCKET_H - -#include "__llvm-libc-common.h" - -#include "../llvm-libc-macros/sys-socket-macros.h" - -%%public_api() - -#endif // LLVM_LIBC_SYS_SOCKET_H diff --git a/libc/include/sys/socket.yaml b/libc/include/sys/socket.yaml index 1be7190fe795..bb850de15846 100644 --- a/libc/include/sys/socket.yaml +++ b/libc/include/sys/socket.yaml @@ -1,6 +1,9 @@ header: sys/socket.h -header_template: socket.h.def -macros: [] +standards: + - posix +macros: + - macro_name: AF_UNSPEC + macro_header: sys-socket-macros.h types: - type_name: struct_sockaddr - type_name: socklen_t diff --git a/libc/include/sys/stat.h.def b/libc/include/sys/stat.h.def deleted file mode 100644 index 4a7d7a02ef0d..000000000000 --- a/libc/include/sys/stat.h.def +++ /dev/null @@ -1,18 +0,0 @@ -//===-- POSIX header stat.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_STAT_H -#define LLVM_LIBC_SYS_STAT_H - -#include "__llvm-libc-common.h" - -#include "../llvm-libc-macros/sys-stat-macros.h" - -%%public_api() - -#endif // LLVM_LIBC_SYS_STAT_H diff --git a/libc/include/sys/stat.yaml b/libc/include/sys/stat.yaml index 9017e19266e3..5c033f621f16 100644 --- a/libc/include/sys/stat.yaml +++ b/libc/include/sys/stat.yaml @@ -1,6 +1,9 @@ header: sys/stat.h -header_template: stat.h.def -macros: [] +standards: + - posix +macros: + - macro_name: S_IFMT + macro_header: sys-stat-macros.h types: - type_name: blkcnt_t - type_name: blksize_t @@ -18,22 +21,16 @@ enums: [] objects: [] functions: - name: chmod - standards: - - POSIX return_type: int arguments: - type: const char * - type: mode_t - name: fchmod - standards: - - POSIX return_type: int arguments: - type: int - type: mode_t - name: fchmodat - standards: - - POSIX return_type: int arguments: - type: int @@ -41,44 +38,32 @@ functions: - type: mode_t - type: int - name: fstat - standards: - - POSIX return_type: int arguments: - type: int - type: struct stat * - name: lstat - standards: - - POSIX return_type: int arguments: - type: const char *__restrict - type: struct stat *__restrict - name: mkdir - standards: - - POSIX return_type: int arguments: - type: const char * - type: mode_t - name: mkdirat - standards: - - POSIX return_type: int arguments: - type: int - type: const char * - type: mode_t - name: stat - standards: - - POSIX return_type: int arguments: - type: const char *__restrict - type: struct stat *__restrict - name: utimensat - standards: - - POSIX return_type: int arguments: - type: int diff --git a/libc/include/sys/time.h.def b/libc/include/sys/time.h.def deleted file mode 100644 index 8b7c9ec669b2..000000000000 --- a/libc/include/sys/time.h.def +++ /dev/null @@ -1,18 +0,0 @@ -//===-- Linux header time.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_TIME_H -#define LLVM_LIBC_SYS_TIME_H - -#include "__llvm-libc-common.h" - -#include "../llvm-libc-macros/sys-time-macros.h" - -%%public_api() - -#endif // LLVM_LIBC_SYS_TIME_H diff --git a/libc/include/sys/time.yaml b/libc/include/sys/time.yaml index ed6b94228df7..f1dcdff35465 100644 --- a/libc/include/sys/time.yaml +++ b/libc/include/sys/time.yaml @@ -1,7 +1,9 @@ header: sys/time.h -header_template: time.h.def -standards: Linux -macros: [] +standards: + - posix +macros: + - macro_name: timeradd + macro_header: sys-time-macros.h types: - type_name: struct_timeval - type_name: struct_itimerval @@ -15,8 +17,6 @@ functions: - type: const struct timeval* - name: setitimer - standards: - - POSIX return_type: int arguments: - type: int @@ -24,8 +24,6 @@ functions: - type: struct itimerval *__restrict - name: getitimer - standards: - - POSIX return_type: int arguments: - type: int diff --git a/libc/include/sys/types.h.def b/libc/include/sys/types.h.def deleted file mode 100644 index f5c3bb2c928b..000000000000 --- a/libc/include/sys/types.h.def +++ /dev/null @@ -1,16 +0,0 @@ -//===-- Header for sys/types.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_TYPES_H -#define LLVM_LIBC_SYS_TYPES_H - -#include "__llvm-libc-common.h" - -%%public_api() - -#endif // LLVM_LIBC_SYS_TYPES_H diff --git a/libc/include/sys/wait.h.def b/libc/include/sys/wait.h.def deleted file mode 100644 index 8acf563ebe09..000000000000 --- a/libc/include/sys/wait.h.def +++ /dev/null @@ -1,18 +0,0 @@ -//===-- POSIX header wait.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_WAIT_H -#define LLVM_LIBC_SYS_WAIT_H - -#include "__llvm-libc-common.h" - -#include "../llvm-libc-macros/sys-wait-macros.h" - -%%public_api() - -#endif // LLVM_LIBC_SYS_WAIT_H diff --git a/libc/include/sys/wait.yaml b/libc/include/sys/wait.yaml index 6257e34b9e08..92bd2ef17be4 100644 --- a/libc/include/sys/wait.yaml +++ b/libc/include/sys/wait.yaml @@ -1,6 +1,9 @@ header: sys/wait.h -header_template: wait.h.def -macros: [] +standards: + - posix +macros: + - macro_name: WCOREDUMP + macro_header: sys-wait-macros.h types: - type_name: siginfo_t - type_name: struct_rusage diff --git a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel index b57b60490e57..29792cec1149 100644 --- a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel @@ -128,10 +128,6 @@ LLVM_LIBC_HEADERS = [ "elf", has_def_template = True, ), - libc_header_info( - "endian", - has_def_template = True, - ), libc_header_info( "errno", has_def_template = True, @@ -140,14 +136,6 @@ LLVM_LIBC_HEADERS = [ "fcntl", has_def_template = True, ), - libc_header_info( - "features", - has_def_template = True, - ), - libc_header_info( - "float", - has_def_template = True, - ), libc_header_info( "inttypes", has_def_template = True, @@ -180,18 +168,10 @@ LLVM_LIBC_HEADERS = [ "stdbit", has_def_template = True, ), - libc_header_info( - "stdckdint", - has_def_template = True, - ), libc_header_info( "stdfix", has_def_template = True, ), - libc_header_info( - "stdint", - has_def_template = True, - ), libc_header_info( "stdio", has_def_template = True, @@ -200,62 +180,14 @@ LLVM_LIBC_HEADERS = [ "sysexits", has_def_template = True, ), - libc_header_info( - "sys/auxv", - has_def_template = True, - ), - libc_header_info( - "sys/epoll", - has_def_template = True, - ), - libc_header_info( - "sys/ioctl", - has_def_template = True, - ), - libc_header_info( - "sys/mman", - has_def_template = True, - ), libc_header_info( "sys/prctl", has_def_template = True, ), - libc_header_info( - "sys/random", - has_def_template = True, - ), - libc_header_info( - "sys/resource", - has_def_template = True, - ), - libc_header_info( - "sys/select", - has_def_template = True, - ), - libc_header_info( - "sys/socket", - has_def_template = True, - ), - libc_header_info( - "sys/stat", - has_def_template = True, - ), libc_header_info( "sys/syscall", has_def_template = True, ), - libc_header_info( - "sys/time", - has_def_template = True, - ), - libc_header_info( - "sys/types", - has_def_template = True, - ), - libc_header_info( - "sys/wait", - has_def_template = True, - ), libc_header_info( "termios", has_def_template = True, @@ -267,7 +199,10 @@ LLVM_LIBC_HEADERS = [ libc_header_info("ctype"), libc_header_info("dirent"), libc_header_info("dlfcn"), + libc_header_info("endian"), + libc_header_info("features"), libc_header_info("fenv"), + libc_header_info("float"), libc_header_info("limits"), libc_header_info("locale"), libc_header_info("nl_types"), @@ -275,11 +210,25 @@ LLVM_LIBC_HEADERS = [ libc_header_info("search"), libc_header_info("setjmp"), libc_header_info("spawn"), + libc_header_info("stdckdint"), + libc_header_info("stdint"), libc_header_info("string"), libc_header_info("strings"), + libc_header_info("sys/auxv"), + libc_header_info("sys/epoll"), + libc_header_info("sys/ioctl"), libc_header_info("sys/ipc"), + libc_header_info("sys/mman"), + libc_header_info("sys/random"), + libc_header_info("sys/resource"), + libc_header_info("sys/select"), + libc_header_info("sys/socket"), + libc_header_info("sys/stat"), libc_header_info("sys/statvfs"), + libc_header_info("sys/time"), + libc_header_info("sys/types"), libc_header_info("sys/utsname"), + libc_header_info("sys/wait"), libc_header_info("threads"), libc_header_info("time"), libc_header_info("uchar"),