102 changes: 2 additions & 100 deletions libc/newhdrgen/yaml/ctype.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
header: ctype.h
macros: []
types:
- type_name: locale_t
types: []
enums: []
objects: []
functions:
Expand Down Expand Up @@ -101,101 +100,4 @@ functions:
return_type: int
arguments:
- type: int
- name: isalnum_l
standards:
- stdc
return_type: int
arguments:
- type: int
- type: locale_t
- name: isalpha_l
standards:
- stdc
return_type: int
arguments:
- type: int
- type: locale_t
- name: isblank_l
standards:
- stdc
return_type: int
arguments:
- type: int
- type: locale_t
- name: iscntrl_l
standards:
- stdc
return_type: int
arguments:
- type: int
- type: locale_t
- name: isdigit_l
standards:
- stdc
return_type: int
arguments:
- type: int
- type: locale_t
- name: isgraph_l
standards:
- stdc
return_type: int
arguments:
- type: int
- type: locale_t
- name: islower_l
standards:
- stdc
return_type: int
arguments:
- type: int
- type: locale_t
- name: isprint_l
standards:
- stdc
return_type: int
arguments:
- type: int
- type: locale_t
- name: ispunct_l
standards:
- stdc
return_type: int
arguments:
- type: int
- type: locale_t
- name: isspace_l
standards:
- stdc
return_type: int
arguments:
- type: int
- type: locale_t
- name: isupper_l
standards:
- stdc
return_type: int
arguments:
- type: int
- type: locale_t
- name: isxdigit_l
standards:
- stdc
return_type: int
arguments:
- type: int
- type: locale_t
- name: tolower_l
standards:
- stdc
return_type: int
arguments:
- type: int
- type: locale_t
- name: toupper_l
standards:
- stdc
return_type: int
arguments:
- type: int
- type: locale_t
functions: null
41 changes: 0 additions & 41 deletions libc/newhdrgen/yaml/locale.yaml

This file was deleted.

131 changes: 1 addition & 130 deletions libc/spec/stdc.td
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ def StdC : StandardSpec<"stdc"> {
PtrType StructTmPtr = PtrType<StructTmType>;
PtrType TimeTTypePtr = PtrType<TimeTType>;
NamedType ClockT = NamedType<"clock_t">;
NamedType LocaleT = NamedType<"locale_t">;

NamedType DivTType = NamedType<"div_t">;
NamedType LDivTType = NamedType<"ldiv_t">;
Expand Down Expand Up @@ -35,9 +34,7 @@ def StdC : StandardSpec<"stdc"> {
HeaderSpec CType = HeaderSpec<
"ctype.h",
[], // Macros
[
LocaleT
], // Types
[], // Types
[], // Enumerations
[
FunctionSpec<
Expand Down Expand Up @@ -110,76 +107,6 @@ def StdC : StandardSpec<"stdc"> {
RetValSpec<IntType>,
[ArgSpec<IntType>]
>,
FunctionSpec<
"isalnum_l",
RetValSpec<IntType>,
[ArgSpec<IntType>, ArgSpec<LocaleT>]
>,
FunctionSpec<
"isalpha_l",
RetValSpec<IntType>,
[ArgSpec<IntType>, ArgSpec<LocaleT>]
>,
FunctionSpec<
"isblank_l",
RetValSpec<IntType>,
[ArgSpec<IntType>, ArgSpec<LocaleT>]
>,
FunctionSpec<
"iscntrl_l",
RetValSpec<IntType>,
[ArgSpec<IntType>, ArgSpec<LocaleT>]
>,
FunctionSpec<
"isdigit_l",
RetValSpec<IntType>,
[ArgSpec<IntType>, ArgSpec<LocaleT>]
>,
FunctionSpec<
"isgraph_l",
RetValSpec<IntType>,
[ArgSpec<IntType>, ArgSpec<LocaleT>]
>,
FunctionSpec<
"islower_l",
RetValSpec<IntType>,
[ArgSpec<IntType>, ArgSpec<LocaleT>]
>,
FunctionSpec<
"isprint_l",
RetValSpec<IntType>,
[ArgSpec<IntType>, ArgSpec<LocaleT>]
>,
FunctionSpec<
"ispunct_l",
RetValSpec<IntType>,
[ArgSpec<IntType>, ArgSpec<LocaleT>]
>,
FunctionSpec<
"isspace_l",
RetValSpec<IntType>,
[ArgSpec<IntType>, ArgSpec<LocaleT>]
>,
FunctionSpec<
"isupper_l",
RetValSpec<IntType>,
[ArgSpec<IntType>, ArgSpec<LocaleT>]
>,
FunctionSpec<
"isxdigit_l",
RetValSpec<IntType>,
[ArgSpec<IntType>, ArgSpec<LocaleT>]
>,
FunctionSpec<
"tolower_l",
RetValSpec<IntType>,
[ArgSpec<IntType>, ArgSpec<LocaleT>]
>,
FunctionSpec<
"toupper_l",
RetValSpec<IntType>,
[ArgSpec<IntType>, ArgSpec<LocaleT>]
>,
]
>;

Expand Down Expand Up @@ -1664,61 +1591,6 @@ def StdC : StandardSpec<"stdc"> {
]
>;


NamedType StructLconv : NamedType<"struct lconv">;
PtrType StructLconvPtr : PtrType<StructLconv>;

HeaderSpec Locale = HeaderSpec<
"locale.h",
[], // Macros
[LocaleT, StructLconv], // Types
[], // Enumerations
[
FunctionSpec<
"duplocale",
RetValSpec<LocaleT>,
[
ArgSpec<LocaleT>
]
>,
FunctionSpec<
"freelocale",
RetValSpec<VoidType>,
[
ArgSpec<LocaleT>
]
>,
FunctionSpec<
"localeconv",
RetValSpec<StructLconvPtr>,
[]
>,
FunctionSpec<
"newlocale",
RetValSpec<LocaleT>,
[
ArgSpec<IntType>,
ArgSpec<ConstCharPtr>,
ArgSpec<LocaleT>
]
>,
FunctionSpec<
"setlocale",
RetValSpec<CharPtr>,
[
ArgSpec<IntType>,
ArgSpec<ConstCharPtr>
]
>,
FunctionSpec<
"uselocale",
RetValSpec<LocaleT>,
[
ArgSpec<LocaleT>
]
>
] // Functions
>;

let Headers = [
Assert,
Expand All @@ -1741,6 +1613,5 @@ def StdC : StandardSpec<"stdc"> {
Time,
UChar,
WChar,
Locale,
];
}
1 change: 0 additions & 1 deletion libc/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,3 @@ add_subdirectory(signal)
add_subdirectory(spawn)
add_subdirectory(threads)
add_subdirectory(time)
add_subdirectory(locale)
156 changes: 0 additions & 156 deletions libc/src/ctype/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -146,159 +146,3 @@ add_entrypoint_object(
DEPENDS
libc.src.__support.ctype_utils
)

# Do not build the locale versions in overlay mode.
if(NOT LLVM_LIBC_FULL_BUILD)
return()
endif()

add_entrypoint_object(
isalnum_l
SRCS
isalnum_l.cpp
HDRS
isalnum_l.h
DEPENDS
libc.include.ctype
libc.src.__support.ctype_utils
libc.hdr.types.locale_t
)

add_entrypoint_object(
isalpha_l
SRCS
isalpha_l.cpp
HDRS
isalpha_l.h
DEPENDS
libc.src.__support.ctype_utils
libc.hdr.types.locale_t
)

add_entrypoint_object(
isblank_l
SRCS
isblank_l.cpp
HDRS
isblank_l.h
DEPENDS
libc.hdr.types.locale_t
)

add_entrypoint_object(
iscntrl_l
SRCS
iscntrl_l.cpp
HDRS
iscntrl_l.h
DEPENDS
libc.hdr.types.locale_t
)

add_entrypoint_object(
isdigit_l
SRCS
isdigit_l.cpp
HDRS
isdigit_l.h
DEPENDS
libc.src.__support.ctype_utils
libc.hdr.types.locale_t
)

add_entrypoint_object(
isgraph_l
SRCS
isgraph_l.cpp
HDRS
isgraph_l.h
DEPENDS
libc.src.__support.ctype_utils
libc.hdr.types.locale_t
)

add_entrypoint_object(
islower_l
SRCS
islower_l.cpp
HDRS
islower_l.h
DEPENDS
libc.src.__support.ctype_utils
libc.hdr.types.locale_t
)

add_entrypoint_object(
isprint_l
SRCS
isprint_l.cpp
HDRS
isprint_l.h
DEPENDS
libc.hdr.types.locale_t
)

add_entrypoint_object(
ispunct_l
SRCS
ispunct_l.cpp
HDRS
ispunct_l.h
DEPENDS
libc.src.__support.ctype_utils
libc.hdr.types.locale_t
)

add_entrypoint_object(
isspace_l
SRCS
isspace_l.cpp
HDRS
isspace_l.h
DEPENDS
libc.hdr.types.locale_t
)

add_entrypoint_object(
isupper_l
SRCS
isupper_l.cpp
HDRS
isupper_l.h
DEPENDS
libc.src.__support.ctype_utils
libc.hdr.types.locale_t
)

add_entrypoint_object(
isxdigit_l
SRCS
isxdigit_l.cpp
HDRS
isxdigit_l.h
DEPENDS
libc.src.__support.ctype_utils
libc.hdr.types.locale_t
)

add_entrypoint_object(
tolower_l
SRCS
tolower_l.cpp
HDRS
tolower_l.h
DEPENDS
libc.src.__support.ctype_utils
libc.hdr.types.locale_t
)

add_entrypoint_object(
toupper_l
SRCS
toupper_l.cpp
HDRS
toupper_l.h
DEPENDS
libc.src.__support.ctype_utils
libc.hdr.types.locale_t
)
2 changes: 2 additions & 0 deletions libc/src/ctype/isalnum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

namespace LIBC_NAMESPACE_DECL {

// TODO: Currently restricted to default locale.
// These should be extended using locale information.
LLVM_LIBC_FUNCTION(int, isalnum, (int c)) {
return static_cast<int>(internal::isalnum(static_cast<unsigned>(c)));
}
Expand Down
21 changes: 0 additions & 21 deletions libc/src/ctype/isalnum_l.cpp

This file was deleted.

21 changes: 0 additions & 21 deletions libc/src/ctype/isalnum_l.h

This file was deleted.

2 changes: 2 additions & 0 deletions libc/src/ctype/isalpha.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

namespace LIBC_NAMESPACE_DECL {

// TODO: Currently restricted to default locale.
// These should be extended using locale information.
LLVM_LIBC_FUNCTION(int, isalpha, (int c)) {
return static_cast<int>(internal::isalpha(static_cast<unsigned>(c)));
}
Expand Down
21 changes: 0 additions & 21 deletions libc/src/ctype/isalpha_l.cpp

This file was deleted.

21 changes: 0 additions & 21 deletions libc/src/ctype/isalpha_l.h

This file was deleted.

2 changes: 2 additions & 0 deletions libc/src/ctype/isblank.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

namespace LIBC_NAMESPACE_DECL {

// TODO: Currently restricted to default locale.
// These should be extended using locale information.
LLVM_LIBC_FUNCTION(int, isblank, (int c)) {
return static_cast<int>(c == ' ' || c == '\t');
}
Expand Down
20 changes: 0 additions & 20 deletions libc/src/ctype/isblank_l.cpp

This file was deleted.

21 changes: 0 additions & 21 deletions libc/src/ctype/isblank_l.h

This file was deleted.

2 changes: 2 additions & 0 deletions libc/src/ctype/iscntrl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

namespace LIBC_NAMESPACE_DECL {

// TODO: Currently restricted to default locale.
// These should be extended using locale information.
LLVM_LIBC_FUNCTION(int, iscntrl, (int c)) {
const unsigned ch = static_cast<unsigned>(c);
return static_cast<int>(ch < 0x20 || ch == 0x7f);
Expand Down
21 changes: 0 additions & 21 deletions libc/src/ctype/iscntrl_l.cpp

This file was deleted.

21 changes: 0 additions & 21 deletions libc/src/ctype/iscntrl_l.h

This file was deleted.

2 changes: 2 additions & 0 deletions libc/src/ctype/isdigit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

namespace LIBC_NAMESPACE_DECL {

// TODO: Currently restricted to default locale.
// These should be extended using locale information.
LLVM_LIBC_FUNCTION(int, isdigit, (int c)) {
return static_cast<int>(internal::isdigit(static_cast<unsigned>(c)));
}
Expand Down
20 changes: 0 additions & 20 deletions libc/src/ctype/isdigit_l.cpp

This file was deleted.

21 changes: 0 additions & 21 deletions libc/src/ctype/isdigit_l.h

This file was deleted.

2 changes: 2 additions & 0 deletions libc/src/ctype/isgraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

namespace LIBC_NAMESPACE_DECL {

// TODO: Currently restricted to default locale.
// These should be extended using locale information.
LLVM_LIBC_FUNCTION(int, isgraph, (int c)) {
return static_cast<int>(internal::isgraph(static_cast<unsigned>(c)));
}
Expand Down
21 changes: 0 additions & 21 deletions libc/src/ctype/isgraph_l.cpp

This file was deleted.

21 changes: 0 additions & 21 deletions libc/src/ctype/isgraph_l.h

This file was deleted.

2 changes: 2 additions & 0 deletions libc/src/ctype/islower.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

namespace LIBC_NAMESPACE_DECL {

// TODO: Currently restricted to default locale.
// These should be extended using locale information.
LLVM_LIBC_FUNCTION(int, islower, (int c)) {
return static_cast<int>(internal::islower(static_cast<unsigned>(c)));
}
Expand Down
21 changes: 0 additions & 21 deletions libc/src/ctype/islower_l.cpp

This file was deleted.

21 changes: 0 additions & 21 deletions libc/src/ctype/islower_l.h

This file was deleted.

2 changes: 2 additions & 0 deletions libc/src/ctype/isprint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

namespace LIBC_NAMESPACE_DECL {

// TODO: Currently restricted to default locale.
// These should be extended using locale information.
LLVM_LIBC_FUNCTION(int, isprint, (int c)) {
const unsigned ch = static_cast<unsigned>(c);
return static_cast<int>((ch - ' ') < 95);
Expand Down
21 changes: 0 additions & 21 deletions libc/src/ctype/isprint_l.cpp

This file was deleted.

21 changes: 0 additions & 21 deletions libc/src/ctype/isprint_l.h

This file was deleted.

2 changes: 2 additions & 0 deletions libc/src/ctype/ispunct.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

namespace LIBC_NAMESPACE_DECL {

// TODO: Currently restricted to default locale.
// These should be extended using locale information.
LLVM_LIBC_FUNCTION(int, ispunct, (int c)) {
const unsigned ch = static_cast<unsigned>(c);
return static_cast<int>(!internal::isalnum(ch) && internal::isgraph(ch));
Expand Down
22 changes: 0 additions & 22 deletions libc/src/ctype/ispunct_l.cpp

This file was deleted.

21 changes: 0 additions & 21 deletions libc/src/ctype/ispunct_l.h

This file was deleted.

2 changes: 2 additions & 0 deletions libc/src/ctype/isspace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

namespace LIBC_NAMESPACE_DECL {

// TODO: Currently restricted to default locale.
// These should be extended using locale information.
LLVM_LIBC_FUNCTION(int, isspace, (int c)) {
return static_cast<int>(internal::isspace(static_cast<unsigned>(c)));
}
Expand Down
21 changes: 0 additions & 21 deletions libc/src/ctype/isspace_l.cpp

This file was deleted.

21 changes: 0 additions & 21 deletions libc/src/ctype/isspace_l.h

This file was deleted.

2 changes: 2 additions & 0 deletions libc/src/ctype/isupper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

namespace LIBC_NAMESPACE_DECL {

// TODO: Currently restricted to default locale.
// These should be extended using locale information.
LLVM_LIBC_FUNCTION(int, isupper, (int c)) {
return static_cast<int>(internal::isupper(static_cast<unsigned>(c)));
}
Expand Down
21 changes: 0 additions & 21 deletions libc/src/ctype/isupper_l.cpp

This file was deleted.

21 changes: 0 additions & 21 deletions libc/src/ctype/isupper_l.h

This file was deleted.

2 changes: 2 additions & 0 deletions libc/src/ctype/isxdigit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

namespace LIBC_NAMESPACE_DECL {

// TODO: Currently restricted to default locale.
// These should be extended using locale information.
LLVM_LIBC_FUNCTION(int, isxdigit, (int c)) {
const unsigned ch = static_cast<unsigned>(c);
return static_cast<int>(internal::isdigit(ch) || (ch | 32) - 'a' < 6);
Expand Down
22 changes: 0 additions & 22 deletions libc/src/ctype/isxdigit_l.cpp

This file was deleted.

21 changes: 0 additions & 21 deletions libc/src/ctype/isxdigit_l.h

This file was deleted.

2 changes: 2 additions & 0 deletions libc/src/ctype/tolower.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

namespace LIBC_NAMESPACE_DECL {

// TODO: Currently restricted to default locale.
// These should be extended using locale information.
LLVM_LIBC_FUNCTION(int, tolower, (int c)) { return internal::tolower(c); }

} // namespace LIBC_NAMESPACE_DECL
21 changes: 0 additions & 21 deletions libc/src/ctype/tolower_l.cpp

This file was deleted.

21 changes: 0 additions & 21 deletions libc/src/ctype/tolower_l.h

This file was deleted.

2 changes: 2 additions & 0 deletions libc/src/ctype/toupper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

namespace LIBC_NAMESPACE_DECL {

// TODO: Currently restricted to default locale.
// These should be extended using locale information.
LLVM_LIBC_FUNCTION(int, toupper, (int c)) {
if (internal::islower(c))
return c - ('a' - 'A');
Expand Down
23 changes: 0 additions & 23 deletions libc/src/ctype/toupper_l.cpp

This file was deleted.

21 changes: 0 additions & 21 deletions libc/src/ctype/toupper_l.h

This file was deleted.

76 changes: 0 additions & 76 deletions libc/src/locale/CMakeLists.txt

This file was deleted.

21 changes: 0 additions & 21 deletions libc/src/locale/duplocale.cpp

This file was deleted.

22 changes: 0 additions & 22 deletions libc/src/locale/duplocale.h

This file was deleted.

21 changes: 0 additions & 21 deletions libc/src/locale/freelocale.cpp

This file was deleted.

22 changes: 0 additions & 22 deletions libc/src/locale/freelocale.h

This file was deleted.

21 changes: 0 additions & 21 deletions libc/src/locale/locale.cpp

This file was deleted.

36 changes: 0 additions & 36 deletions libc/src/locale/locale.h

This file was deleted.

49 changes: 0 additions & 49 deletions libc/src/locale/localeconv.cpp

This file was deleted.

22 changes: 0 additions & 22 deletions libc/src/locale/localeconv.h

This file was deleted.

28 changes: 0 additions & 28 deletions libc/src/locale/newlocale.cpp

This file was deleted.

22 changes: 0 additions & 22 deletions libc/src/locale/newlocale.h

This file was deleted.

28 changes: 0 additions & 28 deletions libc/src/locale/setlocale.cpp

This file was deleted.

22 changes: 0 additions & 22 deletions libc/src/locale/setlocale.h

This file was deleted.

23 changes: 0 additions & 23 deletions libc/src/locale/uselocale.cpp

This file was deleted.

22 changes: 0 additions & 22 deletions libc/src/locale/uselocale.h

This file was deleted.

1 change: 0 additions & 1 deletion libc/test/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ add_subdirectory(setjmp)
add_subdirectory(signal)
add_subdirectory(spawn)
add_subdirectory(time)
add_subdirectory(locale)

if(${LIBC_TARGET_OS} STREQUAL "linux")
add_subdirectory(pthread)
Expand Down
25 changes: 0 additions & 25 deletions libc/test/src/locale/CMakeLists.txt

This file was deleted.

27 changes: 0 additions & 27 deletions libc/test/src/locale/locale_test.cpp

This file was deleted.

17 changes: 0 additions & 17 deletions libc/test/src/locale/localeconv_test.cpp

This file was deleted.