From 19c3e2f7de28e10caef40baf94293bb67712401e Mon Sep 17 00:00:00 2001 From: Krishna Pandey <47917477+krishna2803@users.noreply.github.com> Date: Wed, 5 Feb 2025 22:54:44 +0530 Subject: [PATCH] [libc] Fix all imports of src/string/memory_utils (#114939) Fixed imports for all files *within* `libc/src/string/memory_utils`. Note: This doesn't include **all** files that need to be fixed. Fixes #86579 --- libc/src/__support/CMakeLists.txt | 2 +- libc/src/__support/FPUtil/CMakeLists.txt | 5 +++++ libc/src/dirent/readdir.h | 2 +- libc/src/string/allocating_string_utils.h | 2 +- libc/src/string/memory_utils/aarch64/inline_bcmp.h | 2 +- libc/src/string/memory_utils/aarch64/inline_memset.h | 2 +- libc/src/string/memory_utils/generic/builtin.h | 2 +- libc/src/string/memory_utils/inline_bcmp.h | 3 ++- libc/src/string/memory_utils/inline_bzero.h | 3 ++- libc/src/string/memory_utils/inline_memmem.h | 4 ++-- libc/src/string/memory_utils/inline_memmove.h | 3 ++- libc/src/string/memory_utils/inline_strcmp.h | 3 ++- libc/src/string/memory_utils/inline_strstr.h | 3 ++- libc/src/string/memory_utils/op_aarch64.h | 3 ++- libc/src/string/memory_utils/op_builtin.h | 3 ++- libc/src/string/memory_utils/op_generic.h | 3 ++- libc/src/string/memory_utils/op_riscv.h | 3 ++- libc/src/string/memory_utils/op_x86.h | 3 ++- libc/src/string/memory_utils/riscv/inline_bcmp.h | 2 +- libc/src/string/memory_utils/riscv/inline_memcmp.h | 2 +- libc/src/string/memory_utils/riscv/inline_memcpy.h | 2 +- libc/src/string/memory_utils/riscv/inline_memmove.h | 2 +- libc/src/string/memory_utils/riscv/inline_memset.h | 2 +- libc/src/string/memory_utils/utils.h | 2 +- libc/src/string/memory_utils/x86_64/inline_bcmp.h | 2 +- libc/src/string/memory_utils/x86_64/inline_memset.h | 4 ++-- 26 files changed, 42 insertions(+), 27 deletions(-) diff --git a/libc/src/__support/CMakeLists.txt b/libc/src/__support/CMakeLists.txt index 0e0556f4eecf..17f03a6b6c4a 100644 --- a/libc/src/__support/CMakeLists.txt +++ b/libc/src/__support/CMakeLists.txt @@ -87,7 +87,7 @@ add_header_library( endian_internal.h macros/properties/architectures.h macros/attributes.h - macros/properties/cpu_features.h + macros/config.h ) add_header_library( diff --git a/libc/src/__support/FPUtil/CMakeLists.txt b/libc/src/__support/FPUtil/CMakeLists.txt index 522b4afefd48..bfe0170f09fd 100644 --- a/libc/src/__support/FPUtil/CMakeLists.txt +++ b/libc/src/__support/FPUtil/CMakeLists.txt @@ -110,6 +110,7 @@ add_header_library( DEPENDS libc.src.__support.common libc.src.__support.FPUtil.generic.sqrt + libc.src.__support.macros.properties.cpu_features ) add_header_library( @@ -120,6 +121,7 @@ add_header_library( libc.src.__support.common libc.src.__support.CPP.type_traits libc.src.__support.FPUtil.generic.fma + libc.src.__support.macros.properties.cpu_features FLAGS FMA_OPT ) @@ -130,6 +132,7 @@ add_header_library( multiply_add.h DEPENDS libc.src.__support.common + libc.src.__support.macros.properties.cpu_features FLAGS FMA_OPT ) @@ -150,6 +153,7 @@ add_header_library( DEPENDS libc.src.__support.common libc.src.__support.macros.optimization + libc.src.__support.macros.properties.cpu_features FLAGS ROUND_OPT ) @@ -161,6 +165,7 @@ add_header_library( DEPENDS libc.src.__support.common libc.src.__support.number_pair + libc.src.__support.macros.properties.cpu_features .multiply_add ) diff --git a/libc/src/dirent/readdir.h b/libc/src/dirent/readdir.h index 2dcf5360ebd3..bc46a1bbfbf4 100644 --- a/libc/src/dirent/readdir.h +++ b/libc/src/dirent/readdir.h @@ -9,7 +9,7 @@ #ifndef LLVM_LIBC_SRC_DIRENT_READDIR_H #define LLVM_LIBC_SRC_DIRENT_READDIR_H -#include "src/__support/macros/config.h" +#include "src/__support/macros/config.h" // LIBC_NAMESPACE_DECL #include namespace LIBC_NAMESPACE_DECL { diff --git a/libc/src/string/allocating_string_utils.h b/libc/src/string/allocating_string_utils.h index b3a8663c2f47..1dece510e796 100644 --- a/libc/src/string/allocating_string_utils.h +++ b/libc/src/string/allocating_string_utils.h @@ -11,7 +11,7 @@ #include "src/__support/CPP/new.h" #include "src/__support/CPP/optional.h" -#include "src/__support/macros/config.h" +#include "src/__support/macros/config.h" // LIBC_NAMESPACE_DECL #include "src/string/memory_utils/inline_memcpy.h" #include "src/string/string_utils.h" diff --git a/libc/src/string/memory_utils/aarch64/inline_bcmp.h b/libc/src/string/memory_utils/aarch64/inline_bcmp.h index 93196415f266..e41ac202dbaa 100644 --- a/libc/src/string/memory_utils/aarch64/inline_bcmp.h +++ b/libc/src/string/memory_utils/aarch64/inline_bcmp.h @@ -9,7 +9,7 @@ #define LIBC_SRC_STRING_MEMORY_UTILS_AARCH64_INLINE_BCMP_H #include "src/__support/macros/attributes.h" // LIBC_INLINE -#include "src/__support/macros/config.h" +#include "src/__support/macros/config.h" // LIBC_NAMESPACE_DECL #include "src/__support/macros/optimization.h" // LIBC_UNLIKELY #include "src/string/memory_utils/op_aarch64.h" #include "src/string/memory_utils/op_generic.h" diff --git a/libc/src/string/memory_utils/aarch64/inline_memset.h b/libc/src/string/memory_utils/aarch64/inline_memset.h index a2c05534aa33..efcbfd070598 100644 --- a/libc/src/string/memory_utils/aarch64/inline_memset.h +++ b/libc/src/string/memory_utils/aarch64/inline_memset.h @@ -9,7 +9,7 @@ #define LIBC_SRC_STRING_MEMORY_UTILS_AARCH64_INLINE_MEMSET_H #include "src/__support/macros/attributes.h" // LIBC_INLINE -#include "src/__support/macros/config.h" +#include "src/__support/macros/config.h" // LIBC_NAMESPACE_DECL #include "src/string/memory_utils/op_aarch64.h" #include "src/string/memory_utils/op_generic.h" #include "src/string/memory_utils/utils.h" // Ptr, CPtr diff --git a/libc/src/string/memory_utils/generic/builtin.h b/libc/src/string/memory_utils/generic/builtin.h index 5670a4e61056..2b9ecc0c046e 100644 --- a/libc/src/string/memory_utils/generic/builtin.h +++ b/libc/src/string/memory_utils/generic/builtin.h @@ -10,7 +10,7 @@ #define LLVM_LIBC_SRC_STRING_MEMORY_UTILS_GENERIC_BUILTIN_H #include "src/__support/macros/attributes.h" // LIBC_INLINE -#include "src/__support/macros/config.h" +#include "src/__support/macros/config.h" // LIBC_NAMESPACE_DECL #include "src/string/memory_utils/utils.h" // Ptr, CPtr #include // size_t diff --git a/libc/src/string/memory_utils/inline_bcmp.h b/libc/src/string/memory_utils/inline_bcmp.h index 14cf16ebb6b6..52c738d3a4ce 100644 --- a/libc/src/string/memory_utils/inline_bcmp.h +++ b/libc/src/string/memory_utils/inline_bcmp.h @@ -10,7 +10,8 @@ #define LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_BCMP_H #include "src/__support/common.h" -#include "src/__support/macros/config.h" +#include "src/__support/macros/attributes.h" // LIBC_INLINE +#include "src/__support/macros/config.h" // LIBC_NAMESPACE_DECL #include "src/__support/macros/properties/architectures.h" // LIBC_TARGET_ARCH_IS_ #include // size_t diff --git a/libc/src/string/memory_utils/inline_bzero.h b/libc/src/string/memory_utils/inline_bzero.h index 4a92e8b57a68..a131b68725de 100644 --- a/libc/src/string/memory_utils/inline_bzero.h +++ b/libc/src/string/memory_utils/inline_bzero.h @@ -10,7 +10,8 @@ #define LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_BZERO_H #include "src/__support/common.h" -#include "src/__support/macros/config.h" +#include "src/__support/macros/attributes.h" // LIBC_INLINE +#include "src/__support/macros/config.h" // LIBC_NAMESPACE_DECL #include "src/string/memory_utils/inline_memset.h" #include // size_t diff --git a/libc/src/string/memory_utils/inline_memmem.h b/libc/src/string/memory_utils/inline_memmem.h index 15e3d633985d..1e9649c6e65e 100644 --- a/libc/src/string/memory_utils/inline_memmem.h +++ b/libc/src/string/memory_utils/inline_memmem.h @@ -9,8 +9,8 @@ #ifndef LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_MEMMEM_H #define LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_MEMMEM_H -#include "src/__support/macros/attributes.h" -#include "src/__support/macros/config.h" +#include "src/__support/macros/attributes.h" // LIBC_INLINE +#include "src/__support/macros/config.h" // LIBC_NAMESPACE_DECL #include diff --git a/libc/src/string/memory_utils/inline_memmove.h b/libc/src/string/memory_utils/inline_memmove.h index 85d0159701ec..84671c5c1797 100644 --- a/libc/src/string/memory_utils/inline_memmove.h +++ b/libc/src/string/memory_utils/inline_memmove.h @@ -9,7 +9,8 @@ #ifndef LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_MEMMOVE_H #define LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_MEMMOVE_H -#include "src/__support/macros/config.h" +#include "src/__support/macros/attributes.h" // LIBC_INLINE +#include "src/__support/macros/config.h" // LIBC_NAMESPACE_DECL #include // size_t, ptrdiff_t #if defined(LIBC_TARGET_ARCH_IS_X86) diff --git a/libc/src/string/memory_utils/inline_strcmp.h b/libc/src/string/memory_utils/inline_strcmp.h index 281d5b14c6cb..6758e79ae9ca 100644 --- a/libc/src/string/memory_utils/inline_strcmp.h +++ b/libc/src/string/memory_utils/inline_strcmp.h @@ -9,7 +9,8 @@ #ifndef LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_STRCMP_H #define LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_STRCMP_H -#include "src/__support/macros/config.h" +#include "src/__support/macros/attributes.h" // LIBC_INLINE +#include "src/__support/macros/config.h" // LIBC_NAMESPACE_DECL #include namespace LIBC_NAMESPACE_DECL { diff --git a/libc/src/string/memory_utils/inline_strstr.h b/libc/src/string/memory_utils/inline_strstr.h index 9c99e920b4b5..5495cc4803ec 100644 --- a/libc/src/string/memory_utils/inline_strstr.h +++ b/libc/src/string/memory_utils/inline_strstr.h @@ -9,7 +9,8 @@ #ifndef LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_STRSTR_H #define LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_STRSTR_H -#include "src/__support/macros/config.h" +#include "src/__support/macros/attributes.h" // LIBC_INLINE +#include "src/__support/macros/config.h" // LIBC_NAMESPACE_DECL #include "src/string/memory_utils/inline_memmem.h" #include "src/string/string_utils.h" #include diff --git a/libc/src/string/memory_utils/op_aarch64.h b/libc/src/string/memory_utils/op_aarch64.h index 1090ea2617f0..868c64474c0b 100644 --- a/libc/src/string/memory_utils/op_aarch64.h +++ b/libc/src/string/memory_utils/op_aarch64.h @@ -13,7 +13,8 @@ #ifndef LLVM_LIBC_SRC_STRING_MEMORY_UTILS_OP_AARCH64_H #define LLVM_LIBC_SRC_STRING_MEMORY_UTILS_OP_AARCH64_H -#include "src/__support/macros/config.h" +#include "src/__support/macros/attributes.h" // LIBC_INLINE +#include "src/__support/macros/config.h" // LIBC_NAMESPACE_DECL #include "src/__support/macros/properties/architectures.h" #if defined(LIBC_TARGET_ARCH_IS_AARCH64) diff --git a/libc/src/string/memory_utils/op_builtin.h b/libc/src/string/memory_utils/op_builtin.h index d7c1b1f87011..27b621d97f01 100644 --- a/libc/src/string/memory_utils/op_builtin.h +++ b/libc/src/string/memory_utils/op_builtin.h @@ -16,7 +16,8 @@ #define LLVM_LIBC_SRC_STRING_MEMORY_UTILS_OP_BUILTIN_H #include "src/__support/CPP/type_traits.h" -#include "src/__support/macros/config.h" +#include "src/__support/macros/attributes.h" // LIBC_INLINE +#include "src/__support/macros/config.h" // LIBC_NAMESPACE_DECL #include "src/string/memory_utils/utils.h" namespace LIBC_NAMESPACE_DECL { diff --git a/libc/src/string/memory_utils/op_generic.h b/libc/src/string/memory_utils/op_generic.h index da20a84dede4..9349cfdd1d02 100644 --- a/libc/src/string/memory_utils/op_generic.h +++ b/libc/src/string/memory_utils/op_generic.h @@ -27,7 +27,8 @@ #include "src/__support/CPP/type_traits.h" #include "src/__support/common.h" #include "src/__support/endian_internal.h" -#include "src/__support/macros/config.h" +#include "src/__support/macros/attributes.h" // LIBC_INLINE +#include "src/__support/macros/config.h" // LIBC_NAMESPACE_DECL #include "src/__support/macros/optimization.h" #include "src/__support/macros/properties/types.h" // LIBC_TYPES_HAS_INT64 #include "src/string/memory_utils/op_builtin.h" diff --git a/libc/src/string/memory_utils/op_riscv.h b/libc/src/string/memory_utils/op_riscv.h index 2d211de0facf..4292d7a627a5 100644 --- a/libc/src/string/memory_utils/op_riscv.h +++ b/libc/src/string/memory_utils/op_riscv.h @@ -12,7 +12,8 @@ #ifndef LLVM_LIBC_SRC_STRING_MEMORY_UTILS_OP_RISCV_H #define LLVM_LIBC_SRC_STRING_MEMORY_UTILS_OP_RISCV_H -#include "src/__support/macros/config.h" +#include "src/__support/macros/attributes.h" // LIBC_INLINE +#include "src/__support/macros/config.h" // LIBC_NAMESPACE_DECL #include "src/__support/macros/properties/architectures.h" #if defined(LIBC_TARGET_ARCH_IS_ANY_RISCV) diff --git a/libc/src/string/memory_utils/op_x86.h b/libc/src/string/memory_utils/op_x86.h index 309610e4ad63..8bd84120c4ff 100644 --- a/libc/src/string/memory_utils/op_x86.h +++ b/libc/src/string/memory_utils/op_x86.h @@ -12,7 +12,8 @@ #ifndef LLVM_LIBC_SRC_STRING_MEMORY_UTILS_OP_X86_H #define LLVM_LIBC_SRC_STRING_MEMORY_UTILS_OP_X86_H -#include "src/__support/macros/config.h" +#include "src/__support/macros/attributes.h" // LIBC_INLINE +#include "src/__support/macros/config.h" // LIBC_NAMESPACE_DECL #include "src/__support/macros/properties/architectures.h" #if defined(LIBC_TARGET_ARCH_IS_X86) diff --git a/libc/src/string/memory_utils/riscv/inline_bcmp.h b/libc/src/string/memory_utils/riscv/inline_bcmp.h index 4bdde27cd16b..666ad6382412 100644 --- a/libc/src/string/memory_utils/riscv/inline_bcmp.h +++ b/libc/src/string/memory_utils/riscv/inline_bcmp.h @@ -9,7 +9,7 @@ #define LIBC_SRC_STRING_MEMORY_UTILS_RISCV_INLINE_BCMP_H #include "src/__support/macros/attributes.h" // LIBC_INLINE -#include "src/__support/macros/config.h" +#include "src/__support/macros/config.h" // LIBC_NAMESPACE_DECL #include "src/__support/macros/properties/architectures.h" // LIBC_TARGET_ARCH_IS_RISCV64 #include "src/string/memory_utils/generic/aligned_access.h" #include "src/string/memory_utils/utils.h" // Ptr, CPtr diff --git a/libc/src/string/memory_utils/riscv/inline_memcmp.h b/libc/src/string/memory_utils/riscv/inline_memcmp.h index ca834952d331..c49e8d0a4ff2 100644 --- a/libc/src/string/memory_utils/riscv/inline_memcmp.h +++ b/libc/src/string/memory_utils/riscv/inline_memcmp.h @@ -9,7 +9,7 @@ #define LIBC_SRC_STRING_MEMORY_UTILS_RISCV_INLINE_MEMCMP_H #include "src/__support/macros/attributes.h" // LIBC_INLINE -#include "src/__support/macros/config.h" +#include "src/__support/macros/config.h" // LIBC_NAMESPACE_DECL #include "src/__support/macros/properties/architectures.h" // LIBC_TARGET_ARCH_IS_RISCV64 #include "src/string/memory_utils/generic/aligned_access.h" #include "src/string/memory_utils/utils.h" // Ptr, CPtr diff --git a/libc/src/string/memory_utils/riscv/inline_memcpy.h b/libc/src/string/memory_utils/riscv/inline_memcpy.h index 8eb87e0f38ce..e907ae4c079e 100644 --- a/libc/src/string/memory_utils/riscv/inline_memcpy.h +++ b/libc/src/string/memory_utils/riscv/inline_memcpy.h @@ -9,7 +9,7 @@ #define LIBC_SRC_STRING_MEMORY_UTILS_RISCV_INLINE_MEMCPY_H #include "src/__support/macros/attributes.h" // LIBC_INLINE -#include "src/__support/macros/config.h" +#include "src/__support/macros/config.h" // LIBC_NAMESPACE_DECL #include "src/__support/macros/properties/architectures.h" // LIBC_TARGET_ARCH_IS_RISCV64 #include "src/string/memory_utils/generic/aligned_access.h" #include "src/string/memory_utils/utils.h" // Ptr, CPtr diff --git a/libc/src/string/memory_utils/riscv/inline_memmove.h b/libc/src/string/memory_utils/riscv/inline_memmove.h index 28de4c240260..01a9fa5c4bbd 100644 --- a/libc/src/string/memory_utils/riscv/inline_memmove.h +++ b/libc/src/string/memory_utils/riscv/inline_memmove.h @@ -9,7 +9,7 @@ #define LLVM_LIBC_SRC_STRING_MEMORY_UTILS_RISCV_INLINE_MEMMOVE_H #include "src/__support/macros/attributes.h" // LIBC_INLINE -#include "src/__support/macros/config.h" +#include "src/__support/macros/config.h" // LIBC_NAMESPACE_DECL #include "src/__support/macros/properties/architectures.h" // LIBC_TARGET_ARCH_IS_RISCV64 #include "src/string/memory_utils/generic/byte_per_byte.h" #include "src/string/memory_utils/utils.h" // Ptr, CPtr diff --git a/libc/src/string/memory_utils/riscv/inline_memset.h b/libc/src/string/memory_utils/riscv/inline_memset.h index d6ab523f1641..09a7a765e4cb 100644 --- a/libc/src/string/memory_utils/riscv/inline_memset.h +++ b/libc/src/string/memory_utils/riscv/inline_memset.h @@ -9,7 +9,7 @@ #define LIBC_SRC_STRING_MEMORY_UTILS_RISCV_INLINE_MEMSET_H #include "src/__support/macros/attributes.h" // LIBC_INLINE -#include "src/__support/macros/config.h" +#include "src/__support/macros/config.h" // LIBC_NAMESPACE_DECL #include "src/__support/macros/properties/architectures.h" // LIBC_TARGET_ARCH_IS_RISCV64 #include "src/string/memory_utils/generic/aligned_access.h" #include "src/string/memory_utils/utils.h" // Ptr, CPtr diff --git a/libc/src/string/memory_utils/utils.h b/libc/src/string/memory_utils/utils.h index cae65bddd92f..5c9bc72208f8 100644 --- a/libc/src/string/memory_utils/utils.h +++ b/libc/src/string/memory_utils/utils.h @@ -14,7 +14,7 @@ #include "src/__support/CPP/type_traits.h" #include "src/__support/endian_internal.h" #include "src/__support/macros/attributes.h" // LIBC_INLINE -#include "src/__support/macros/config.h" +#include "src/__support/macros/config.h" // LIBC_NAMESPACE_DECL #include "src/__support/macros/properties/architectures.h" #include // size_t diff --git a/libc/src/string/memory_utils/x86_64/inline_bcmp.h b/libc/src/string/memory_utils/x86_64/inline_bcmp.h index cc54c4140ee6..8be391b42891 100644 --- a/libc/src/string/memory_utils/x86_64/inline_bcmp.h +++ b/libc/src/string/memory_utils/x86_64/inline_bcmp.h @@ -9,7 +9,7 @@ #define LLVM_LIBC_SRC_STRING_MEMORY_UTILS_X86_64_INLINE_BCMP_H #include "src/__support/macros/attributes.h" // LIBC_INLINE -#include "src/__support/macros/config.h" +#include "src/__support/macros/config.h" // LIBC_NAMESPACE_DECL #include "src/string/memory_utils/op_generic.h" #include "src/string/memory_utils/op_x86.h" #include "src/string/memory_utils/utils.h" // Ptr, CPtr diff --git a/libc/src/string/memory_utils/x86_64/inline_memset.h b/libc/src/string/memory_utils/x86_64/inline_memset.h index 9f8e584d2bbb..35719a89fa60 100644 --- a/libc/src/string/memory_utils/x86_64/inline_memset.h +++ b/libc/src/string/memory_utils/x86_64/inline_memset.h @@ -8,8 +8,8 @@ #ifndef LLVM_LIBC_SRC_STRING_MEMORY_UTILS_X86_64_INLINE_MEMSET_H #define LLVM_LIBC_SRC_STRING_MEMORY_UTILS_X86_64_INLINE_MEMSET_H -#include "src/__support/macros/attributes.h" // LIBC_INLINE -#include "src/__support/macros/config.h" +#include "src/__support/macros/attributes.h" // LIBC_INLINE, LIBC_INLINE_VAR +#include "src/__support/macros/config.h" // LIBC_NAMESPACE_DECL #include "src/string/memory_utils/op_generic.h" #include "src/string/memory_utils/op_x86.h" #include "src/string/memory_utils/utils.h" // Ptr, CPtr