Skip to content

[libc] Use proxy header in the locale implementation. #130982

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 13, 2025
Merged

Conversation

c8ef
Copy link
Contributor

@c8ef c8ef commented Mar 12, 2025

Address review comments in #130621 (review).

Some unused headers are also removed.

@c8ef c8ef marked this pull request as ready for review March 12, 2025 16:10
@llvmbot llvmbot added the libc label Mar 12, 2025
@llvmbot
Copy link
Member

llvmbot commented Mar 12, 2025

@llvm/pr-subscribers-libc

Author: Connector Switch (c8ef)

Changes

Address review comments in #130621 (review).

Some unused headers are also removed.


Full diff: https://github.com/llvm/llvm-project/pull/130982.diff

8 Files Affected:

  • (modified) libc/src/locale/CMakeLists.txt (+8-9)
  • (modified) libc/src/locale/duplocale.cpp (-4)
  • (modified) libc/src/locale/freelocale.cpp (-4)
  • (modified) libc/src/locale/locale.cpp (-2)
  • (modified) libc/src/locale/newlocale.cpp (+2-3)
  • (modified) libc/src/locale/newlocale.h (+1-2)
  • (modified) libc/src/locale/setlocale.cpp (+1-3)
  • (modified) libc/src/locale/setlocale.h (+1-2)
diff --git a/libc/src/locale/CMakeLists.txt b/libc/src/locale/CMakeLists.txt
index 6aaeb2ac31488..9a3abf76a55c5 100644
--- a/libc/src/locale/CMakeLists.txt
+++ b/libc/src/locale/CMakeLists.txt
@@ -5,7 +5,7 @@ add_object_library(
   HDRS
     locale.h
   DEPENDS
-    libc.include.locale
+    libc.hdr.types.locale_t
 )
 
 add_entrypoint_object(
@@ -27,7 +27,8 @@ add_entrypoint_object(
   HDRS
     newlocale.h
   DEPENDS
-    libc.include.locale
+    libc.hdr.locale_macros
+    libc.hdr.types.locale_t
     .locale
 )
 
@@ -38,8 +39,7 @@ add_entrypoint_object(
   HDRS
     duplocale.h
   DEPENDS
-    libc.include.locale
-    .locale
+    libc.hdr.types.locale_t
 )
 
 add_entrypoint_object(
@@ -49,8 +49,8 @@ add_entrypoint_object(
   HDRS
     setlocale.h
   DEPENDS
-    libc.include.locale
-    .locale
+    libc.hdr.locale_macros
+    libc.hdr.types.locale_t
 )
 
 add_entrypoint_object(
@@ -60,7 +60,7 @@ add_entrypoint_object(
   HDRS
     uselocale.h
   DEPENDS
-    libc.include.locale
+    libc.hdr.types.locale_t
     .locale
 )
 
@@ -71,6 +71,5 @@ add_entrypoint_object(
   HDRS
     freelocale.h
   DEPENDS
-    libc.include.locale
-    .locale
+    libc.hdr.types.locale_t
 )
diff --git a/libc/src/locale/duplocale.cpp b/libc/src/locale/duplocale.cpp
index d1bd0835121fc..572aff8573d16 100644
--- a/libc/src/locale/duplocale.cpp
+++ b/libc/src/locale/duplocale.cpp
@@ -7,10 +7,6 @@
 //===----------------------------------------------------------------------===//
 
 #include "src/locale/duplocale.h"
-#include "include/llvm-libc-macros/locale-macros.h"
-#include "src/locale/locale.h"
-
-#include "src/__support/CPP/string_view.h"
 #include "src/__support/common.h"
 #include "src/__support/macros/config.h"
 
diff --git a/libc/src/locale/freelocale.cpp b/libc/src/locale/freelocale.cpp
index 2008995f101bf..2e1631d4ec40b 100644
--- a/libc/src/locale/freelocale.cpp
+++ b/libc/src/locale/freelocale.cpp
@@ -7,10 +7,6 @@
 //===----------------------------------------------------------------------===//
 
 #include "src/locale/freelocale.h"
-#include "include/llvm-libc-macros/locale-macros.h"
-#include "src/locale/locale.h"
-
-#include "src/__support/CPP/string_view.h"
 #include "src/__support/common.h"
 #include "src/__support/macros/config.h"
 
diff --git a/libc/src/locale/locale.cpp b/libc/src/locale/locale.cpp
index 1610fb5dd3400..2f7e13fb1d6f7 100644
--- a/libc/src/locale/locale.cpp
+++ b/libc/src/locale/locale.cpp
@@ -7,8 +7,6 @@
 //===----------------------------------------------------------------------===//
 
 #include "src/locale/locale.h"
-
-#include "include/llvm-libc-macros/locale-macros.h"
 #include "src/__support/common.h"
 #include "src/__support/macros/config.h"
 
diff --git a/libc/src/locale/newlocale.cpp b/libc/src/locale/newlocale.cpp
index 379e7e6385d09..2c36465bb61a3 100644
--- a/libc/src/locale/newlocale.cpp
+++ b/libc/src/locale/newlocale.cpp
@@ -7,12 +7,11 @@
 //===----------------------------------------------------------------------===//
 
 #include "src/locale/newlocale.h"
-#include "include/llvm-libc-macros/locale-macros.h"
-#include "src/locale/locale.h"
-
+#include "hdr/locale_macros.h"
 #include "src/__support/CPP/string_view.h"
 #include "src/__support/common.h"
 #include "src/__support/macros/config.h"
+#include "src/locale/locale.h"
 
 namespace LIBC_NAMESPACE_DECL {
 
diff --git a/libc/src/locale/newlocale.h b/libc/src/locale/newlocale.h
index 08a0071cb7aea..07972fa384433 100644
--- a/libc/src/locale/newlocale.h
+++ b/libc/src/locale/newlocale.h
@@ -9,9 +9,8 @@
 #ifndef LLVM_LIBC_SRC_LOCALE_SETLOCALE_H
 #define LLVM_LIBC_SRC_LOCALE_SETLOCALE_H
 
-#include "src/__support/macros/config.h"
-
 #include "hdr/types/locale_t.h"
+#include "src/__support/macros/config.h"
 
 namespace LIBC_NAMESPACE_DECL {
 
diff --git a/libc/src/locale/setlocale.cpp b/libc/src/locale/setlocale.cpp
index 0950ad73cbe2c..2dec497ce051a 100644
--- a/libc/src/locale/setlocale.cpp
+++ b/libc/src/locale/setlocale.cpp
@@ -7,9 +7,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "src/locale/setlocale.h"
-#include "include/llvm-libc-macros/locale-macros.h"
-#include "src/locale/locale.h"
-
+#include "hdr/locale_macros.h"
 #include "src/__support/CPP/string_view.h"
 #include "src/__support/common.h"
 #include "src/__support/macros/config.h"
diff --git a/libc/src/locale/setlocale.h b/libc/src/locale/setlocale.h
index a9213cf409a7b..8e32fd42f41d9 100644
--- a/libc/src/locale/setlocale.h
+++ b/libc/src/locale/setlocale.h
@@ -9,9 +9,8 @@
 #ifndef LLVM_LIBC_SRC_LOCALE_SETLOCALE_H
 #define LLVM_LIBC_SRC_LOCALE_SETLOCALE_H
 
-#include "src/__support/macros/config.h"
-
 #include "hdr/types/locale_t.h"
+#include "src/__support/macros/config.h"
 
 namespace LIBC_NAMESPACE_DECL {
 

Copy link
Contributor

@michaelrj-google michaelrj-google left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@c8ef c8ef merged commit f291ec6 into llvm:main Mar 13, 2025
20 checks passed
@c8ef c8ef deleted the locale branch March 13, 2025 03:35
frederik-h pushed a commit to frederik-h/llvm-project that referenced this pull request Mar 18, 2025
Address review comments in
llvm#130621 (review).

Some unused headers are also removed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants