From cfd54a8f96a31e16514b2772ef6b52e7278d1fb1 Mon Sep 17 00:00:00 2001 From: alexprabhat99 Date: Mon, 27 Jan 2025 15:05:38 +0530 Subject: [PATCH 1/2] [libc] clean up duplicated includes in generated headers --- libc/include/locale.h.def | 2 -- libc/include/locale.yaml | 3 +++ libc/include/math.h.def | 1 - libc/include/setjmp.h.def | 1 - libc/include/stdlib.h.def | 1 - libc/include/stdlib.yaml | 1 + libc/include/string.h.def | 1 - libc/include/string.yaml | 1 + libc/include/wchar.h.def | 2 -- 9 files changed, 5 insertions(+), 8 deletions(-) diff --git a/libc/include/locale.h.def b/libc/include/locale.h.def index 516c6e6275e68..930373eade4d5 100644 --- a/libc/include/locale.h.def +++ b/libc/include/locale.h.def @@ -12,8 +12,6 @@ #include "__llvm-libc-common.h" #include "llvm-libc-macros/locale-macros.h" -#include "llvm-libc-types/locale_t.h" -#include "llvm-libc-types/struct_lconv.h" %%public_api() diff --git a/libc/include/locale.yaml b/libc/include/locale.yaml index 9ff53c16398a5..6c71b70e59f0b 100644 --- a/libc/include/locale.yaml +++ b/libc/include/locale.yaml @@ -1,5 +1,8 @@ header: locale.h header_template: locale.h.def +types: + - type_name: locale_t + - type_name: struct_lconv functions: - name: localeconv standards: diff --git a/libc/include/math.h.def b/libc/include/math.h.def index 9822d8bd7ba17..9cfc2f7ea084e 100644 --- a/libc/include/math.h.def +++ b/libc/include/math.h.def @@ -12,7 +12,6 @@ #include "__llvm-libc-common.h" #include "llvm-libc-macros/float16-macros.h" #include "llvm-libc-macros/math-macros.h" -#include "llvm-libc-types/float128.h" %%public_api() diff --git a/libc/include/setjmp.h.def b/libc/include/setjmp.h.def index cb083b8cd023e..670bc1ac0fe24 100644 --- a/libc/include/setjmp.h.def +++ b/libc/include/setjmp.h.def @@ -10,7 +10,6 @@ #define LLVM_LIBC_SETJMP_H #include "__llvm-libc-common.h" -#include "llvm-libc-types/jmp_buf.h" %%public_api() diff --git a/libc/include/stdlib.h.def b/libc/include/stdlib.h.def index 01b0e1a2395a2..d523f7a53024a 100644 --- a/libc/include/stdlib.h.def +++ b/libc/include/stdlib.h.def @@ -10,7 +10,6 @@ #define LLVM_LIBC_STDLIB_H #include "__llvm-libc-common.h" -#include "llvm-libc-types/locale_t.h" #include "llvm-libc-macros/stdlib-macros.h" %%public_api() diff --git a/libc/include/stdlib.yaml b/libc/include/stdlib.yaml index 4b68f272613b1..78a5d2f939c0e 100644 --- a/libc/include/stdlib.yaml +++ b/libc/include/stdlib.yaml @@ -12,6 +12,7 @@ types: - type_name: lldiv_t - type_name: ldiv_t - type_name: div_t + - type_name: locale_t enums: [] objects: [] functions: diff --git a/libc/include/string.h.def b/libc/include/string.h.def index e180f0d2561d3..1bd2687db2bea 100644 --- a/libc/include/string.h.def +++ b/libc/include/string.h.def @@ -11,7 +11,6 @@ #include "__llvm-libc-common.h" -#include "llvm-libc-types/locale_t.h" #include "llvm-libc-macros/null-macro.h" %%public_api() diff --git a/libc/include/string.yaml b/libc/include/string.yaml index deded309abc2c..68077b8aa9dc0 100644 --- a/libc/include/string.yaml +++ b/libc/include/string.yaml @@ -3,6 +3,7 @@ header_template: string.h.def macros: [] types: - type_name: size_t + - type_name: locale_t enums: [] objects: [] functions: diff --git a/libc/include/wchar.h.def b/libc/include/wchar.h.def index d0de1a6762a39..4c25de700d606 100644 --- a/libc/include/wchar.h.def +++ b/libc/include/wchar.h.def @@ -11,8 +11,6 @@ #include "__llvm-libc-common.h" #include "llvm-libc-macros/wchar-macros.h" -#include "llvm-libc-types/wint_t.h" -#include "llvm-libc-types/mbstate_t.h" %%public_api() From c834fb84efd27947fb74b6115dcc893573c408a5 Mon Sep 17 00:00:00 2001 From: alexprabhat99 Date: Mon, 27 Jan 2025 23:42:53 +0530 Subject: [PATCH 2/2] sort type_names alphabetically --- libc/include/stdlib.yaml | 6 +++--- libc/include/string.yaml | 2 +- libc/include/sys/time.h.def | 2 -- libc/include/sys/time.yaml | 3 ++- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/libc/include/stdlib.yaml b/libc/include/stdlib.yaml index 78a5d2f939c0e..c231a797bd445 100644 --- a/libc/include/stdlib.yaml +++ b/libc/include/stdlib.yaml @@ -8,11 +8,11 @@ types: - type_name: __qsortrcompare_t - type_name: __qsortcompare_t - type_name: __bsearchcompare_t - - type_name: size_t - - type_name: lldiv_t - - type_name: ldiv_t - type_name: div_t + - type_name: ldiv_t + - type_name: lldiv_t - type_name: locale_t + - type_name: size_t enums: [] objects: [] functions: diff --git a/libc/include/string.yaml b/libc/include/string.yaml index 68077b8aa9dc0..9f72b8db6c1eb 100644 --- a/libc/include/string.yaml +++ b/libc/include/string.yaml @@ -2,8 +2,8 @@ header: string.h header_template: string.h.def macros: [] types: - - type_name: size_t - type_name: locale_t + - type_name: size_t enums: [] objects: [] functions: diff --git a/libc/include/sys/time.h.def b/libc/include/sys/time.h.def index b37555e584957..8b7c9ec669b2f 100644 --- a/libc/include/sys/time.h.def +++ b/libc/include/sys/time.h.def @@ -11,8 +11,6 @@ #include "__llvm-libc-common.h" -#include "../llvm-libc-types/struct_timeval.h" - #include "../llvm-libc-macros/sys-time-macros.h" %%public_api() diff --git a/libc/include/sys/time.yaml b/libc/include/sys/time.yaml index 687c1f83028d0..ca497bbe92995 100644 --- a/libc/include/sys/time.yaml +++ b/libc/include/sys/time.yaml @@ -2,7 +2,8 @@ header: sys/time.h header_template: time.h.def standards: Linux macros: [] -types: [] +types: + - type_name: struct_timeval enums: [] functions: [] objects: []