Skip to content

Commit f291ec6

Browse files
authored
[libc] Use proxy header in the locale implementation. (#130982)
Address review comments in #130621 (review). Some unused headers are also removed.
1 parent 79a5974 commit f291ec6

File tree

8 files changed

+13
-29
lines changed

8 files changed

+13
-29
lines changed

libc/src/locale/CMakeLists.txt

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ add_object_library(
55
HDRS
66
locale.h
77
DEPENDS
8-
libc.include.locale
8+
libc.hdr.types.locale_t
99
)
1010

1111
add_entrypoint_object(
@@ -27,7 +27,8 @@ add_entrypoint_object(
2727
HDRS
2828
newlocale.h
2929
DEPENDS
30-
libc.include.locale
30+
libc.hdr.locale_macros
31+
libc.hdr.types.locale_t
3132
.locale
3233
)
3334

@@ -38,8 +39,7 @@ add_entrypoint_object(
3839
HDRS
3940
duplocale.h
4041
DEPENDS
41-
libc.include.locale
42-
.locale
42+
libc.hdr.types.locale_t
4343
)
4444

4545
add_entrypoint_object(
@@ -49,8 +49,8 @@ add_entrypoint_object(
4949
HDRS
5050
setlocale.h
5151
DEPENDS
52-
libc.include.locale
53-
.locale
52+
libc.hdr.locale_macros
53+
libc.hdr.types.locale_t
5454
)
5555

5656
add_entrypoint_object(
@@ -60,7 +60,7 @@ add_entrypoint_object(
6060
HDRS
6161
uselocale.h
6262
DEPENDS
63-
libc.include.locale
63+
libc.hdr.types.locale_t
6464
.locale
6565
)
6666

@@ -71,6 +71,5 @@ add_entrypoint_object(
7171
HDRS
7272
freelocale.h
7373
DEPENDS
74-
libc.include.locale
75-
.locale
74+
libc.hdr.types.locale_t
7675
)

libc/src/locale/duplocale.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@
77
//===----------------------------------------------------------------------===//
88

99
#include "src/locale/duplocale.h"
10-
#include "include/llvm-libc-macros/locale-macros.h"
11-
#include "src/locale/locale.h"
12-
13-
#include "src/__support/CPP/string_view.h"
1410
#include "src/__support/common.h"
1511
#include "src/__support/macros/config.h"
1612

libc/src/locale/freelocale.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@
77
//===----------------------------------------------------------------------===//
88

99
#include "src/locale/freelocale.h"
10-
#include "include/llvm-libc-macros/locale-macros.h"
11-
#include "src/locale/locale.h"
12-
13-
#include "src/__support/CPP/string_view.h"
1410
#include "src/__support/common.h"
1511
#include "src/__support/macros/config.h"
1612

libc/src/locale/locale.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
//===----------------------------------------------------------------------===//
88

99
#include "src/locale/locale.h"
10-
11-
#include "include/llvm-libc-macros/locale-macros.h"
1210
#include "src/__support/common.h"
1311
#include "src/__support/macros/config.h"
1412

libc/src/locale/newlocale.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@
77
//===----------------------------------------------------------------------===//
88

99
#include "src/locale/newlocale.h"
10-
#include "include/llvm-libc-macros/locale-macros.h"
11-
#include "src/locale/locale.h"
12-
10+
#include "hdr/locale_macros.h"
1311
#include "src/__support/CPP/string_view.h"
1412
#include "src/__support/common.h"
1513
#include "src/__support/macros/config.h"
14+
#include "src/locale/locale.h"
1615

1716
namespace LIBC_NAMESPACE_DECL {
1817

libc/src/locale/newlocale.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@
99
#ifndef LLVM_LIBC_SRC_LOCALE_SETLOCALE_H
1010
#define LLVM_LIBC_SRC_LOCALE_SETLOCALE_H
1111

12-
#include "src/__support/macros/config.h"
13-
1412
#include "hdr/types/locale_t.h"
13+
#include "src/__support/macros/config.h"
1514

1615
namespace LIBC_NAMESPACE_DECL {
1716

libc/src/locale/setlocale.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77
//===----------------------------------------------------------------------===//
88

99
#include "src/locale/setlocale.h"
10-
#include "include/llvm-libc-macros/locale-macros.h"
11-
#include "src/locale/locale.h"
12-
10+
#include "hdr/locale_macros.h"
1311
#include "src/__support/CPP/string_view.h"
1412
#include "src/__support/common.h"
1513
#include "src/__support/macros/config.h"

libc/src/locale/setlocale.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@
99
#ifndef LLVM_LIBC_SRC_LOCALE_SETLOCALE_H
1010
#define LLVM_LIBC_SRC_LOCALE_SETLOCALE_H
1111

12-
#include "src/__support/macros/config.h"
13-
1412
#include "hdr/types/locale_t.h"
13+
#include "src/__support/macros/config.h"
1514

1615
namespace LIBC_NAMESPACE_DECL {
1716

0 commit comments

Comments
 (0)