-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[libc] Remove the <string.h> header in libc/src and libc/test #113076
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
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@llvm/pr-subscribers-libc Author: Job Henandez Lara (Jobhdez) ChangesFull diff: https://github.com/llvm/llvm-project/pull/113076.diff 10 Files Affected:
diff --git a/libc/hdr/CMakeLists.txt b/libc/hdr/CMakeLists.txt
index 13dc892978bb87..840dc50fd351b9 100644
--- a/libc/hdr/CMakeLists.txt
+++ b/libc/hdr/CMakeLists.txt
@@ -50,6 +50,7 @@ add_proxy_header_library(
libc.include.llvm-libc-macros.error_number_macros
libc.include.llvm-libc-macros.generic_error_number_macros
)
+
add_proxy_header_library(
fcntl_macros
@@ -92,6 +93,19 @@ add_proxy_header_library(
libc.include.llvm-libc-macros.file_seek_macros
)
+add_header_library(string_overlay HDRS string_overlay.h)
+
+add_proxy_header_library(
+ string_macros
+ HDRS
+ string_macros.h
+ DEPENDS
+ .string_overlay
+ FULL_BUILD_DEPENDS
+ libc.include.string
+ libc.include.llvm-libc-macros.null_macro
+)
+
add_proxy_header_library(
sys_epoll_macros
HDRS
diff --git a/libc/src/string/CMakeLists.txt b/libc/src/string/CMakeLists.txt
index 787188ab3beb91..b33cbc5358d60d 100644
--- a/libc/src/string/CMakeLists.txt
+++ b/libc/src/string/CMakeLists.txt
@@ -138,6 +138,7 @@ add_entrypoint_object(
DEPENDS
.strcpy
.string_utils
+ libc.include.llvm-libc-types.size_t
)
add_entrypoint_object(
@@ -240,6 +241,7 @@ add_entrypoint_object(
.string_utils
libc.include.stdlib
libc.src.errno.errno
+ libc.include.llvm-libc-types.size_t
)
add_entrypoint_object(
@@ -270,7 +272,7 @@ add_entrypoint_object(
strlcat.h
DEPENDS
.string_utils
- libc.include.string
+ libc.include.llvm-libc-types.size_t
)
add_entrypoint_object(
@@ -281,7 +283,7 @@ add_entrypoint_object(
strlcpy.h
DEPENDS
.string_utils
- libc.include.string
+ libc.include.llvm-libc-types.size_t
)
add_entrypoint_object(
@@ -292,7 +294,7 @@ add_entrypoint_object(
strlen.h
DEPENDS
.string_utils
- libc.include.string
+ libc.include.llvm-libc-types.size_t
)
add_entrypoint_object(
@@ -304,6 +306,7 @@ add_entrypoint_object(
DEPENDS
.strncpy
.string_utils
+ libc.include.llvm-libc-types.size_t
)
add_entrypoint_object(
@@ -346,6 +349,7 @@ add_entrypoint_object(
.string_utils
libc.include.stdlib
libc.src.__support.CPP.new
+ libc.include.llvm-libc-types.size_t
)
add_entrypoint_object(
diff --git a/libc/src/string/strcat.h b/libc/src/string/strcat.h
index 90a7fd2e41337e..82860196ce29a2 100644
--- a/libc/src/string/strcat.h
+++ b/libc/src/string/strcat.h
@@ -9,8 +9,8 @@
#ifndef LLVM_LIBC_SRC_STRING_STRCAT_H
#define LLVM_LIBC_SRC_STRING_STRCAT_H
+#include "include/llvm-libc-types/size_t.h"
#include "src/__support/macros/config.h"
-#include <string.h>
namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/string/strcpy.h b/libc/src/string/strcpy.h
index d4f3e81fdc733a..9e0c3dbc39ef90 100644
--- a/libc/src/string/strcpy.h
+++ b/libc/src/string/strcpy.h
@@ -9,8 +9,8 @@
#ifndef LLVM_LIBC_SRC_STRING_STRCPY_H
#define LLVM_LIBC_SRC_STRING_STRCPY_H
+#include "include/llvm-libc-types/size_t.h"
#include "src/__support/macros/config.h"
-#include <string.h>
namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/string/strdup.h b/libc/src/string/strdup.h
index 45303a3efeb493..2744e53d45d475 100644
--- a/libc/src/string/strdup.h
+++ b/libc/src/string/strdup.h
@@ -9,8 +9,8 @@
#ifndef LLVM_LIBC_SRC_STRING_STRDUP_H
#define LLVM_LIBC_SRC_STRING_STRDUP_H
+#include "include/llvm-libc-types/size_t.h"
#include "src/__support/macros/config.h"
-#include <string.h>
namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/string/strlcat.h b/libc/src/string/strlcat.h
index ffe97af62a543c..9dc8f3a3bc0d18 100644
--- a/libc/src/string/strlcat.h
+++ b/libc/src/string/strlcat.h
@@ -9,8 +9,8 @@
#ifndef LLVM_LIBC_SRC_STRING_STRLCAT_H
#define LLVM_LIBC_SRC_STRING_STRLCAT_H
+#include "include/llvm-libc-types/size_t.h"
#include "src/__support/macros/config.h"
-#include <string.h>
namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/string/strlcpy.h b/libc/src/string/strlcpy.h
index 058e7653b1b91f..45b2c2a2ec26b4 100644
--- a/libc/src/string/strlcpy.h
+++ b/libc/src/string/strlcpy.h
@@ -9,8 +9,8 @@
#ifndef LLVM_LIBC_SRC_STRING_STRLCPY_H
#define LLVM_LIBC_SRC_STRING_STRLCPY_H
+#include "include/llvm-libc-types/size_t.h"
#include "src/__support/macros/config.h"
-#include <string.h>
namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/string/strlen.h b/libc/src/string/strlen.h
index f07bf73ace3de6..093edcf479bcf2 100644
--- a/libc/src/string/strlen.h
+++ b/libc/src/string/strlen.h
@@ -9,8 +9,8 @@
#ifndef LLVM_LIBC_SRC_STRING_STRLEN_H
#define LLVM_LIBC_SRC_STRING_STRLEN_H
+#include "include/llvm-libc-types/size_t.h"
#include "src/__support/macros/config.h"
-#include <string.h>
namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/string/strncat.h b/libc/src/string/strncat.h
index 1a130799f39658..f37d9a7bc1544a 100644
--- a/libc/src/string/strncat.h
+++ b/libc/src/string/strncat.h
@@ -9,8 +9,8 @@
#ifndef LLVM_LIBC_SRC_STRING_STRNCAT_H
#define LLVM_LIBC_SRC_STRING_STRNCAT_H
+#include "include/llvm-libc-types/size_t.h"
#include "src/__support/macros/config.h"
-#include <string.h>
namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/string/strndup.h b/libc/src/string/strndup.h
index 03370cc8d7dce1..78cde7b33e13b1 100644
--- a/libc/src/string/strndup.h
+++ b/libc/src/string/strndup.h
@@ -9,8 +9,8 @@
#ifndef LLVM_LIBC_SRC_STRING_STRNDUP_H
#define LLVM_LIBC_SRC_STRING_STRNDUP_H
+#include "include/llvm-libc-types/size_t.h"
#include "src/__support/macros/config.h"
-#include <string.h>
namespace LIBC_NAMESPACE_DECL {
|
lntue
reviewed
Oct 20, 2024
lntue
approved these changes
Oct 20, 2024
This pull request was closed.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.