File tree Expand file tree Collapse file tree 14 files changed +97
-2
lines changed Expand file tree Collapse file tree 14 files changed +97
-2
lines changed Original file line number Diff line number Diff line change @@ -85,5 +85,10 @@ def TimeAPI : PublicAPI<"time.h"> {
85
85
}
86
86
87
87
def UCharAPI : PublicAPI<"uchar.h"> {
88
- let Types = ["mbstate_t"];
88
+ let Types = [
89
+ "mbstate_t",
90
+ "char8_t",
91
+ "char16_t",
92
+ "char32_t",
93
+ ];
89
94
}
Original file line number Diff line number Diff line change @@ -25,6 +25,8 @@ set(TARGET_PUBLIC_HEADERS
25
25
libc.include.threads
26
26
libc.include.time
27
27
libc.include.unistd
28
+ libc.include.wchar
29
+ libc.include.uchar
28
30
29
31
libc.include.sys_ioctl
30
32
# Disabled due to epoll_wait syscalls not being available on this platform.
Original file line number Diff line number Diff line change @@ -206,6 +206,15 @@ def WCharAPI : PublicAPI<"wchar.h"> {
206
206
];
207
207
}
208
208
209
+ def UCharAPI : PublicAPI<"uchar.h"> {
210
+ let Types = [
211
+ "mbstate_t",
212
+ "char8_t",
213
+ "char16_t",
214
+ "char32_t",
215
+ ];
216
+ }
217
+
209
218
def SysRandomAPI : PublicAPI<"sys/random.h"> {
210
219
let Types = ["size_t", "ssize_t"];
211
220
}
Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ set(TARGET_PUBLIC_HEADERS
12
12
libc.include.string
13
13
libc.include.strings
14
14
libc.include.search
15
+ libc.include.wchar
16
+ libc.include.uchar
15
17
16
18
# Disabled due to epoll_wait syscalls not being available on this platform.
17
19
# libc.include.sys_epoll
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ set(TARGET_PUBLIC_HEADERS
28
28
libc.include.time
29
29
libc.include.unistd
30
30
libc.include.wchar
31
+ libc.include.uchar
31
32
32
33
libc.include.arpa_inet
33
34
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ set(TARGET_PUBLIC_HEADERS
29
29
libc.include.time
30
30
libc.include.unistd
31
31
libc.include.wchar
32
+ libc.include.uchar
32
33
33
34
libc.include.arpa_inet
34
35
Original file line number Diff line number Diff line change @@ -158,4 +158,4 @@ Additions:
158
158
159
159
* mbrtoc8
160
160
* c8rtomb
161
- * char*_t
161
+ * char*_t | check |
Original file line number Diff line number Diff line change @@ -603,6 +603,9 @@ add_gen_header(
603
603
DEPENDS
604
604
.llvm_libc_common_h
605
605
.llvm-libc-types.mbstate_t
606
+ .llvm-libc-types.char8_t
607
+ .llvm-libc-types.char16_t
608
+ .llvm-libc-types.char32_t
606
609
)
607
610
608
611
add_gen_header (
Original file line number Diff line number Diff line change @@ -90,6 +90,21 @@ add_header(tcflag_t HDR tcflag_t.h)
90
90
add_header (struct_termios HDR struct_termios.h DEPENDS .cc_t .speed_t .tcflag_t )
91
91
add_header (__getoptargv_t HDR __getoptargv_t.h )
92
92
add_header (wchar_t HDR wchar_t.h )
93
+ add_header (char8_t HDR char8_t.h )
94
+ add_header (
95
+ char16_t
96
+ HDR
97
+ char16_t.h
98
+ DEPENDS
99
+ libc.include.llvm-libc-macros.stdint_macros
100
+ )
101
+ add_header (
102
+ char32_t
103
+ HDR
104
+ char32_t.h
105
+ DEPENDS
106
+ libc.include.llvm-libc-macros.stdint_macros
107
+ )
93
108
add_header (wint_t HDR wint_t.h )
94
109
add_header (sa_family_t HDR sa_family_t.h )
95
110
add_header (socklen_t HDR socklen_t.h )
Original file line number Diff line number Diff line change
1
+ //===-- Definition of char16_t type ---------------------------------------===//
2
+ //
3
+ // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
+ // See https://llvm.org/LICENSE.txt for license information.
5
+ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
+ //
7
+ //===----------------------------------------------------------------------===//
8
+
9
+ #ifndef LLVM_LIBC_TYPES_CHAR16_T_H
10
+ #define LLVM_LIBC_TYPES_CHAR16_T_H
11
+
12
+ #if defined(__STDC_VERSION__ ) && __STDC_VERSION__ >= 201112L
13
+ #include "../llvm-libc-macros/stdint-macros.h"
14
+ typedef uint_least16_t char16_t ;
15
+ #endif
16
+
17
+ #endif // LLVM_LIBC_TYPES_CHAR16_T_H
Original file line number Diff line number Diff line change
1
+ //===-- Definition of char32_t type ---------------------------------------===//
2
+ //
3
+ // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
+ // See https://llvm.org/LICENSE.txt for license information.
5
+ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
+ //
7
+ //===----------------------------------------------------------------------===//
8
+
9
+ #ifndef LLVM_LIBC_TYPES_CHAR32_T_H
10
+ #define LLVM_LIBC_TYPES_CHAR32_T_H
11
+
12
+ #if defined(__STDC_VERSION__ ) && __STDC_VERSION__ >= 201112L
13
+ #include "../llvm-libc-macros/stdint-macros.h"
14
+ typedef uint_least32_t char32_t ;
15
+ #endif
16
+
17
+ #endif // LLVM_LIBC_TYPES_CHAR32_T_H
Original file line number Diff line number Diff line change
1
+ //===-- Definition of char8_t type ----------------------------------------===//
2
+ //
3
+ // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
+ // See https://llvm.org/LICENSE.txt for license information.
5
+ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
+ //
7
+ //===----------------------------------------------------------------------===//
8
+
9
+ #ifndef LLVM_LIBC_TYPES_CHAR8_T_H
10
+ #define LLVM_LIBC_TYPES_CHAR8_T_H
11
+
12
+ #if !defined(__cplusplus ) && defined(__STDC_VERSION__ ) && \
13
+ __STDC_VERSION__ >= 202311L
14
+ typedef unsigned char char8_t ;
15
+ #endif
16
+
17
+ #endif // LLVM_LIBC_TYPES_CHAR8_T_H
Original file line number Diff line number Diff line change @@ -65,6 +65,9 @@ def SizeTType : NamedType<"size_t">;
65
65
def SizeTPtr : PtrType<SizeTType>;
66
66
def RestrictedSizeTPtr : RestrictedPtrType<SizeTType>;
67
67
68
+ def Char8TType : NamedType<"char8_t">;
69
+ def Char16TType : NamedType<"char16_t">;
70
+ def Char32TType : NamedType<"char32_t">;
68
71
def WCharType : NamedType<"wchar_t">;
69
72
def WIntType : NamedType<"wint_t">;
70
73
Original file line number Diff line number Diff line change @@ -1398,6 +1398,9 @@ def StdC : StandardSpec<"stdc"> {
1398
1398
[], // Macros
1399
1399
[ //Types
1400
1400
MBStateTType,
1401
+ Char8TType,
1402
+ Char16TType,
1403
+ Char32TType,
1401
1404
],
1402
1405
[], // Enumerations
1403
1406
[]
You can’t perform that action at this time.
0 commit comments