From 026c90cc8ce5379a172d82e8fa8bd47e205dec8b Mon Sep 17 00:00:00 2001 From: Job Hernandez Date: Sat, 19 Oct 2024 21:59:40 -0700 Subject: [PATCH 1/4] remove --- libc/hdr/CMakeLists.txt | 14 ++++++++++++++ libc/src/string/CMakeLists.txt | 10 +++++++--- libc/src/string/strcat.h | 2 +- libc/src/string/strcpy.h | 2 +- libc/src/string/strdup.h | 2 +- libc/src/string/strlcat.h | 2 +- libc/src/string/strlcpy.h | 2 +- libc/src/string/strlen.h | 2 +- libc/src/string/strncat.h | 2 +- libc/src/string/strndup.h | 2 +- 10 files changed, 29 insertions(+), 11 deletions(-) diff --git a/libc/hdr/CMakeLists.txt b/libc/hdr/CMakeLists.txt index 13dc892978bb8..840dc50fd351b 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 787188ab3beb9..b33cbc5358d60 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 90a7fd2e41337..48a9b1fe0f582 100644 --- a/libc/src/string/strcat.h +++ b/libc/src/string/strcat.h @@ -10,7 +10,7 @@ #define LLVM_LIBC_SRC_STRING_STRCAT_H #include "src/__support/macros/config.h" -#include +#include "include/llvm-libc-types/size_t.h" namespace LIBC_NAMESPACE_DECL { diff --git a/libc/src/string/strcpy.h b/libc/src/string/strcpy.h index d4f3e81fdc733..485393a1f971f 100644 --- a/libc/src/string/strcpy.h +++ b/libc/src/string/strcpy.h @@ -10,7 +10,7 @@ #define LLVM_LIBC_SRC_STRING_STRCPY_H #include "src/__support/macros/config.h" -#include +#include "include/llvm-libc-types/size_t.h" namespace LIBC_NAMESPACE_DECL { diff --git a/libc/src/string/strdup.h b/libc/src/string/strdup.h index 45303a3efeb49..d295b0357e31f 100644 --- a/libc/src/string/strdup.h +++ b/libc/src/string/strdup.h @@ -10,7 +10,7 @@ #define LLVM_LIBC_SRC_STRING_STRDUP_H #include "src/__support/macros/config.h" -#include +#include "include/llvm-libc-types/size_t.h" namespace LIBC_NAMESPACE_DECL { diff --git a/libc/src/string/strlcat.h b/libc/src/string/strlcat.h index ffe97af62a543..b34ef8482e635 100644 --- a/libc/src/string/strlcat.h +++ b/libc/src/string/strlcat.h @@ -10,7 +10,7 @@ #define LLVM_LIBC_SRC_STRING_STRLCAT_H #include "src/__support/macros/config.h" -#include +#include "include/llvm-libc-types/size_t.h" namespace LIBC_NAMESPACE_DECL { diff --git a/libc/src/string/strlcpy.h b/libc/src/string/strlcpy.h index 058e7653b1b91..2a62f58cc6712 100644 --- a/libc/src/string/strlcpy.h +++ b/libc/src/string/strlcpy.h @@ -10,7 +10,7 @@ #define LLVM_LIBC_SRC_STRING_STRLCPY_H #include "src/__support/macros/config.h" -#include +#include "include/llvm-libc-types/size_t.h" namespace LIBC_NAMESPACE_DECL { diff --git a/libc/src/string/strlen.h b/libc/src/string/strlen.h index f07bf73ace3de..67ef1eba2ffcf 100644 --- a/libc/src/string/strlen.h +++ b/libc/src/string/strlen.h @@ -10,7 +10,7 @@ #define LLVM_LIBC_SRC_STRING_STRLEN_H #include "src/__support/macros/config.h" -#include +#include "include/llvm-libc-types/size_t.h" namespace LIBC_NAMESPACE_DECL { diff --git a/libc/src/string/strncat.h b/libc/src/string/strncat.h index 1a130799f3965..966f922604448 100644 --- a/libc/src/string/strncat.h +++ b/libc/src/string/strncat.h @@ -10,7 +10,7 @@ #define LLVM_LIBC_SRC_STRING_STRNCAT_H #include "src/__support/macros/config.h" -#include +#include "include/llvm-libc-types/size_t.h" namespace LIBC_NAMESPACE_DECL { diff --git a/libc/src/string/strndup.h b/libc/src/string/strndup.h index 03370cc8d7dce..2b317ef4574e1 100644 --- a/libc/src/string/strndup.h +++ b/libc/src/string/strndup.h @@ -10,7 +10,7 @@ #define LLVM_LIBC_SRC_STRING_STRNDUP_H #include "src/__support/macros/config.h" -#include +#include "include/llvm-libc-types/size_t.h" namespace LIBC_NAMESPACE_DECL { From 9c15f51e7925f994f3811f1afaa72662b9f04108 Mon Sep 17 00:00:00 2001 From: Job Hernandez Date: Sat, 19 Oct 2024 22:00:02 -0700 Subject: [PATCH 2/4] format code --- libc/src/string/strcat.h | 2 +- libc/src/string/strcpy.h | 2 +- libc/src/string/strdup.h | 2 +- libc/src/string/strlcat.h | 2 +- libc/src/string/strlcpy.h | 2 +- libc/src/string/strlen.h | 2 +- libc/src/string/strncat.h | 2 +- libc/src/string/strndup.h | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/libc/src/string/strcat.h b/libc/src/string/strcat.h index 48a9b1fe0f582..82860196ce29a 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 "src/__support/macros/config.h" #include "include/llvm-libc-types/size_t.h" +#include "src/__support/macros/config.h" namespace LIBC_NAMESPACE_DECL { diff --git a/libc/src/string/strcpy.h b/libc/src/string/strcpy.h index 485393a1f971f..9e0c3dbc39ef9 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 "src/__support/macros/config.h" #include "include/llvm-libc-types/size_t.h" +#include "src/__support/macros/config.h" namespace LIBC_NAMESPACE_DECL { diff --git a/libc/src/string/strdup.h b/libc/src/string/strdup.h index d295b0357e31f..2744e53d45d47 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 "src/__support/macros/config.h" #include "include/llvm-libc-types/size_t.h" +#include "src/__support/macros/config.h" namespace LIBC_NAMESPACE_DECL { diff --git a/libc/src/string/strlcat.h b/libc/src/string/strlcat.h index b34ef8482e635..9dc8f3a3bc0d1 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 "src/__support/macros/config.h" #include "include/llvm-libc-types/size_t.h" +#include "src/__support/macros/config.h" namespace LIBC_NAMESPACE_DECL { diff --git a/libc/src/string/strlcpy.h b/libc/src/string/strlcpy.h index 2a62f58cc6712..45b2c2a2ec26b 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 "src/__support/macros/config.h" #include "include/llvm-libc-types/size_t.h" +#include "src/__support/macros/config.h" namespace LIBC_NAMESPACE_DECL { diff --git a/libc/src/string/strlen.h b/libc/src/string/strlen.h index 67ef1eba2ffcf..093edcf479bcf 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 "src/__support/macros/config.h" #include "include/llvm-libc-types/size_t.h" +#include "src/__support/macros/config.h" namespace LIBC_NAMESPACE_DECL { diff --git a/libc/src/string/strncat.h b/libc/src/string/strncat.h index 966f922604448..f37d9a7bc1544 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 "src/__support/macros/config.h" #include "include/llvm-libc-types/size_t.h" +#include "src/__support/macros/config.h" namespace LIBC_NAMESPACE_DECL { diff --git a/libc/src/string/strndup.h b/libc/src/string/strndup.h index 2b317ef4574e1..78cde7b33e13b 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 "src/__support/macros/config.h" #include "include/llvm-libc-types/size_t.h" +#include "src/__support/macros/config.h" namespace LIBC_NAMESPACE_DECL { From 6b34e5b8f30b1605a6ca3d99a7d7573db9edc661 Mon Sep 17 00:00:00 2001 From: Job Hernandez Date: Sat, 19 Oct 2024 22:16:25 -0700 Subject: [PATCH 3/4] address review --- libc/hdr/CMakeLists.txt | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/libc/hdr/CMakeLists.txt b/libc/hdr/CMakeLists.txt index 840dc50fd351b..494d2152ae28f 100644 --- a/libc/hdr/CMakeLists.txt +++ b/libc/hdr/CMakeLists.txt @@ -93,19 +93,6 @@ 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 From 9a9ad9a3dcd4f2241d664e7ca136c4e39fabf9a8 Mon Sep 17 00:00:00 2001 From: Job Hernandez Date: Sat, 19 Oct 2024 22:20:38 -0700 Subject: [PATCH 4/4] get original file --- libc/hdr/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/libc/hdr/CMakeLists.txt b/libc/hdr/CMakeLists.txt index 494d2152ae28f..13dc892978bb8 100644 --- a/libc/hdr/CMakeLists.txt +++ b/libc/hdr/CMakeLists.txt @@ -50,7 +50,6 @@ 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