[libc-commits] [libc] [libc] Fix all imports of src/string/memory_utils (PR #114939)
Krishna Pandey via libc-commits
libc-commits at lists.llvm.org
Tue Feb 4 05:23:52 PST 2025
https://github.com/krishna2803 updated https://github.com/llvm/llvm-project/pull/114939
>From 67a499ddef02a33fd03d3a42082c7985a069d9f2 Mon Sep 17 00:00:00 2001
From: krishna2803 <kpandey81930 at gmail.com>
Date: Fri, 31 Jan 2025 19:16:54 +0530
Subject: [PATCH 1/8] fix: change `endian.h` to `endian_internal.h`
---
libc/src/string/memory_utils/inline_bcmp.h | 2 +-
libc/src/string/memory_utils/inline_bzero.h | 2 +-
libc/src/string/memory_utils/inline_memmove.h | 2 +-
libc/src/string/memory_utils/inline_strcmp.h | 2 +-
libc/src/string/memory_utils/inline_strstr.h | 2 +-
libc/src/string/memory_utils/op_aarch64.h | 2 +-
libc/src/string/memory_utils/op_builtin.h | 2 +-
libc/src/string/memory_utils/op_generic.h | 3 ++-
libc/src/string/memory_utils/op_riscv.h | 2 +-
libc/src/string/memory_utils/op_x86.h | 2 +-
10 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/libc/src/string/memory_utils/inline_bcmp.h b/libc/src/string/memory_utils/inline_bcmp.h
index 14cf16ebb6b69f5..84470dac76fd6d3 100644
--- a/libc/src/string/memory_utils/inline_bcmp.h
+++ b/libc/src/string/memory_utils/inline_bcmp.h
@@ -10,7 +10,7 @@
#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/properties/architectures.h" // LIBC_TARGET_ARCH_IS_
#include <stddef.h> // size_t
diff --git a/libc/src/string/memory_utils/inline_bzero.h b/libc/src/string/memory_utils/inline_bzero.h
index 4a92e8b57a68e29..03bd29ab623c605 100644
--- a/libc/src/string/memory_utils/inline_bzero.h
+++ b/libc/src/string/memory_utils/inline_bzero.h
@@ -10,7 +10,7 @@
#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/string/memory_utils/inline_memset.h"
#include <stddef.h> // size_t
diff --git a/libc/src/string/memory_utils/inline_memmove.h b/libc/src/string/memory_utils/inline_memmove.h
index 85d0159701ece66..721f6f80e0f286b 100644
--- a/libc/src/string/memory_utils/inline_memmove.h
+++ b/libc/src/string/memory_utils/inline_memmove.h
@@ -9,7 +9,7 @@
#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 <stddef.h> // 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 281d5b14c6cbacf..0c3e9cf14c82349 100644
--- a/libc/src/string/memory_utils/inline_strcmp.h
+++ b/libc/src/string/memory_utils/inline_strcmp.h
@@ -9,7 +9,7 @@
#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 <stddef.h>
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 9c99e920b4b570a..1ff9a56e2887807 100644
--- a/libc/src/string/memory_utils/inline_strstr.h
+++ b/libc/src/string/memory_utils/inline_strstr.h
@@ -9,7 +9,7 @@
#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/string/memory_utils/inline_memmem.h"
#include "src/string/string_utils.h"
#include <stddef.h>
diff --git a/libc/src/string/memory_utils/op_aarch64.h b/libc/src/string/memory_utils/op_aarch64.h
index 1090ea2617f096f..3be7f6006cb8c7f 100644
--- a/libc/src/string/memory_utils/op_aarch64.h
+++ b/libc/src/string/memory_utils/op_aarch64.h
@@ -13,7 +13,7 @@
#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/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 d7c1b1f870115ac..a4d5f6d3f38f976 100644
--- a/libc/src/string/memory_utils/op_builtin.h
+++ b/libc/src/string/memory_utils/op_builtin.h
@@ -16,7 +16,7 @@
#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/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 da20a84dede4d14..cb17680a67d035b 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 2d211de0facfc91..b6349505f976e02 100644
--- a/libc/src/string/memory_utils/op_riscv.h
+++ b/libc/src/string/memory_utils/op_riscv.h
@@ -12,7 +12,7 @@
#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/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 309610e4ad6307a..90094b4cca197d8 100644
--- a/libc/src/string/memory_utils/op_x86.h
+++ b/libc/src/string/memory_utils/op_x86.h
@@ -12,7 +12,7 @@
#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/properties/architectures.h"
#if defined(LIBC_TARGET_ARCH_IS_X86)
>From 58400f735ce5bf159d8a7141a87453744ca74d1c Mon Sep 17 00:00:00 2001
From: krishna2803 <kpandey81930 at gmail.com>
Date: Fri, 31 Jan 2025 19:18:28 +0530
Subject: [PATCH 2/8] fix: change CMakeLists.txt
---
libc/src/__support/CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libc/src/__support/CMakeLists.txt b/libc/src/__support/CMakeLists.txt
index 0e0556f4eecfd6b..17f03a6b6c4a08f 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(
>From 7feecec7ab8b4741111442e9bcc4f0c2a5bbed88 Mon Sep 17 00:00:00 2001
From: krishna2803 <kpandey81930 at gmail.com>
Date: Sat, 9 Nov 2024 04:15:12 +0530
Subject: [PATCH 3/8] Fix more imports
---
libc/src/string/allocating_string_utils.h | 2 +-
libc/src/string/memory_utils/aarch64/inline_bcmp.h | 1 -
libc/src/string/memory_utils/aarch64/inline_memset.h | 1 -
libc/src/string/memory_utils/generic/builtin.h | 1 -
libc/src/string/memory_utils/inline_memmem.h | 1 -
libc/src/string/memory_utils/riscv/inline_bcmp.h | 1 -
libc/src/string/memory_utils/riscv/inline_memcmp.h | 1 -
libc/src/string/memory_utils/riscv/inline_memcpy.h | 1 -
libc/src/string/memory_utils/riscv/inline_memmove.h | 1 -
libc/src/string/memory_utils/riscv/inline_memset.h | 1 -
libc/src/string/memory_utils/utils.h | 1 -
libc/src/string/memory_utils/x86_64/inline_bcmp.h | 1 -
libc/src/string/memory_utils/x86_64/inline_memset.h | 1 -
13 files changed, 1 insertion(+), 13 deletions(-)
diff --git a/libc/src/string/allocating_string_utils.h b/libc/src/string/allocating_string_utils.h
index b3a8663c2f477c8..af279db7120d6db 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/attributes.h"
#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 93196415f26625e..12ea15dfdc63834 100644
--- a/libc/src/string/memory_utils/aarch64/inline_bcmp.h
+++ b/libc/src/string/memory_utils/aarch64/inline_bcmp.h
@@ -9,7 +9,6 @@
#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/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 a2c05534aa330ea..6ec17e9cf6cecce 100644
--- a/libc/src/string/memory_utils/aarch64/inline_memset.h
+++ b/libc/src/string/memory_utils/aarch64/inline_memset.h
@@ -9,7 +9,6 @@
#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/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 5670a4e610565b7..274e8e52a1dbb4e 100644
--- a/libc/src/string/memory_utils/generic/builtin.h
+++ b/libc/src/string/memory_utils/generic/builtin.h
@@ -10,7 +10,6 @@
#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/string/memory_utils/utils.h" // Ptr, CPtr
#include <stddef.h> // size_t
diff --git a/libc/src/string/memory_utils/inline_memmem.h b/libc/src/string/memory_utils/inline_memmem.h
index 15e3d633985d615..6f62d4a10e2c79a 100644
--- a/libc/src/string/memory_utils/inline_memmem.h
+++ b/libc/src/string/memory_utils/inline_memmem.h
@@ -10,7 +10,6 @@
#define LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_MEMMEM_H
#include "src/__support/macros/attributes.h"
-#include "src/__support/macros/config.h"
#include <stddef.h>
diff --git a/libc/src/string/memory_utils/riscv/inline_bcmp.h b/libc/src/string/memory_utils/riscv/inline_bcmp.h
index 4bdde27cd16be25..1838e8c4229d9a0 100644
--- a/libc/src/string/memory_utils/riscv/inline_bcmp.h
+++ b/libc/src/string/memory_utils/riscv/inline_bcmp.h
@@ -9,7 +9,6 @@
#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/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 ca834952d331eab..9bafb45f6d3397d 100644
--- a/libc/src/string/memory_utils/riscv/inline_memcmp.h
+++ b/libc/src/string/memory_utils/riscv/inline_memcmp.h
@@ -9,7 +9,6 @@
#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/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 8eb87e0f38ce5ab..4da835acfbfa020 100644
--- a/libc/src/string/memory_utils/riscv/inline_memcpy.h
+++ b/libc/src/string/memory_utils/riscv/inline_memcpy.h
@@ -9,7 +9,6 @@
#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/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 28de4c240260d4c..d6e2e4ebd5fd804 100644
--- a/libc/src/string/memory_utils/riscv/inline_memmove.h
+++ b/libc/src/string/memory_utils/riscv/inline_memmove.h
@@ -9,7 +9,6 @@
#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/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 d6ab523f164144c..279c3bfef7a1a74 100644
--- a/libc/src/string/memory_utils/riscv/inline_memset.h
+++ b/libc/src/string/memory_utils/riscv/inline_memset.h
@@ -9,7 +9,6 @@
#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/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 cae65bddd92f6e9..6680eaa0961daae 100644
--- a/libc/src/string/memory_utils/utils.h
+++ b/libc/src/string/memory_utils/utils.h
@@ -14,7 +14,6 @@
#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/properties/architectures.h"
#include <stddef.h> // 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 cc54c4140ee6e65..ad75d57dfc43ef9 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,6 @@
#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/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 9f8e584d2bbb454..fd8d7f35d97f465 100644
--- a/libc/src/string/memory_utils/x86_64/inline_memset.h
+++ b/libc/src/string/memory_utils/x86_64/inline_memset.h
@@ -9,7 +9,6 @@
#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/string/memory_utils/op_generic.h"
#include "src/string/memory_utils/op_x86.h"
#include "src/string/memory_utils/utils.h" // Ptr, CPtr
>From 6dff9cdfb6c78a8acd697f5b706a8225233cea05 Mon Sep 17 00:00:00 2001
From: krishna2803 <kpandey81930 at gmail.com>
Date: Fri, 31 Jan 2025 19:19:32 +0530
Subject: [PATCH 4/8] chore: add LIBC_NAMESPACE_DECL
---
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 | 1 +
libc/src/string/memory_utils/generic/builtin.h | 1 +
libc/src/string/memory_utils/inline_bcmp.h | 1 +
libc/src/string/memory_utils/inline_bzero.h | 1 +
libc/src/string/memory_utils/inline_memmem.h | 3 ++-
libc/src/string/memory_utils/inline_memmove.h | 1 +
libc/src/string/memory_utils/inline_strcmp.h | 1 +
libc/src/string/memory_utils/inline_strstr.h | 1 +
libc/src/string/memory_utils/op_aarch64.h | 1 +
libc/src/string/memory_utils/op_builtin.h | 1 +
libc/src/string/memory_utils/op_generic.h | 2 +-
libc/src/string/memory_utils/op_riscv.h | 1 +
libc/src/string/memory_utils/op_x86.h | 1 +
libc/src/string/memory_utils/riscv/inline_bcmp.h | 1 +
libc/src/string/memory_utils/riscv/inline_memcmp.h | 1 +
libc/src/string/memory_utils/riscv/inline_memcpy.h | 1 +
libc/src/string/memory_utils/riscv/inline_memmove.h | 1 +
libc/src/string/memory_utils/riscv/inline_memset.h | 1 +
libc/src/string/memory_utils/utils.h | 1 +
libc/src/string/memory_utils/x86_64/inline_bcmp.h | 1 +
libc/src/string/memory_utils/x86_64/inline_memset.h | 3 ++-
24 files changed, 26 insertions(+), 6 deletions(-)
diff --git a/libc/src/dirent/readdir.h b/libc/src/dirent/readdir.h
index 2dcf5360ebd35c7..bc46a1bbfbf4a05 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 <dirent.h>
namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/string/allocating_string_utils.h b/libc/src/string/allocating_string_utils.h
index af279db7120d6db..1dece510e79694c 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/attributes.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 12ea15dfdc63834..11c51b251a6e86f 100644
--- a/libc/src/string/memory_utils/aarch64/inline_bcmp.h
+++ b/libc/src/string/memory_utils/aarch64/inline_bcmp.h
@@ -8,7 +8,7 @@
#ifndef LIBC_SRC_STRING_MEMORY_UTILS_AARCH64_INLINE_BCMP_H
#define LIBC_SRC_STRING_MEMORY_UTILS_AARCH64_INLINE_BCMP_H
-#include "src/__support/macros/attributes.h" // LIBC_INLINE
+#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 6ec17e9cf6cecce..efcbfd070598332 100644
--- a/libc/src/string/memory_utils/aarch64/inline_memset.h
+++ b/libc/src/string/memory_utils/aarch64/inline_memset.h
@@ -9,6 +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" // 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 274e8e52a1dbb4e..2b9ecc0c046eb66 100644
--- a/libc/src/string/memory_utils/generic/builtin.h
+++ b/libc/src/string/memory_utils/generic/builtin.h
@@ -10,6 +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" // LIBC_NAMESPACE_DECL
#include "src/string/memory_utils/utils.h" // Ptr, CPtr
#include <stddef.h> // size_t
diff --git a/libc/src/string/memory_utils/inline_bcmp.h b/libc/src/string/memory_utils/inline_bcmp.h
index 84470dac76fd6d3..52c738d3a4ce276 100644
--- a/libc/src/string/memory_utils/inline_bcmp.h
+++ b/libc/src/string/memory_utils/inline_bcmp.h
@@ -11,6 +11,7 @@
#include "src/__support/common.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 <stddef.h> // size_t
diff --git a/libc/src/string/memory_utils/inline_bzero.h b/libc/src/string/memory_utils/inline_bzero.h
index 03bd29ab623c605..a131b68725de714 100644
--- a/libc/src/string/memory_utils/inline_bzero.h
+++ b/libc/src/string/memory_utils/inline_bzero.h
@@ -11,6 +11,7 @@
#include "src/__support/common.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 <stddef.h> // size_t
diff --git a/libc/src/string/memory_utils/inline_memmem.h b/libc/src/string/memory_utils/inline_memmem.h
index 6f62d4a10e2c79a..1e9649c6e65e348 100644
--- a/libc/src/string/memory_utils/inline_memmem.h
+++ b/libc/src/string/memory_utils/inline_memmem.h
@@ -9,7 +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/attributes.h" // LIBC_INLINE
+#include "src/__support/macros/config.h" // LIBC_NAMESPACE_DECL
#include <stddef.h>
diff --git a/libc/src/string/memory_utils/inline_memmove.h b/libc/src/string/memory_utils/inline_memmove.h
index 721f6f80e0f286b..84671c5c1797e2c 100644
--- a/libc/src/string/memory_utils/inline_memmove.h
+++ b/libc/src/string/memory_utils/inline_memmove.h
@@ -10,6 +10,7 @@
#define LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_MEMMOVE_H
#include "src/__support/macros/attributes.h" // LIBC_INLINE
+#include "src/__support/macros/config.h" // LIBC_NAMESPACE_DECL
#include <stddef.h> // 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 0c3e9cf14c82349..6758e79ae9ca396 100644
--- a/libc/src/string/memory_utils/inline_strcmp.h
+++ b/libc/src/string/memory_utils/inline_strcmp.h
@@ -10,6 +10,7 @@
#define LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_STRCMP_H
#include "src/__support/macros/attributes.h" // LIBC_INLINE
+#include "src/__support/macros/config.h" // LIBC_NAMESPACE_DECL
#include <stddef.h>
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 1ff9a56e2887807..5495cc4803ec94e 100644
--- a/libc/src/string/memory_utils/inline_strstr.h
+++ b/libc/src/string/memory_utils/inline_strstr.h
@@ -10,6 +10,7 @@
#define LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_STRSTR_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 <stddef.h>
diff --git a/libc/src/string/memory_utils/op_aarch64.h b/libc/src/string/memory_utils/op_aarch64.h
index 3be7f6006cb8c7f..868c64474c0b434 100644
--- a/libc/src/string/memory_utils/op_aarch64.h
+++ b/libc/src/string/memory_utils/op_aarch64.h
@@ -14,6 +14,7 @@
#define LLVM_LIBC_SRC_STRING_MEMORY_UTILS_OP_AARCH64_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 a4d5f6d3f38f976..27b621d97f01a0b 100644
--- a/libc/src/string/memory_utils/op_builtin.h
+++ b/libc/src/string/memory_utils/op_builtin.h
@@ -17,6 +17,7 @@
#include "src/__support/CPP/type_traits.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 cb17680a67d035b..9349cfdd1d02018 100644
--- a/libc/src/string/memory_utils/op_generic.h
+++ b/libc/src/string/memory_utils/op_generic.h
@@ -28,7 +28,7 @@
#include "src/__support/common.h"
#include "src/__support/endian_internal.h"
#include "src/__support/macros/attributes.h" // LIBC_INLINE
-#include "src/__support/macros/config.h" // LIBC_NAMESPACE_DECL
+#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 b6349505f976e02..4292d7a627a54af 100644
--- a/libc/src/string/memory_utils/op_riscv.h
+++ b/libc/src/string/memory_utils/op_riscv.h
@@ -13,6 +13,7 @@
#define LLVM_LIBC_SRC_STRING_MEMORY_UTILS_OP_RISCV_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 90094b4cca197d8..8bd84120c4ffaa9 100644
--- a/libc/src/string/memory_utils/op_x86.h
+++ b/libc/src/string/memory_utils/op_x86.h
@@ -13,6 +13,7 @@
#define LLVM_LIBC_SRC_STRING_MEMORY_UTILS_OP_X86_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 1838e8c4229d9a0..666ad6382412e54 100644
--- a/libc/src/string/memory_utils/riscv/inline_bcmp.h
+++ b/libc/src/string/memory_utils/riscv/inline_bcmp.h
@@ -9,6 +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" // 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 9bafb45f6d3397d..c49e8d0a4ff2f32 100644
--- a/libc/src/string/memory_utils/riscv/inline_memcmp.h
+++ b/libc/src/string/memory_utils/riscv/inline_memcmp.h
@@ -9,6 +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" // 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 4da835acfbfa020..e907ae4c079e03a 100644
--- a/libc/src/string/memory_utils/riscv/inline_memcpy.h
+++ b/libc/src/string/memory_utils/riscv/inline_memcpy.h
@@ -9,6 +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" // 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 d6e2e4ebd5fd804..01a9fa5c4bbdcc8 100644
--- a/libc/src/string/memory_utils/riscv/inline_memmove.h
+++ b/libc/src/string/memory_utils/riscv/inline_memmove.h
@@ -9,6 +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" // 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 279c3bfef7a1a74..09a7a765e4cb6cd 100644
--- a/libc/src/string/memory_utils/riscv/inline_memset.h
+++ b/libc/src/string/memory_utils/riscv/inline_memset.h
@@ -9,6 +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" // 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 6680eaa0961daae..5c9bc72208f85c1 100644
--- a/libc/src/string/memory_utils/utils.h
+++ b/libc/src/string/memory_utils/utils.h
@@ -14,6 +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" // LIBC_NAMESPACE_DECL
#include "src/__support/macros/properties/architectures.h"
#include <stddef.h> // 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 ad75d57dfc43ef9..8be391b42891055 100644
--- a/libc/src/string/memory_utils/x86_64/inline_bcmp.h
+++ b/libc/src/string/memory_utils/x86_64/inline_bcmp.h
@@ -9,6 +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" // 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 fd8d7f35d97f465..cd24d02363b72b3 100644
--- a/libc/src/string/memory_utils/x86_64/inline_memset.h
+++ b/libc/src/string/memory_utils/x86_64/inline_memset.h
@@ -8,7 +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/attributes.h" // 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
>From 9c7f5811290327aa01c606626fba9d00930f9ed9 Mon Sep 17 00:00:00 2001
From: krishna2803 <kpandey81930 at gmail.com>
Date: Sun, 26 Jan 2025 19:53:38 +0530
Subject: [PATCH 5/8] add: comments for `LIBC_INLINE`
---
libc/src/string/memory_utils/aarch64/inline_bcmp.h | 2 +-
libc/src/string/memory_utils/x86_64/inline_memset.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/libc/src/string/memory_utils/aarch64/inline_bcmp.h b/libc/src/string/memory_utils/aarch64/inline_bcmp.h
index 11c51b251a6e86f..351a172c0b87538 100644
--- a/libc/src/string/memory_utils/aarch64/inline_bcmp.h
+++ b/libc/src/string/memory_utils/aarch64/inline_bcmp.h
@@ -8,7 +8,7 @@
#ifndef LIBC_SRC_STRING_MEMORY_UTILS_AARCH64_INLINE_BCMP_H
#define LIBC_SRC_STRING_MEMORY_UTILS_AARCH64_INLINE_BCMP_H
-#include "src/__support/macros/config.h" // LIBC_NAMESPACE_DECL
+#include "src/__support/macros/attributes.h" // LIBC_INLINE, 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/x86_64/inline_memset.h b/libc/src/string/memory_utils/x86_64/inline_memset.h
index cd24d02363b72b3..35719a89fa60049 100644
--- a/libc/src/string/memory_utils/x86_64/inline_memset.h
+++ b/libc/src/string/memory_utils/x86_64/inline_memset.h
@@ -8,7 +8,7 @@
#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_VAR
+#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"
>From 327c70d9fdd74abf729bb156c84fabd1d558af85 Mon Sep 17 00:00:00 2001
From: krishna2803 <kpandey81930 at gmail.com>
Date: Fri, 31 Jan 2025 19:23:52 +0530
Subject: [PATCH 6/8] chore: formatting
---
libc/src/string/memory_utils/aarch64/inline_bcmp.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libc/src/string/memory_utils/aarch64/inline_bcmp.h b/libc/src/string/memory_utils/aarch64/inline_bcmp.h
index 351a172c0b87538..14081e083cd5bd1 100644
--- a/libc/src/string/memory_utils/aarch64/inline_bcmp.h
+++ b/libc/src/string/memory_utils/aarch64/inline_bcmp.h
@@ -8,7 +8,7 @@
#ifndef LIBC_SRC_STRING_MEMORY_UTILS_AARCH64_INLINE_BCMP_H
#define LIBC_SRC_STRING_MEMORY_UTILS_AARCH64_INLINE_BCMP_H
-#include "src/__support/macros/attributes.h" // LIBC_INLINE, LIBC_NAMESPACE_DECL
+#include "src/__support/macros/attributes.h" // LIBC_INLINE, 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"
>From b5262b2a1be0f24bf8e7e5009f96246cbd9afd32 Mon Sep 17 00:00:00 2001
From: krishna2803 <kpandey81930 at gmail.com>
Date: Tue, 4 Feb 2025 18:38:48 +0530
Subject: [PATCH 7/8] fix: re-add `macros/config.h` to
`memory_utils/aarch64/inline_bcmp.h`
---
libc/src/string/memory_utils/aarch64/inline_bcmp.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/libc/src/string/memory_utils/aarch64/inline_bcmp.h b/libc/src/string/memory_utils/aarch64/inline_bcmp.h
index 14081e083cd5bd1..63bef748cccb60e 100644
--- a/libc/src/string/memory_utils/aarch64/inline_bcmp.h
+++ b/libc/src/string/memory_utils/aarch64/inline_bcmp.h
@@ -8,7 +8,8 @@
#ifndef LIBC_SRC_STRING_MEMORY_UTILS_AARCH64_INLINE_BCMP_H
#define LIBC_SRC_STRING_MEMORY_UTILS_AARCH64_INLINE_BCMP_H
-#include "src/__support/macros/attributes.h" // LIBC_INLINE, LIBC_NAMESPACE_DECL
+#include "src/__support/macros/attributes.h" // LIBC_INLINE
+#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"
>From 77b35b87c6f7bb0047413b3daab17bec44879cf3 Mon Sep 17 00:00:00 2001
From: krishna2803 <kpandey81930 at gmail.com>
Date: Tue, 4 Feb 2025 18:50:27 +0530
Subject: [PATCH 8/8] fix: cmake rules
---
libc/src/__support/FPUtil/CMakeLists.txt | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/libc/src/__support/FPUtil/CMakeLists.txt b/libc/src/__support/FPUtil/CMakeLists.txt
index 522b4afefd48d6c..bfe0170f09fd975 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
)
More information about the libc-commits
mailing list