[libc-commits] [libc] 1f57834 - [libc][NFC] Rename files
Guillaume Chatelet via libc-commits
libc-commits at lists.llvm.org
Wed Jul 19 02:06:38 PDT 2023
Author: Guillaume Chatelet
Date: 2023-07-19T09:06:29Z
New Revision: 1f5783474f90eabb182acb7936ff11427b458f11
URL: https://github.com/llvm/llvm-project/commit/1f5783474f90eabb182acb7936ff11427b458f11
DIFF: https://github.com/llvm/llvm-project/commit/1f5783474f90eabb182acb7936ff11427b458f11.diff
LOG: [libc][NFC] Rename files
This patch mostly renames files so it better reflects the function they declare.
Reviewed By: michaelrj
Differential Revision: https://reviews.llvm.org/D155607
Added:
libc/src/string/memory_utils/aarch64/inline_bcmp.h
libc/src/string/memory_utils/aarch64/inline_memcmp.h
libc/src/string/memory_utils/aarch64/inline_memcpy.h
libc/src/string/memory_utils/aarch64/inline_memmove.h
libc/src/string/memory_utils/aarch64/inline_memset.h
libc/src/string/memory_utils/inline_bcmp.h
libc/src/string/memory_utils/inline_bzero.h
libc/src/string/memory_utils/inline_memcmp.h
libc/src/string/memory_utils/inline_memcpy.h
libc/src/string/memory_utils/inline_memmem.h
libc/src/string/memory_utils/inline_memmove.h
libc/src/string/memory_utils/inline_memset.h
libc/src/string/memory_utils/inline_strcmp.h
libc/src/string/memory_utils/inline_strstr.h
libc/src/string/memory_utils/riscv/inline_bcmp.h
libc/src/string/memory_utils/riscv/inline_memcmp.h
libc/src/string/memory_utils/riscv/inline_memcpy.h
libc/src/string/memory_utils/riscv/inline_memmove.h
libc/src/string/memory_utils/riscv/inline_memset.h
libc/src/string/memory_utils/x86_64/inline_bcmp.h
libc/src/string/memory_utils/x86_64/inline_memcmp.h
libc/src/string/memory_utils/x86_64/inline_memcpy.h
libc/src/string/memory_utils/x86_64/inline_memmove.h
libc/src/string/memory_utils/x86_64/inline_memset.h
Modified:
libc/src/__support/CPP/CMakeLists.txt
libc/src/__support/CPP/string.h
libc/src/__support/OSUtil/gpu/CMakeLists.txt
libc/src/__support/OSUtil/gpu/io.cpp
libc/src/__support/RPC/rpc.h
libc/src/stdio/printf_core/CMakeLists.txt
libc/src/stdio/printf_core/string_writer.cpp
libc/src/stdio/printf_core/string_writer.h
libc/src/string/CMakeLists.txt
libc/src/string/allocating_string_utils.h
libc/src/string/bcmp.cpp
libc/src/string/bcopy.cpp
libc/src/string/bzero.cpp
libc/src/string/memcmp.cpp
libc/src/string/memcpy.cpp
libc/src/string/memmem.cpp
libc/src/string/memmove.cpp
libc/src/string/memory_utils/CMakeLists.txt
libc/src/string/mempcpy.cpp
libc/src/string/memset.cpp
libc/src/string/stpncpy.cpp
libc/src/string/strcasecmp.cpp
libc/src/string/strcasestr.cpp
libc/src/string/strcmp.cpp
libc/src/string/strcpy.cpp
libc/src/string/strdup.cpp
libc/src/string/string_utils.h
libc/src/string/strncasecmp.cpp
libc/src/string/strncmp.cpp
libc/src/string/strndup.cpp
libc/src/string/strstr.cpp
libc/src/string/strxfrm.cpp
libc/startup/linux/aarch64/CMakeLists.txt
libc/startup/linux/aarch64/start.cpp
libc/startup/linux/riscv64/CMakeLists.txt
libc/startup/linux/riscv64/start.cpp
libc/startup/linux/x86_64/CMakeLists.txt
libc/startup/linux/x86_64/start.cpp
libc/test/integration/startup/gpu/rpc_stream_test.cpp
utils/bazel/llvm-project-overlay/libc/BUILD.bazel
Removed:
libc/src/string/memory_utils/aarch64/bcmp_implementations.h
libc/src/string/memory_utils/aarch64/memcmp_implementations.h
libc/src/string/memory_utils/aarch64/memcpy_implementations.h
libc/src/string/memory_utils/aarch64/memmove_implementations.h
libc/src/string/memory_utils/aarch64/memset_implementations.h
libc/src/string/memory_utils/bcmp_implementations.h
libc/src/string/memory_utils/bzero_implementations.h
libc/src/string/memory_utils/memcmp_implementations.h
libc/src/string/memory_utils/memcpy_implementations.h
libc/src/string/memory_utils/memmem_implementations.h
libc/src/string/memory_utils/memmove_implementations.h
libc/src/string/memory_utils/memset_implementations.h
libc/src/string/memory_utils/riscv/bcmp_implementations.h
libc/src/string/memory_utils/riscv/memcmp_implementations.h
libc/src/string/memory_utils/riscv/memcpy_implementations.h
libc/src/string/memory_utils/riscv/memmove_implementations.h
libc/src/string/memory_utils/riscv/memset_implementations.h
libc/src/string/memory_utils/strcmp_implementations.h
libc/src/string/memory_utils/strstr_implementations.h
libc/src/string/memory_utils/x86_64/bcmp_implementations.h
libc/src/string/memory_utils/x86_64/memcmp_implementations.h
libc/src/string/memory_utils/x86_64/memcpy_implementations.h
libc/src/string/memory_utils/x86_64/memmove_implementations.h
libc/src/string/memory_utils/x86_64/memset_implementations.h
################################################################################
diff --git a/libc/src/__support/CPP/CMakeLists.txt b/libc/src/__support/CPP/CMakeLists.txt
index 147e84c0e39aaf..1e714cbfef35e2 100644
--- a/libc/src/__support/CPP/CMakeLists.txt
+++ b/libc/src/__support/CPP/CMakeLists.txt
@@ -64,8 +64,8 @@ add_header_library(
.string_view
libc.src.__support.common
libc.src.__support.integer_to_string
- libc.src.string.memory_utils.memcpy_implementation
- libc.src.string.memory_utils.memset_implementation
+ libc.src.string.memory_utils.inline_memcpy
+ libc.src.string.memory_utils.inline_memset
libc.src.string.string_utils
)
diff --git a/libc/src/__support/CPP/string.h b/libc/src/__support/CPP/string.h
index a5611b9af5380b..f050defe498ced 100644
--- a/libc/src/__support/CPP/string.h
+++ b/libc/src/__support/CPP/string.h
@@ -11,8 +11,8 @@
#include "src/__support/CPP/string_view.h"
#include "src/__support/integer_to_string.h" // IntegerToString
-#include "src/string/memory_utils/memcpy_implementations.h"
-#include "src/string/memory_utils/memset_implementations.h"
+#include "src/string/memory_utils/inline_memcpy.h"
+#include "src/string/memory_utils/inline_memset.h"
#include "src/string/string_utils.h" // string_length
#include <stddef.h> // size_t
diff --git a/libc/src/__support/OSUtil/gpu/CMakeLists.txt b/libc/src/__support/OSUtil/gpu/CMakeLists.txt
index 01837d7ae0a2f2..8e892a7000c9b3 100644
--- a/libc/src/__support/OSUtil/gpu/CMakeLists.txt
+++ b/libc/src/__support/OSUtil/gpu/CMakeLists.txt
@@ -10,5 +10,5 @@ add_object_library(
libc.src.__support.common
libc.src.__support.CPP.string_view
libc.src.__support.RPC.rpc_client
- libc.src.string.memory_utils.memcpy_implementation
+ libc.src.string.memory_utils.inline_memcpy
)
diff --git a/libc/src/__support/OSUtil/gpu/io.cpp b/libc/src/__support/OSUtil/gpu/io.cpp
index fcbadf2a8fd515..09b54526ab95df 100644
--- a/libc/src/__support/OSUtil/gpu/io.cpp
+++ b/libc/src/__support/OSUtil/gpu/io.cpp
@@ -10,7 +10,6 @@
#include "src/__support/CPP/string_view.h"
#include "src/__support/RPC/rpc_client.h"
-#include "src/string/memory_utils/memcpy_implementations.h"
namespace __llvm_libc {
diff --git a/libc/src/__support/RPC/rpc.h b/libc/src/__support/RPC/rpc.h
index 2886e0655635d6..a252002f2bcc54 100644
--- a/libc/src/__support/RPC/rpc.h
+++ b/libc/src/__support/RPC/rpc.h
@@ -23,7 +23,7 @@
#include "src/__support/CPP/functional.h"
#include "src/__support/CPP/optional.h"
#include "src/__support/GPU/utils.h"
-#include "src/string/memory_utils/memcpy_implementations.h"
+#include "src/string/memory_utils/inline_memcpy.h"
#include <stdint.h>
diff --git a/libc/src/stdio/printf_core/CMakeLists.txt b/libc/src/stdio/printf_core/CMakeLists.txt
index b124a11bc0a54c..e41ef20a733b6a 100644
--- a/libc/src/stdio/printf_core/CMakeLists.txt
+++ b/libc/src/stdio/printf_core/CMakeLists.txt
@@ -53,10 +53,10 @@ add_object_library(
HDRS
string_writer.h
DEPENDS
- libc.src.__support.CPP.string_view
- libc.src.string.memory_utils.memcpy_implementation
- libc.src.string.memory_utils.memset_implementation
.core_structs
+ libc.src.__support.CPP.string_view
+ libc.src.string.memory_utils.inline_memcpy
+ libc.src.string.memory_utils.inline_memset
)
add_object_library(
@@ -130,11 +130,11 @@ add_header_library(
HDRS
file_writer.h
DEPENDS
+ .core_structs
libc.include.stdio
- libc.src.__support.File.file
libc.src.__support.CPP.string_view
- libc.src.string.memory_utils.memset_implementation
- .core_structs
+ libc.src.__support.File.file
+ libc.src.string.memory_utils.inline_memset
)
add_header_library(
diff --git a/libc/src/stdio/printf_core/string_writer.cpp b/libc/src/stdio/printf_core/string_writer.cpp
index 472573d4a8137e..f89e9d11b00eab 100644
--- a/libc/src/stdio/printf_core/string_writer.cpp
+++ b/libc/src/stdio/printf_core/string_writer.cpp
@@ -9,8 +9,8 @@
#include "src/stdio/printf_core/string_writer.h"
#include "src/__support/CPP/string_view.h"
#include "src/stdio/printf_core/core_structs.h"
-#include "src/string/memory_utils/memcpy_implementations.h"
-#include "src/string/memory_utils/memset_implementations.h"
+#include "src/string/memory_utils/inline_memcpy.h"
+#include "src/string/memory_utils/inline_memset.h"
#include <stddef.h>
namespace __llvm_libc {
diff --git a/libc/src/stdio/printf_core/string_writer.h b/libc/src/stdio/printf_core/string_writer.h
index 9d2578904c734d..8c5ccabee510d2 100644
--- a/libc/src/stdio/printf_core/string_writer.h
+++ b/libc/src/stdio/printf_core/string_writer.h
@@ -10,7 +10,6 @@
#define LLVM_LIBC_SRC_STDIO_PRINTF_CORE_STRING_WRITER_H
#include "src/__support/CPP/string_view.h"
-#include "src/string/memory_utils/memcpy_implementations.h"
#include <stddef.h>
namespace __llvm_libc {
diff --git a/libc/src/string/CMakeLists.txt b/libc/src/string/CMakeLists.txt
index b010190d67c1f0..b073a62f957a73 100644
--- a/libc/src/string/CMakeLists.txt
+++ b/libc/src/string/CMakeLists.txt
@@ -5,11 +5,11 @@ add_header_library(
HDRS
string_utils.h
DEPENDS
+ .memory_utils.inline_bzero
+ .memory_utils.inline_memcpy
libc.include.stdlib
- libc.src.__support.CPP.bitset
libc.src.__support.common
- .memory_utils.memcpy_implementation
- .memory_utils.bzero_implementation
+ libc.src.__support.CPP.bitset
)
add_header_library(
@@ -17,7 +17,7 @@ add_header_library(
HDRS
allocating_string_utils.h
DEPENDS
- .memory_utils.memcpy_implementation
+ .memory_utils.inline_memcpy
libc.include.stdlib
libc.src.__support.CPP.optional
libc.src.__support.macros.config
@@ -56,7 +56,7 @@ add_entrypoint_object(
HDRS
mempcpy.h
DEPENDS
- .memory_utils.memcpy_implementation
+ .memory_utils.inline_memcpy
)
add_entrypoint_object(
@@ -66,7 +66,7 @@ add_entrypoint_object(
HDRS
memmem.h
DEPENDS
- .memory_utils.memmem_implementation
+ .memory_utils.inline_memmem
)
add_entrypoint_object(
@@ -115,7 +115,7 @@ add_entrypoint_object(
HDRS
stpncpy.h
DEPENDS
- .memory_utils.bzero_implementation
+ .memory_utils.inline_bzero
)
add_entrypoint_object(
@@ -156,7 +156,7 @@ add_entrypoint_object(
HDRS
strcmp.h
DEPENDS
- .memory_utils.strcmp_implementation
+ .memory_utils.inline_strcmp
)
add_entrypoint_object(
@@ -166,7 +166,7 @@ add_entrypoint_object(
HDRS
strcasecmp.h
DEPENDS
- .memory_utils.strcmp_implementation
+ .memory_utils.inline_strcmp
libc.src.__support.ctype_utils
)
@@ -177,7 +177,7 @@ add_entrypoint_object(
HDRS
strcasestr.h
DEPENDS
- .memory_utils.strstr_implementation
+ .memory_utils.inline_strstr
libc.src.__support.ctype_utils
)
@@ -196,7 +196,7 @@ add_entrypoint_object(
HDRS
strcpy.h
DEPENDS
- .memory_utils.memcpy_implementation
+ .memory_utils.inline_memcpy
.string_utils
)
@@ -217,7 +217,7 @@ add_entrypoint_object(
HDRS
strdup.h
DEPENDS
- .memory_utils.memcpy_implementation
+ .memory_utils.inline_memcpy
.string_utils
libc.include.stdlib
libc.src.errno.errno
@@ -294,7 +294,7 @@ add_entrypoint_object(
HDRS
strncmp.h
DEPENDS
- .memory_utils.strcmp_implementation
+ .memory_utils.inline_strcmp
)
add_entrypoint_object(
@@ -304,7 +304,7 @@ add_entrypoint_object(
HDRS
strncasecmp.h
DEPENDS
- .memory_utils.strcmp_implementation
+ .memory_utils.inline_strcmp
libc.src.__support.ctype_utils
)
@@ -323,7 +323,7 @@ add_entrypoint_object(
HDRS
strndup.h
DEPENDS
- .memory_utils.memcpy_implementation
+ .memory_utils.inline_memcpy
.string_utils
libc.include.stdlib
libc.src.__support.CPP.new
@@ -396,7 +396,7 @@ add_entrypoint_object(
HDRS
strstr.h
DEPENDS
- .memory_utils.strstr_implementation
+ .memory_utils.inline_strstr
)
add_entrypoint_object(
@@ -427,7 +427,7 @@ add_entrypoint_object(
strxfrm.h
DEPENDS
.string_utils
- .memory_utils.memcpy_implementation
+ .memory_utils.inline_memcpy
)
# Helper to define a function with multiple implementations
@@ -504,7 +504,7 @@ function(add_bzero bzero_name)
SRCS ${LIBC_SOURCE_DIR}/src/string/bzero.cpp
HDRS ${LIBC_SOURCE_DIR}/src/string/bzero.h
DEPENDS
- .memory_utils.memset_implementation
+ .memory_utils.inline_memset
libc.include.string
${ARGN}
)
@@ -531,7 +531,7 @@ function(add_memcmp memcmp_name)
SRCS ${LIBC_SOURCE_DIR}/src/string/memcmp.cpp
HDRS ${LIBC_SOURCE_DIR}/src/string/memcmp.h
DEPENDS
- .memory_utils.memcmp_implementation
+ .memory_utils.inline_memcmp
libc.include.string
${ARGN}
)
@@ -561,7 +561,7 @@ function(add_memcpy memcpy_name)
SRCS ${LIBC_SOURCE_DIR}/src/string/memcpy.cpp
HDRS ${LIBC_SOURCE_DIR}/src/string/memcpy.h
DEPENDS
- .memory_utils.memcpy_implementation
+ .memory_utils.inline_memcpy
libc.include.string
${ARGN}
)
@@ -595,7 +595,7 @@ function(add_memmove memmove_name)
SRCS ${LIBC_SOURCE_DIR}/src/string/memmove.cpp
HDRS ${LIBC_SOURCE_DIR}/src/string/memmove.h
DEPENDS
- .memory_utils.memcpy_implementation
+ .memory_utils.inline_memcpy
libc.include.string
${ARGN}
)
@@ -627,7 +627,7 @@ function(add_memset memset_name)
SRCS ${LIBC_SOURCE_DIR}/src/string/memset.cpp
HDRS ${LIBC_SOURCE_DIR}/src/string/memset.h
DEPENDS
- .memory_utils.memset_implementation
+ .memory_utils.inline_memset
libc.include.string
${ARGN}
)
diff --git a/libc/src/string/allocating_string_utils.h b/libc/src/string/allocating_string_utils.h
index 71fab3d152066f..2ca01b9a35bd10 100644
--- a/libc/src/string/allocating_string_utils.h
+++ b/libc/src/string/allocating_string_utils.h
@@ -12,7 +12,7 @@
#include "src/__support/CPP/new.h"
#include "src/__support/CPP/optional.h"
#include "src/__support/macros/config.h"
-#include "src/string/memory_utils/memcpy_implementations.h" // For string_length
+#include "src/string/memory_utils/inline_memcpy.h"
#include "src/string/string_utils.h"
#include <stddef.h> // For size_t
diff --git a/libc/src/string/bcmp.cpp b/libc/src/string/bcmp.cpp
index 21991303b14680..26ae302b10b865 100644
--- a/libc/src/string/bcmp.cpp
+++ b/libc/src/string/bcmp.cpp
@@ -8,7 +8,7 @@
#include "src/string/bcmp.h"
#include "src/__support/common.h"
-#include "src/string/memory_utils/bcmp_implementations.h"
+#include "src/string/memory_utils/inline_bcmp.h"
namespace __llvm_libc {
diff --git a/libc/src/string/bcopy.cpp b/libc/src/string/bcopy.cpp
index 9653c73f1305d0..758f01ae2bf75e 100644
--- a/libc/src/string/bcopy.cpp
+++ b/libc/src/string/bcopy.cpp
@@ -8,7 +8,7 @@
#include "src/string/bcopy.h"
#include "src/__support/common.h"
-#include "src/string/memory_utils/memmove_implementations.h"
+#include "src/string/memory_utils/inline_memmove.h"
namespace __llvm_libc {
diff --git a/libc/src/string/bzero.cpp b/libc/src/string/bzero.cpp
index b04cca834f9867..cb6da5628ec13c 100644
--- a/libc/src/string/bzero.cpp
+++ b/libc/src/string/bzero.cpp
@@ -8,7 +8,7 @@
#include "src/string/bzero.h"
#include "src/__support/common.h"
-#include "src/string/memory_utils/bzero_implementations.h"
+#include "src/string/memory_utils/inline_bzero.h"
namespace __llvm_libc {
diff --git a/libc/src/string/memcmp.cpp b/libc/src/string/memcmp.cpp
index 7cf6782dd0d5c3..dca2ee803bd9e5 100644
--- a/libc/src/string/memcmp.cpp
+++ b/libc/src/string/memcmp.cpp
@@ -7,7 +7,7 @@
//===----------------------------------------------------------------------===//
#include "src/string/memcmp.h"
-#include "src/string/memory_utils/memcmp_implementations.h"
+#include "src/string/memory_utils/inline_memcmp.h"
#include <stddef.h> // size_t
diff --git a/libc/src/string/memcpy.cpp b/libc/src/string/memcpy.cpp
index 850400540037f5..5ec6176f7f7fb7 100644
--- a/libc/src/string/memcpy.cpp
+++ b/libc/src/string/memcpy.cpp
@@ -8,7 +8,7 @@
#include "src/string/memcpy.h"
#include "src/__support/common.h"
-#include "src/string/memory_utils/memcpy_implementations.h"
+#include "src/string/memory_utils/inline_memcpy.h"
namespace __llvm_libc {
diff --git a/libc/src/string/memmem.cpp b/libc/src/string/memmem.cpp
index eed1d38a6ac682..af864985e1026c 100644
--- a/libc/src/string/memmem.cpp
+++ b/libc/src/string/memmem.cpp
@@ -8,7 +8,7 @@
#include "src/string/memmem.h"
#include "src/__support/common.h"
-#include "src/string/memory_utils/memmem_implementations.h"
+#include "src/string/memory_utils/inline_memmem.h"
namespace __llvm_libc {
@@ -18,8 +18,7 @@ LLVM_LIBC_FUNCTION(void *, memmem,
constexpr auto comp = [](unsigned char l, unsigned char r) -> int {
return l - r;
};
- return memmem_implementation(haystack, haystack_len, needle, needle_len,
- comp);
+ return inline_memmem(haystack, haystack_len, needle, needle_len, comp);
}
} // namespace __llvm_libc
diff --git a/libc/src/string/memmove.cpp b/libc/src/string/memmove.cpp
index 3b6866fd9f0170..9e75ef77eff240 100644
--- a/libc/src/string/memmove.cpp
+++ b/libc/src/string/memmove.cpp
@@ -7,8 +7,8 @@
//===----------------------------------------------------------------------===//
#include "src/string/memmove.h"
-#include "src/string/memory_utils/memcpy_implementations.h"
-#include "src/string/memory_utils/memmove_implementations.h"
+#include "src/string/memory_utils/inline_memcpy.h"
+#include "src/string/memory_utils/inline_memmove.h"
#include <stddef.h> // size_t
namespace __llvm_libc {
diff --git a/libc/src/string/memory_utils/CMakeLists.txt b/libc/src/string/memory_utils/CMakeLists.txt
index f9b3c860ed2c69..fac786801bb577 100644
--- a/libc/src/string/memory_utils/CMakeLists.txt
+++ b/libc/src/string/memory_utils/CMakeLists.txt
@@ -2,34 +2,34 @@
add_header_library(
memory_utils
HDRS
- aarch64/bcmp_implementations.h
- aarch64/memcmp_implementations.h
- aarch64/memcpy_implementations.h
- aarch64/memmove_implementations.h
- aarch64/memset_implementations.h
- bcmp_implementations.h
- bzero_implementations.h
+ aarch64/inline_bcmp.h
+ aarch64/inline_memcmp.h
+ aarch64/inline_memcpy.h
+ aarch64/inline_memmove.h
+ aarch64/inline_memset.h
generic/aligned_access.h
generic/byte_per_byte.h
- memcmp_implementations.h
- memcpy_implementations.h
- memmove_implementations.h
- memset_implementations.h
+ inline_bcmp.h
+ inline_bzero.h
+ inline_memcmp.h
+ inline_memcpy.h
+ inline_memmove.h
+ inline_memset.h
op_aarch64.h
op_builtin.h
op_generic.h
op_x86.h
- riscv/bcmp_implementations.h
- riscv/memcmp_implementations.h
- riscv/memcpy_implementations.h
- riscv/memmove_implementations.h
- riscv/memset_implementations.h
+ riscv/inline_bcmp.h
+ riscv/inline_memcmp.h
+ riscv/inline_memcpy.h
+ riscv/inline_memmove.h
+ riscv/inline_memset.h
utils.h
- x86_64/bcmp_implementations.h
- x86_64/memcmp_implementations.h
- x86_64/memcpy_implementations.h
- x86_64/memmove_implementations.h
- x86_64/memset_implementations.h
+ x86_64/inline_bcmp.h
+ x86_64/inline_memcmp.h
+ x86_64/inline_memcpy.h
+ x86_64/inline_memmove.h
+ x86_64/inline_memset.h
DEPS
libc.src.__support.common
libc.src.__support.CPP.bit
@@ -41,59 +41,59 @@ add_header_library(
)
add_header_library(
- memcpy_implementation
+ inline_memcpy
HDRS
- memcpy_implementations.h
+ inline_memcpy.h
DEPS
.memory_utils
)
add_header_library(
- memmove_implementation
+ inline_memmove
HDRS
- memmove_implementations.h
+ inline_memmove.h
DEPS
.memory_utils
)
add_header_library(
- memcmp_implementation
+ inline_memcmp
HDRS
- memcmp_implementations.h
+ inline_memcmp.h
DEPS
.memory_utils
)
add_header_library(
- memset_implementation
+ inline_memset
HDRS
- memset_implementations.h
+ inline_memset.h
DEPS
.memory_utils
)
add_header_library(
- bzero_implementation
+ inline_bzero
HDRS
- bzero_implementations.h
+ inline_bzero.h
DEPS
- .memset_implementation
+ .inline_memset
)
add_header_library(
- strcmp_implementation
+ inline_strcmp
HDRS
- strcmp_implementations.h
+ inline_strcmp.h
)
add_header_library(
- strstr_implementation
+ inline_strstr
HDRS
- strstr_implementations.h
+ inline_strstr.h
)
add_header_library(
- memmem_implementation
+ inline_memmem
HDRS
- memmem_implementations.h
+ inline_memmem.h
)
diff --git a/libc/src/string/memory_utils/aarch64/bcmp_implementations.h b/libc/src/string/memory_utils/aarch64/inline_bcmp.h
similarity index 91%
rename from libc/src/string/memory_utils/aarch64/bcmp_implementations.h
rename to libc/src/string/memory_utils/aarch64/inline_bcmp.h
index 61c4c4c63bb3fa..e2e8cb19f66353 100644
--- a/libc/src/string/memory_utils/aarch64/bcmp_implementations.h
+++ b/libc/src/string/memory_utils/aarch64/inline_bcmp.h
@@ -5,8 +5,8 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
-#ifndef LIBC_SRC_STRING_MEMORY_UTILS_AARCH64_BCMP_IMPLEMENTATIONS_H
-#define LIBC_SRC_STRING_MEMORY_UTILS_AARCH64_BCMP_IMPLEMENTATIONS_H
+#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/optimization.h" // LIBC_UNLIKELY
@@ -67,4 +67,4 @@ namespace __llvm_libc {
} // namespace __llvm_libc
-#endif // LIBC_SRC_STRING_MEMORY_UTILS_AARCH64_BCMP_IMPLEMENTATIONS_H
+#endif // LIBC_SRC_STRING_MEMORY_UTILS_AARCH64_INLINE_BCMP_H
diff --git a/libc/src/string/memory_utils/aarch64/memcmp_implementations.h b/libc/src/string/memory_utils/aarch64/inline_memcmp.h
similarity index 92%
rename from libc/src/string/memory_utils/aarch64/memcmp_implementations.h
rename to libc/src/string/memory_utils/aarch64/inline_memcmp.h
index 50b363ebc9bff4..174e812c64878f 100644
--- a/libc/src/string/memory_utils/aarch64/memcmp_implementations.h
+++ b/libc/src/string/memory_utils/aarch64/inline_memcmp.h
@@ -5,8 +5,8 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
-#ifndef LIBC_SRC_STRING_MEMORY_UTILS_X86_64_MEMCMP_IMPLEMENTATIONS_H
-#define LIBC_SRC_STRING_MEMORY_UTILS_X86_64_MEMCMP_IMPLEMENTATIONS_H
+#ifndef LIBC_SRC_STRING_MEMORY_UTILS_X86_64_INLINE_MEMCMP_H
+#define LIBC_SRC_STRING_MEMORY_UTILS_X86_64_INLINE_MEMCMP_H
#include "src/__support/macros/config.h" // LIBC_INLINE
#include "src/__support/macros/optimization.h" // LIBC_UNLIKELY
@@ -68,4 +68,4 @@ LIBC_INLINE MemcmpReturnType inline_memcmp_aarch64(CPtr p1, CPtr p2,
}
} // namespace __llvm_libc
-#endif // LIBC_SRC_STRING_MEMORY_UTILS_X86_64_MEMCMP_IMPLEMENTATIONS_H
+#endif // LIBC_SRC_STRING_MEMORY_UTILS_X86_64_INLINE_MEMCMP_H
diff --git a/libc/src/string/memory_utils/aarch64/memcpy_implementations.h b/libc/src/string/memory_utils/aarch64/inline_memcpy.h
similarity index 88%
rename from libc/src/string/memory_utils/aarch64/memcpy_implementations.h
rename to libc/src/string/memory_utils/aarch64/inline_memcpy.h
index e34eba27ece5b6..6ee2c2b20b732e 100644
--- a/libc/src/string/memory_utils/aarch64/memcpy_implementations.h
+++ b/libc/src/string/memory_utils/aarch64/inline_memcpy.h
@@ -5,8 +5,8 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
-#ifndef LIBC_SRC_STRING_MEMORY_UTILS_AARCH64_MEMCPY_IMPLEMENTATIONS_H
-#define LIBC_SRC_STRING_MEMORY_UTILS_AARCH64_MEMCPY_IMPLEMENTATIONS_H
+#ifndef LIBC_SRC_STRING_MEMORY_UTILS_AARCH64_INLINE_MEMCPY_H
+#define LIBC_SRC_STRING_MEMORY_UTILS_AARCH64_INLINE_MEMCPY_H
#include "src/__support/macros/config.h" // LIBC_INLINE
#include "src/string/memory_utils/op_builtin.h"
@@ -45,4 +45,4 @@ inline_memcpy_aarch64(Ptr __restrict dst, CPtr __restrict src, size_t count) {
} // namespace __llvm_libc
-#endif // LIBC_SRC_STRING_MEMORY_UTILS_AARCH64_MEMCPY_IMPLEMENTATIONS_H
+#endif // LIBC_SRC_STRING_MEMORY_UTILS_AARCH64_INLINE_MEMCPY_H
diff --git a/libc/src/string/memory_utils/aarch64/memmove_implementations.h b/libc/src/string/memory_utils/aarch64/inline_memmove.h
similarity index 90%
rename from libc/src/string/memory_utils/aarch64/memmove_implementations.h
rename to libc/src/string/memory_utils/aarch64/inline_memmove.h
index 37e5656f7fb50f..7c9fa41c1db0de 100644
--- a/libc/src/string/memory_utils/aarch64/memmove_implementations.h
+++ b/libc/src/string/memory_utils/aarch64/inline_memmove.h
@@ -5,8 +5,8 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
-#ifndef LIBC_SRC_STRING_MEMORY_UTILS_AARCH64_MEMMOVE_IMPLEMENTATIONS_H
-#define LIBC_SRC_STRING_MEMORY_UTILS_AARCH64_MEMMOVE_IMPLEMENTATIONS_H
+#ifndef LIBC_SRC_STRING_MEMORY_UTILS_AARCH64_INLINE_MEMMOVE_H
+#define LIBC_SRC_STRING_MEMORY_UTILS_AARCH64_INLINE_MEMMOVE_H
#include "src/__support/macros/config.h" // LIBC_INLINE
#include "src/string/memory_utils/op_aarch64.h" // aarch64::kNeon
@@ -50,4 +50,4 @@ LIBC_INLINE void inline_memmove_aarch64(Ptr dst, CPtr src, size_t count) {
} // namespace __llvm_libc
-#endif // LIBC_SRC_STRING_MEMORY_UTILS_AARCH64_MEMMOVE_IMPLEMENTATIONS_H
+#endif // LIBC_SRC_STRING_MEMORY_UTILS_AARCH64_INLINE_MEMMOVE_H
diff --git a/libc/src/string/memory_utils/aarch64/memset_implementations.h b/libc/src/string/memory_utils/aarch64/inline_memset.h
similarity index 90%
rename from libc/src/string/memory_utils/aarch64/memset_implementations.h
rename to libc/src/string/memory_utils/aarch64/inline_memset.h
index a457897f764625..6b73e5f4d617fd 100644
--- a/libc/src/string/memory_utils/aarch64/memset_implementations.h
+++ b/libc/src/string/memory_utils/aarch64/inline_memset.h
@@ -5,8 +5,8 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
-#ifndef LIBC_SRC_STRING_MEMORY_UTILS_AARCH64_MEMSET_IMPLEMENTATIONS_H
-#define LIBC_SRC_STRING_MEMORY_UTILS_AARCH64_MEMSET_IMPLEMENTATIONS_H
+#ifndef LIBC_SRC_STRING_MEMORY_UTILS_AARCH64_INLINE_MEMSET_H
+#define LIBC_SRC_STRING_MEMORY_UTILS_AARCH64_INLINE_MEMSET_H
#include "src/__support/macros/attributes.h" // LIBC_INLINE
#include "src/string/memory_utils/op_aarch64.h"
@@ -58,4 +58,4 @@ inline_memset_aarch64(Ptr dst, uint8_t value, size_t count) {
} // namespace __llvm_libc
-#endif // LIBC_SRC_STRING_MEMORY_UTILS_AARCH64_MEMSET_IMPLEMENTATIONS_H
+#endif // LIBC_SRC_STRING_MEMORY_UTILS_AARCH64_INLINE_MEMSET_H
diff --git a/libc/src/string/memory_utils/bcmp_implementations.h b/libc/src/string/memory_utils/inline_bcmp.h
similarity index 77%
rename from libc/src/string/memory_utils/bcmp_implementations.h
rename to libc/src/string/memory_utils/inline_bcmp.h
index c595752cff8cfd..d931b4192133d4 100644
--- a/libc/src/string/memory_utils/bcmp_implementations.h
+++ b/libc/src/string/memory_utils/inline_bcmp.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_LIBC_SRC_STRING_MEMORY_UTILS_BCMP_IMPLEMENTATIONS_H
-#define LLVM_LIBC_SRC_STRING_MEMORY_UTILS_BCMP_IMPLEMENTATIONS_H
+#ifndef LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_BCMP_H
+#define LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_BCMP_H
#include "src/__support/common.h"
#include "src/__support/macros/properties/architectures.h" // LIBC_TARGET_ARCH_IS_
@@ -15,13 +15,13 @@
#include <stddef.h> // size_t
#if defined(LIBC_TARGET_ARCH_IS_X86)
-#include "src/string/memory_utils/x86_64/bcmp_implementations.h"
+#include "src/string/memory_utils/x86_64/inline_bcmp.h"
#define LIBC_SRC_STRING_MEMORY_UTILS_BCMP inline_bcmp_x86
#elif defined(LIBC_TARGET_ARCH_IS_AARCH64)
-#include "src/string/memory_utils/aarch64/bcmp_implementations.h"
+#include "src/string/memory_utils/aarch64/inline_bcmp.h"
#define LIBC_SRC_STRING_MEMORY_UTILS_BCMP inline_bcmp_aarch64
#elif defined(LIBC_TARGET_ARCH_IS_ANY_RISCV)
-#include "src/string/memory_utils/riscv/bcmp_implementations.h"
+#include "src/string/memory_utils/riscv/inline_bcmp.h"
#define LIBC_SRC_STRING_MEMORY_UTILS_BCMP inline_bcmp_riscv
#elif defined(LIBC_TARGET_ARCH_IS_ARM) || defined(LIBC_TARGET_ARCH_IS_GPU)
#include "src/string/memory_utils/generic/byte_per_byte.h"
@@ -41,4 +41,4 @@ LIBC_INLINE int inline_bcmp(const void *p1, const void *p2, size_t count) {
#undef LIBC_SRC_STRING_MEMORY_UTILS_BCMP
-#endif // LLVM_LIBC_SRC_STRING_MEMORY_UTILS_BCMP_IMPLEMENTATIONS_H
+#endif // LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_BCMP_H
diff --git a/libc/src/string/memory_utils/bzero_implementations.h b/libc/src/string/memory_utils/inline_bzero.h
similarity index 73%
rename from libc/src/string/memory_utils/bzero_implementations.h
rename to libc/src/string/memory_utils/inline_bzero.h
index 02780d7859a734..af90aede1dea58 100644
--- a/libc/src/string/memory_utils/bzero_implementations.h
+++ b/libc/src/string/memory_utils/inline_bzero.h
@@ -6,11 +6,11 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_LIBC_SRC_STRING_MEMORY_UTILS_BZERO_IMPLEMENTATIONS_H
-#define LLVM_LIBC_SRC_STRING_MEMORY_UTILS_BZERO_IMPLEMENTATIONS_H
+#ifndef LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_BZERO_H
+#define LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_BZERO_H
#include "src/__support/common.h"
-#include "src/string/memory_utils/memset_implementations.h"
+#include "src/string/memory_utils/inline_memset.h"
#include <stddef.h> // size_t
@@ -26,4 +26,4 @@ LIBC_INLINE static void inline_bzero(void *dst, size_t count) {
} // namespace __llvm_libc
-#endif // LLVM_LIBC_SRC_STRING_MEMORY_UTILS_BZERO_IMPLEMENTATIONS_H
+#endif // LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_BZERO_H
diff --git a/libc/src/string/memory_utils/memcmp_implementations.h b/libc/src/string/memory_utils/inline_memcmp.h
similarity index 78%
rename from libc/src/string/memory_utils/memcmp_implementations.h
rename to libc/src/string/memory_utils/inline_memcmp.h
index 5b91b496346f38..4182fbbf72cff4 100644
--- a/libc/src/string/memory_utils/memcmp_implementations.h
+++ b/libc/src/string/memory_utils/inline_memcmp.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_LIBC_SRC_STRING_MEMORY_UTILS_MEMCMP_IMPLEMENTATIONS_H
-#define LLVM_LIBC_SRC_STRING_MEMORY_UTILS_MEMCMP_IMPLEMENTATIONS_H
+#ifndef LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_MEMCMP_H
+#define LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_MEMCMP_H
#include "src/__support/macros/config.h" // LIBC_INLINE
#include "src/__support/macros/properties/architectures.h" // LIBC_TARGET_ARCH_IS_
@@ -16,13 +16,13 @@
#include <stddef.h> // size_t
#if defined(LIBC_TARGET_ARCH_IS_X86)
-#include "src/string/memory_utils/x86_64/memcmp_implementations.h"
+#include "src/string/memory_utils/x86_64/inline_memcmp.h"
#define LIBC_SRC_STRING_MEMORY_UTILS_MEMCMP inline_memcmp_x86
#elif defined(LIBC_TARGET_ARCH_IS_AARCH64)
-#include "src/string/memory_utils/aarch64/memcmp_implementations.h"
+#include "src/string/memory_utils/aarch64/inline_memcmp.h"
#define LIBC_SRC_STRING_MEMORY_UTILS_MEMCMP inline_memcmp_aarch64
#elif defined(LIBC_TARGET_ARCH_IS_ANY_RISCV)
-#include "src/string/memory_utils/riscv/memcmp_implementations.h"
+#include "src/string/memory_utils/riscv/inline_memcmp.h"
#define LIBC_SRC_STRING_MEMORY_UTILS_MEMCMP inline_memcmp_riscv
#elif defined(LIBC_TARGET_ARCH_IS_ARM) || defined(LIBC_TARGET_ARCH_IS_GPU)
#include "src/string/memory_utils/generic/byte_per_byte.h"
@@ -42,4 +42,4 @@ LIBC_INLINE int inline_memcmp(const void *p1, const void *p2, size_t count) {
#undef LIBC_SRC_STRING_MEMORY_UTILS_MEMCMP
-#endif // LLVM_LIBC_SRC_STRING_MEMORY_UTILS_MEMCMP_IMPLEMENTATIONS_H
+#endif // LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_MEMCMP_H
diff --git a/libc/src/string/memory_utils/memcpy_implementations.h b/libc/src/string/memory_utils/inline_memcpy.h
similarity index 81%
rename from libc/src/string/memory_utils/memcpy_implementations.h
rename to libc/src/string/memory_utils/inline_memcpy.h
index 90f57b982ed6f2..55f861a8047be0 100644
--- a/libc/src/string/memory_utils/memcpy_implementations.h
+++ b/libc/src/string/memory_utils/inline_memcpy.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_LIBC_SRC_STRING_MEMORY_UTILS_MEMCPY_IMPLEMENTATIONS_H
-#define LLVM_LIBC_SRC_STRING_MEMORY_UTILS_MEMCPY_IMPLEMENTATIONS_H
+#ifndef LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_MEMCPY_H
+#define LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_MEMCPY_H
#include "src/__support/macros/config.h" // LIBC_INLINE
#include "src/__support/macros/properties/architectures.h" // LIBC_TARGET_ARCH_IS_
@@ -19,14 +19,14 @@
#include "src/string/memory_utils/generic/byte_per_byte.h"
#define LIBC_SRC_STRING_MEMORY_UTILS_MEMCPY inline_memcpy_byte_per_byte
#elif defined(LIBC_TARGET_ARCH_IS_X86)
-#include "src/string/memory_utils/x86_64/memcpy_implementations.h"
+#include "src/string/memory_utils/x86_64/inline_memcpy.h"
#define LIBC_SRC_STRING_MEMORY_UTILS_MEMCPY \
inline_memcpy_x86_maybe_interpose_repmovsb
#elif defined(LIBC_TARGET_ARCH_IS_AARCH64)
-#include "src/string/memory_utils/aarch64/memcpy_implementations.h"
+#include "src/string/memory_utils/aarch64/inline_memcpy.h"
#define LIBC_SRC_STRING_MEMORY_UTILS_MEMCPY inline_memcpy_aarch64
#elif defined(LIBC_TARGET_ARCH_IS_ANY_RISCV)
-#include "src/string/memory_utils/riscv/memcpy_implementations.h"
+#include "src/string/memory_utils/riscv/inline_memcpy.h"
#define LIBC_SRC_STRING_MEMORY_UTILS_MEMCPY inline_memcpy_riscv
#elif defined(LIBC_TARGET_ARCH_IS_ARM) || defined(LIBC_TARGET_ARCH_IS_GPU)
#include "src/string/memory_utils/generic/byte_per_byte.h"
@@ -45,4 +45,4 @@ LIBC_INLINE void inline_memcpy(void *__restrict dst, const void *__restrict src,
} // namespace __llvm_libc
-#endif // LLVM_LIBC_SRC_STRING_MEMORY_UTILS_MEMCPY_IMPLEMENTATIONS_H
+#endif // LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_MEMCPY_H
diff --git a/libc/src/string/memory_utils/memmem_implementations.h b/libc/src/string/memory_utils/inline_memmem.h
similarity index 74%
rename from libc/src/string/memory_utils/memmem_implementations.h
rename to libc/src/string/memory_utils/inline_memmem.h
index da0be0f16c1044..abb20c7d9c382d 100644
--- a/libc/src/string/memory_utils/memmem_implementations.h
+++ b/libc/src/string/memory_utils/inline_memmem.h
@@ -6,17 +6,17 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_LIBC_SRC_STRING_MEMORY_UTILS_MEMMEM_IMPLEMENTATIONS_H
-#define LLVM_LIBC_SRC_STRING_MEMORY_UTILS_MEMMEM_IMPLEMENTATIONS_H
+#ifndef LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_MEMMEM_H
+#define LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_MEMMEM_H
#include <stddef.h>
namespace __llvm_libc {
template <typename Comp>
-constexpr static void *
-memmem_implementation(const void *haystack, size_t haystack_len,
- const void *needle, size_t needle_len, Comp &&comp) {
+constexpr static void *inline_memmem(const void *haystack, size_t haystack_len,
+ const void *needle, size_t needle_len,
+ Comp &&comp) {
// TODO: simple brute force implementation. This can be
// improved upon using well known string matching algorithms.
if (!needle_len)
@@ -39,4 +39,4 @@ memmem_implementation(const void *haystack, size_t haystack_len,
} // namespace __llvm_libc
-#endif // LLVM_LIBC_SRC_STRING_MEMORY_UTILS_MEMMEM_IMPLEMENTATIONS_H
+#endif // LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_MEMMEM_H
diff --git a/libc/src/string/memory_utils/memmove_implementations.h b/libc/src/string/memory_utils/inline_memmove.h
similarity index 75%
rename from libc/src/string/memory_utils/memmove_implementations.h
rename to libc/src/string/memory_utils/inline_memmove.h
index da21e1ce916ff7..c520b6f4de0cdf 100644
--- a/libc/src/string/memory_utils/memmove_implementations.h
+++ b/libc/src/string/memory_utils/inline_memmove.h
@@ -6,19 +6,19 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_LIBC_SRC_STRING_MEMORY_UTILS_MEMMOVE_IMPLEMENTATIONS_H
-#define LLVM_LIBC_SRC_STRING_MEMORY_UTILS_MEMMOVE_IMPLEMENTATIONS_H
+#ifndef LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_MEMMOVE_H
+#define LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_MEMMOVE_H
#include <stddef.h> // size_t, ptr
diff _t
#if defined(LIBC_TARGET_ARCH_IS_X86)
-#include "src/string/memory_utils/x86_64/memmove_implementations.h"
+#include "src/string/memory_utils/x86_64/inline_memmove.h"
#define LIBC_SRC_STRING_MEMORY_UTILS_MEMMOVE inline_memmove_x86
#elif defined(LIBC_TARGET_ARCH_IS_AARCH64)
-#include "src/string/memory_utils/aarch64/memmove_implementations.h"
+#include "src/string/memory_utils/aarch64/inline_memmove.h"
#define LIBC_SRC_STRING_MEMORY_UTILS_MEMMOVE inline_memmove_aarch64
#elif defined(LIBC_TARGET_ARCH_IS_ANY_RISCV)
-#include "src/string/memory_utils/riscv/memmove_implementations.h"
+#include "src/string/memory_utils/riscv/inline_memmove.h"
#define LIBC_SRC_STRING_MEMORY_UTILS_MEMMOVE inline_memmove_riscv
#elif defined(LIBC_TARGET_ARCH_IS_ARM) || defined(LIBC_TARGET_ARCH_IS_GPU)
#include "src/string/memory_utils/generic/byte_per_byte.h"
@@ -36,4 +36,4 @@ LIBC_INLINE void inline_memmove(void *dst, const void *src, size_t count) {
} // namespace __llvm_libc
-#endif /* LLVM_LIBC_SRC_STRING_MEMORY_UTILS_MEMMOVE_IMPLEMENTATIONS_H */
+#endif /* LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_MEMMOVE_H */
diff --git a/libc/src/string/memory_utils/memset_implementations.h b/libc/src/string/memory_utils/inline_memset.h
similarity index 78%
rename from libc/src/string/memory_utils/memset_implementations.h
rename to libc/src/string/memory_utils/inline_memset.h
index ee8b97d7a64952..524224c110dd4b 100644
--- a/libc/src/string/memory_utils/memset_implementations.h
+++ b/libc/src/string/memory_utils/inline_memset.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_LIBC_SRC_STRING_MEMORY_UTILS_MEMSET_IMPLEMENTATIONS_H
-#define LLVM_LIBC_SRC_STRING_MEMORY_UTILS_MEMSET_IMPLEMENTATIONS_H
+#ifndef LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_MEMSET_H
+#define LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_MEMSET_H
#include "src/__support/macros/config.h" // LIBC_INLINE
#include "src/__support/macros/properties/architectures.h" // LIBC_TARGET_ARCH_IS_
@@ -16,13 +16,13 @@
#include <stddef.h> // size_t
#if defined(LIBC_TARGET_ARCH_IS_X86)
-#include "src/string/memory_utils/x86_64/memset_implementations.h"
+#include "src/string/memory_utils/x86_64/inline_memset.h"
#define LIBC_SRC_STRING_MEMORY_UTILS_MEMSET inline_memset_x86
#elif defined(LIBC_TARGET_ARCH_IS_AARCH64)
-#include "src/string/memory_utils/aarch64/memset_implementations.h"
+#include "src/string/memory_utils/aarch64/inline_memset.h"
#define LIBC_SRC_STRING_MEMORY_UTILS_MEMSET inline_memset_aarch64
#elif defined(LIBC_TARGET_ARCH_IS_ANY_RISCV)
-#include "src/string/memory_utils/riscv/memset_implementations.h"
+#include "src/string/memory_utils/riscv/inline_memset.h"
#define LIBC_SRC_STRING_MEMORY_UTILS_MEMSET inline_memset_riscv
#elif defined(LIBC_TARGET_ARCH_IS_ARM) || defined(LIBC_TARGET_ARCH_IS_GPU)
#include "src/string/memory_utils/generic/byte_per_byte.h"
@@ -41,4 +41,4 @@ LIBC_INLINE static void inline_memset(void *dst, uint8_t value, size_t count) {
#undef LIBC_SRC_STRING_MEMORY_UTILS_MEMSET
-#endif // LLVM_LIBC_SRC_STRING_MEMORY_UTILS_MEMSET_IMPLEMENTATIONS_H
+#endif // LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_MEMSET_H
diff --git a/libc/src/string/memory_utils/strcmp_implementations.h b/libc/src/string/memory_utils/inline_strcmp.h
similarity index 67%
rename from libc/src/string/memory_utils/strcmp_implementations.h
rename to libc/src/string/memory_utils/inline_strcmp.h
index 1fc08fcd095daf..ccb315d744b15b 100644
--- a/libc/src/string/memory_utils/strcmp_implementations.h
+++ b/libc/src/string/memory_utils/inline_strcmp.h
@@ -6,16 +6,16 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_LIBC_SRC_STRING_MEMORY_UTILS_STRCMP_IMPLEMENTATIONS_H
-#define LLVM_LIBC_SRC_STRING_MEMORY_UTILS_STRCMP_IMPLEMENTATIONS_H
+#ifndef LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_STRCMP_H
+#define LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_STRCMP_H
#include <stddef.h>
namespace __llvm_libc {
template <typename Comp>
-LIBC_INLINE constexpr int
-strcmp_implementation(const char *left, const char *right, Comp &&comp) {
+LIBC_INLINE constexpr int inline_strcmp(const char *left, const char *right,
+ Comp &&comp) {
// TODO: Look at benefits for comparing words at a time.
for (; *left && !comp(*left, *right); ++left, ++right)
;
@@ -24,9 +24,8 @@ strcmp_implementation(const char *left, const char *right, Comp &&comp) {
}
template <typename Comp>
-LIBC_INLINE constexpr int strncmp_implementation(const char *left,
- const char *right, size_t n,
- Comp &&comp) {
+LIBC_INLINE constexpr int inline_strncmp(const char *left, const char *right,
+ size_t n, Comp &&comp) {
if (n == 0)
return 0;
@@ -42,4 +41,4 @@ LIBC_INLINE constexpr int strncmp_implementation(const char *left,
} // namespace __llvm_libc
-#endif // LLVM_LIBC_SRC_STRING_MEMORY_UTILS_STRCMP_IMPLEMENTATIONS_H
+#endif // LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_STRCMP_H
diff --git a/libc/src/string/memory_utils/strstr_implementations.h b/libc/src/string/memory_utils/inline_strstr.h
similarity index 63%
rename from libc/src/string/memory_utils/strstr_implementations.h
rename to libc/src/string/memory_utils/inline_strstr.h
index 3cf1a84ef415dd..f9bc6b583ecdf4 100644
--- a/libc/src/string/memory_utils/strstr_implementations.h
+++ b/libc/src/string/memory_utils/inline_strstr.h
@@ -6,19 +6,19 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_LIBC_SRC_STRING_MEMORY_UTILS_STRSTR_IMPLEMENTATIONS_H
-#define LLVM_LIBC_SRC_STRING_MEMORY_UTILS_STRSTR_IMPLEMENTATIONS_H
+#ifndef LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_STRSTR_H
+#define LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_STRSTR_H
-#include "src/string/memory_utils/memmem_implementations.h"
+#include "src/string/memory_utils/inline_memmem.h"
#include "src/string/string_utils.h"
#include <stddef.h>
namespace __llvm_libc {
template <typename Comp>
-LIBC_INLINE constexpr char *
-strstr_implementation(const char *haystack, const char *needle, Comp &&comp) {
- void *result = memmem_implementation(
+LIBC_INLINE constexpr char *inline_strstr(const char *haystack,
+ const char *needle, Comp &&comp) {
+ void *result = inline_memmem(
static_cast<const void *>(haystack), internal::string_length(haystack),
static_cast<const void *>(needle), internal::string_length(needle), comp);
return static_cast<char *>(result);
@@ -26,4 +26,4 @@ strstr_implementation(const char *haystack, const char *needle, Comp &&comp) {
} // namespace __llvm_libc
-#endif // LLVM_LIBC_SRC_STRING_MEMORY_UTILS_STRSTR_IMPLEMENTATIONS_H
+#endif // LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_STRSTR_H
diff --git a/libc/src/string/memory_utils/riscv/bcmp_implementations.h b/libc/src/string/memory_utils/riscv/inline_bcmp.h
similarity index 84%
rename from libc/src/string/memory_utils/riscv/bcmp_implementations.h
rename to libc/src/string/memory_utils/riscv/inline_bcmp.h
index b7a29fea2c2fbf..7d14b335ef43aa 100644
--- a/libc/src/string/memory_utils/riscv/bcmp_implementations.h
+++ b/libc/src/string/memory_utils/riscv/inline_bcmp.h
@@ -5,8 +5,8 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
-#ifndef LIBC_SRC_STRING_MEMORY_UTILS_RISCV_BCMP_IMPLEMENTATIONS_H
-#define LIBC_SRC_STRING_MEMORY_UTILS_RISCV_BCMP_IMPLEMENTATIONS_H
+#ifndef LIBC_SRC_STRING_MEMORY_UTILS_RISCV_INLINE_BCMP_H
+#define LIBC_SRC_STRING_MEMORY_UTILS_RISCV_INLINE_BCMP_H
#include "src/__support/macros/attributes.h" // LIBC_INLINE
#include "src/__support/macros/properties/architectures.h" // LIBC_TARGET_ARCH_IS_RISCV64
@@ -30,4 +30,4 @@ namespace __llvm_libc {
} // namespace __llvm_libc
-#endif // LIBC_SRC_STRING_MEMORY_UTILS_RISCV_BCMP_IMPLEMENTATIONS_H
+#endif // LIBC_SRC_STRING_MEMORY_UTILS_RISCV_INLINE_BCMP_H
diff --git a/libc/src/string/memory_utils/riscv/memcmp_implementations.h b/libc/src/string/memory_utils/riscv/inline_memcmp.h
similarity index 83%
rename from libc/src/string/memory_utils/riscv/memcmp_implementations.h
rename to libc/src/string/memory_utils/riscv/inline_memcmp.h
index 8408d0525054d0..437a6b43bcf0c8 100644
--- a/libc/src/string/memory_utils/riscv/memcmp_implementations.h
+++ b/libc/src/string/memory_utils/riscv/inline_memcmp.h
@@ -5,8 +5,8 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
-#ifndef LIBC_SRC_STRING_MEMORY_UTILS_RISCV_MEMCMP_IMPLEMENTATIONS_H
-#define LIBC_SRC_STRING_MEMORY_UTILS_RISCV_MEMCMP_IMPLEMENTATIONS_H
+#ifndef LIBC_SRC_STRING_MEMORY_UTILS_RISCV_INLINE_MEMCMP_H
+#define LIBC_SRC_STRING_MEMORY_UTILS_RISCV_INLINE_MEMCMP_H
#include "src/__support/macros/attributes.h" // LIBC_INLINE
#include "src/__support/macros/properties/architectures.h" // LIBC_TARGET_ARCH_IS_RISCV64
@@ -30,4 +30,4 @@ inline_memcmp_riscv(CPtr p1, CPtr p2, size_t count) {
} // namespace __llvm_libc
-#endif // LIBC_SRC_STRING_MEMORY_UTILS_RISCV_MEMCMP_IMPLEMENTATIONS_H
+#endif // LIBC_SRC_STRING_MEMORY_UTILS_RISCV_INLINE_MEMCMP_H
diff --git a/libc/src/string/memory_utils/riscv/memcpy_implementations.h b/libc/src/string/memory_utils/riscv/inline_memcpy.h
similarity index 84%
rename from libc/src/string/memory_utils/riscv/memcpy_implementations.h
rename to libc/src/string/memory_utils/riscv/inline_memcpy.h
index a633f34f0737a8..c80277acf40a77 100644
--- a/libc/src/string/memory_utils/riscv/memcpy_implementations.h
+++ b/libc/src/string/memory_utils/riscv/inline_memcpy.h
@@ -5,8 +5,8 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
-#ifndef LIBC_SRC_STRING_MEMORY_UTILS_RISCV_MEMCPY_IMPLEMENTATIONS_H
-#define LIBC_SRC_STRING_MEMORY_UTILS_RISCV_MEMCPY_IMPLEMENTATIONS_H
+#ifndef LIBC_SRC_STRING_MEMORY_UTILS_RISCV_INLINE_MEMCPY_H
+#define LIBC_SRC_STRING_MEMORY_UTILS_RISCV_INLINE_MEMCPY_H
#include "src/__support/macros/attributes.h" // LIBC_INLINE
#include "src/__support/macros/properties/architectures.h" // LIBC_TARGET_ARCH_IS_RISCV64
@@ -30,4 +30,4 @@ inline_memcpy_riscv(Ptr __restrict dst, CPtr __restrict src, size_t count) {
} // namespace __llvm_libc
-#endif // LIBC_SRC_STRING_MEMORY_UTILS_RISCV_MEMCPY_IMPLEMENTATIONS_H
+#endif // LIBC_SRC_STRING_MEMORY_UTILS_RISCV_INLINE_MEMCPY_H
diff --git a/libc/src/string/memory_utils/riscv/memmove_implementations.h b/libc/src/string/memory_utils/riscv/inline_memmove.h
similarity index 81%
rename from libc/src/string/memory_utils/riscv/memmove_implementations.h
rename to libc/src/string/memory_utils/riscv/inline_memmove.h
index 19fc95677d968c..9704157f4f99f0 100644
--- a/libc/src/string/memory_utils/riscv/memmove_implementations.h
+++ b/libc/src/string/memory_utils/riscv/inline_memmove.h
@@ -5,8 +5,8 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
-#ifndef LIBC_SRC_STRING_MEMORY_UTILS_RISCV_MEMMOVE_IMPLEMENTATIONS_H
-#define LIBC_SRC_STRING_MEMORY_UTILS_RISCV_MEMMOVE_IMPLEMENTATIONS_H
+#ifndef LIBC_SRC_STRING_MEMORY_UTILS_RISCV_INLINE_MEMMOVE_H
+#define LIBC_SRC_STRING_MEMORY_UTILS_RISCV_INLINE_MEMMOVE_H
#include "src/__support/macros/attributes.h" // LIBC_INLINE
#include "src/__support/macros/properties/architectures.h" // LIBC_TARGET_ARCH_IS_RISCV64
@@ -24,4 +24,4 @@ inline_memmove_riscv(Ptr __restrict dst, CPtr __restrict src, size_t count) {
} // namespace __llvm_libc
-#endif // LIBC_SRC_STRING_MEMORY_UTILS_RISCV_MEMMOVE_IMPLEMENTATIONS_H
+#endif // LIBC_SRC_STRING_MEMORY_UTILS_RISCV_INLINE_MEMMOVE_H
diff --git a/libc/src/string/memory_utils/riscv/memset_implementations.h b/libc/src/string/memory_utils/riscv/inline_memset.h
similarity index 84%
rename from libc/src/string/memory_utils/riscv/memset_implementations.h
rename to libc/src/string/memory_utils/riscv/inline_memset.h
index 80be22839d48bd..c64a70a99eb151 100644
--- a/libc/src/string/memory_utils/riscv/memset_implementations.h
+++ b/libc/src/string/memory_utils/riscv/inline_memset.h
@@ -5,8 +5,8 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
-#ifndef LIBC_SRC_STRING_MEMORY_UTILS_RISCV_MEMSET_IMPLEMENTATIONS_H
-#define LIBC_SRC_STRING_MEMORY_UTILS_RISCV_MEMSET_IMPLEMENTATIONS_H
+#ifndef LIBC_SRC_STRING_MEMORY_UTILS_RISCV_INLINE_MEMSET_H
+#define LIBC_SRC_STRING_MEMORY_UTILS_RISCV_INLINE_MEMSET_H
#include "src/__support/macros/attributes.h" // LIBC_INLINE
#include "src/__support/macros/properties/architectures.h" // LIBC_TARGET_ARCH_IS_RISCV64
@@ -30,4 +30,4 @@ LIBC_INLINE static void inline_memset_riscv(Ptr dst, uint8_t value,
} // namespace __llvm_libc
-#endif // LIBC_SRC_STRING_MEMORY_UTILS_RISCV_MEMSET_IMPLEMENTATIONS_H
+#endif // LIBC_SRC_STRING_MEMORY_UTILS_RISCV_INLINE_MEMSET_H
diff --git a/libc/src/string/memory_utils/x86_64/bcmp_implementations.h b/libc/src/string/memory_utils/x86_64/inline_bcmp.h
similarity index 94%
rename from libc/src/string/memory_utils/x86_64/bcmp_implementations.h
rename to libc/src/string/memory_utils/x86_64/inline_bcmp.h
index 4c610fcac0967c..00a8cdd2e9e37d 100644
--- a/libc/src/string/memory_utils/x86_64/bcmp_implementations.h
+++ b/libc/src/string/memory_utils/x86_64/inline_bcmp.h
@@ -5,8 +5,8 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
-#ifndef LIBC_SRC_STRING_MEMORY_UTILS_X86_64_BCMP_IMPLEMENTATIONS_H
-#define LIBC_SRC_STRING_MEMORY_UTILS_X86_64_BCMP_IMPLEMENTATIONS_H
+#ifndef LIBC_SRC_STRING_MEMORY_UTILS_X86_64_INLINE_BCMP_H
+#define LIBC_SRC_STRING_MEMORY_UTILS_X86_64_INLINE_BCMP_H
#include "src/__support/macros/attributes.h" // LIBC_INLINE
#include "src/string/memory_utils/op_generic.h"
@@ -90,4 +90,4 @@ inline_bcmp_x86_avx512bw_gt16(CPtr p1, CPtr p2, size_t count) {
} // namespace __llvm_libc
-#endif // LIBC_SRC_STRING_MEMORY_UTILS_X86_64_BCMP_IMPLEMENTATIONS_H
+#endif // LIBC_SRC_STRING_MEMORY_UTILS_X86_64_INLINE_BCMP_H
diff --git a/libc/src/string/memory_utils/x86_64/memcmp_implementations.h b/libc/src/string/memory_utils/x86_64/inline_memcmp.h
similarity index 94%
rename from libc/src/string/memory_utils/x86_64/memcmp_implementations.h
rename to libc/src/string/memory_utils/x86_64/inline_memcmp.h
index 7502a8d98f53e5..98ae038648b891 100644
--- a/libc/src/string/memory_utils/x86_64/memcmp_implementations.h
+++ b/libc/src/string/memory_utils/x86_64/inline_memcmp.h
@@ -5,8 +5,8 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
-#ifndef LIBC_SRC_STRING_MEMORY_UTILS_X86_64_MEMCMP_IMPLEMENTATIONS_H
-#define LIBC_SRC_STRING_MEMORY_UTILS_X86_64_MEMCMP_IMPLEMENTATIONS_H
+#ifndef LIBC_SRC_STRING_MEMORY_UTILS_X86_64_INLINE_MEMCMP_H
+#define LIBC_SRC_STRING_MEMORY_UTILS_X86_64_INLINE_MEMCMP_H
#include "src/__support/macros/config.h" // LIBC_INLINE
#include "src/__support/macros/optimization.h" // LIBC_UNLIKELY
@@ -90,4 +90,4 @@ LIBC_INLINE MemcmpReturnType inline_memcmp_x86(CPtr p1, CPtr p2, size_t count) {
} // namespace __llvm_libc
-#endif // LIBC_SRC_STRING_MEMORY_UTILS_X86_64_MEMCMP_IMPLEMENTATIONS_H
+#endif // LIBC_SRC_STRING_MEMORY_UTILS_X86_64_INLINE_MEMCMP_H
diff --git a/libc/src/string/memory_utils/x86_64/memcpy_implementations.h b/libc/src/string/memory_utils/x86_64/inline_memcpy.h
similarity index 97%
rename from libc/src/string/memory_utils/x86_64/memcpy_implementations.h
rename to libc/src/string/memory_utils/x86_64/inline_memcpy.h
index 0d6e3710aebf40..77d8ed4a82a6df 100644
--- a/libc/src/string/memory_utils/x86_64/memcpy_implementations.h
+++ b/libc/src/string/memory_utils/x86_64/inline_memcpy.h
@@ -5,8 +5,8 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
-#ifndef LIBC_SRC_STRING_MEMORY_UTILS_X86_64_MEMCPY_IMPLEMENTATIONS_H
-#define LIBC_SRC_STRING_MEMORY_UTILS_X86_64_MEMCPY_IMPLEMENTATIONS_H
+#ifndef LIBC_SRC_STRING_MEMORY_UTILS_X86_64_INLINE_MEMCPY_H
+#define LIBC_SRC_STRING_MEMORY_UTILS_X86_64_INLINE_MEMCPY_H
#include "src/__support/macros/attributes.h" // LIBC_INLINE_VAR
#include "src/__support/macros/config.h" // LIBC_INLINE
@@ -199,4 +199,4 @@ inline_memcpy_x86_maybe_interpose_repmovsb(Ptr __restrict dst,
} // namespace __llvm_libc
-#endif // LIBC_SRC_STRING_MEMORY_UTILS_X86_64_MEMCPY_IMPLEMENTATIONS_H
+#endif // LIBC_SRC_STRING_MEMORY_UTILS_X86_64_INLINE_MEMCPY_H
diff --git a/libc/src/string/memory_utils/x86_64/memmove_implementations.h b/libc/src/string/memory_utils/x86_64/inline_memmove.h
similarity index 91%
rename from libc/src/string/memory_utils/x86_64/memmove_implementations.h
rename to libc/src/string/memory_utils/x86_64/inline_memmove.h
index 218f543622860f..dead616f8d6933 100644
--- a/libc/src/string/memory_utils/x86_64/memmove_implementations.h
+++ b/libc/src/string/memory_utils/x86_64/inline_memmove.h
@@ -5,8 +5,8 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
-#ifndef LIBC_SRC_STRING_MEMORY_UTILS_X86_64_MEMMOVE_IMPLEMENTATIONS_H
-#define LIBC_SRC_STRING_MEMORY_UTILS_X86_64_MEMMOVE_IMPLEMENTATIONS_H
+#ifndef LIBC_SRC_STRING_MEMORY_UTILS_X86_64_INLINE_MEMMOVE_H
+#define LIBC_SRC_STRING_MEMORY_UTILS_X86_64_INLINE_MEMMOVE_H
#include "src/__support/macros/config.h" // LIBC_INLINE
#include "src/string/memory_utils/op_builtin.h"
@@ -63,4 +63,4 @@ LIBC_INLINE void inline_memmove_x86(Ptr dst, CPtr src, size_t count) {
} // namespace __llvm_libc
-#endif // LIBC_SRC_STRING_MEMORY_UTILS_X86_64_MEMMOVE_IMPLEMENTATIONS_H
+#endif // LIBC_SRC_STRING_MEMORY_UTILS_X86_64_INLINE_MEMMOVE_H
diff --git a/libc/src/string/memory_utils/x86_64/memset_implementations.h b/libc/src/string/memory_utils/x86_64/inline_memset.h
similarity index 91%
rename from libc/src/string/memory_utils/x86_64/memset_implementations.h
rename to libc/src/string/memory_utils/x86_64/inline_memset.h
index cb268544d61930..8b5d1b5e33279c 100644
--- a/libc/src/string/memory_utils/x86_64/memset_implementations.h
+++ b/libc/src/string/memory_utils/x86_64/inline_memset.h
@@ -5,8 +5,8 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
-#ifndef LIBC_SRC_STRING_MEMORY_UTILS_X86_64_MEMSET_IMPLEMENTATIONS_H
-#define LIBC_SRC_STRING_MEMORY_UTILS_X86_64_MEMSET_IMPLEMENTATIONS_H
+#ifndef LIBC_SRC_STRING_MEMORY_UTILS_X86_64_INLINE_MEMSET_H
+#define LIBC_SRC_STRING_MEMORY_UTILS_X86_64_INLINE_MEMSET_H
#include "src/__support/macros/attributes.h" // LIBC_INLINE
#include "src/string/memory_utils/op_generic.h"
@@ -62,4 +62,4 @@ inline_memset_x86(Ptr dst, uint8_t value, size_t count) {
}
} // namespace __llvm_libc
-#endif // LIBC_SRC_STRING_MEMORY_UTILS_X86_64_MEMSET_IMPLEMENTATIONS_H
+#endif // LIBC_SRC_STRING_MEMORY_UTILS_X86_64_INLINE_MEMSET_H
diff --git a/libc/src/string/mempcpy.cpp b/libc/src/string/mempcpy.cpp
index dd539eb3a2d870..535e029305f43d 100644
--- a/libc/src/string/mempcpy.cpp
+++ b/libc/src/string/mempcpy.cpp
@@ -7,7 +7,7 @@
//===----------------------------------------------------------------------===//
#include "src/string/mempcpy.h"
-#include "src/string/memory_utils/memcpy_implementations.h"
+#include "src/string/memory_utils/inline_memcpy.h"
#include "src/__support/common.h"
#include <stddef.h> // For size_t.
diff --git a/libc/src/string/memset.cpp b/libc/src/string/memset.cpp
index b80cfce87fcacd..3a339eca661320 100644
--- a/libc/src/string/memset.cpp
+++ b/libc/src/string/memset.cpp
@@ -8,7 +8,7 @@
#include "src/string/memset.h"
#include "src/__support/common.h"
-#include "src/string/memory_utils/memset_implementations.h"
+#include "src/string/memory_utils/inline_memset.h"
namespace __llvm_libc {
diff --git a/libc/src/string/stpncpy.cpp b/libc/src/string/stpncpy.cpp
index cc4d89d8e2bbcf..e03d560bf221ae 100644
--- a/libc/src/string/stpncpy.cpp
+++ b/libc/src/string/stpncpy.cpp
@@ -7,7 +7,7 @@
//===----------------------------------------------------------------------===//
#include "src/string/stpncpy.h"
-#include "src/string/memory_utils/bzero_implementations.h"
+#include "src/string/memory_utils/inline_bzero.h"
#include "src/__support/common.h"
diff --git a/libc/src/string/strcasecmp.cpp b/libc/src/string/strcasecmp.cpp
index d7a080aec949e8..ceb81ce2fdc26e 100644
--- a/libc/src/string/strcasecmp.cpp
+++ b/libc/src/string/strcasecmp.cpp
@@ -10,7 +10,7 @@
#include "src/__support/common.h"
#include "src/__support/ctype_utils.h"
-#include "src/string/memory_utils/strcmp_implementations.h"
+#include "src/string/memory_utils/inline_strcmp.h"
namespace __llvm_libc {
@@ -19,7 +19,7 @@ LLVM_LIBC_FUNCTION(int, strcasecmp, (const char *left, const char *right)) {
return __llvm_libc::internal::tolower(a) -
__llvm_libc::internal::tolower(b);
};
- return strcmp_implementation(left, right, case_cmp);
+ return inline_strcmp(left, right, case_cmp);
}
} // namespace __llvm_libc
diff --git a/libc/src/string/strcasestr.cpp b/libc/src/string/strcasestr.cpp
index a1272422f294de..61aca70d1e018e 100644
--- a/libc/src/string/strcasestr.cpp
+++ b/libc/src/string/strcasestr.cpp
@@ -10,7 +10,7 @@
#include "src/__support/common.h"
#include "src/__support/ctype_utils.h"
-#include "src/string/memory_utils/strstr_implementations.h"
+#include "src/string/memory_utils/inline_strstr.h"
namespace __llvm_libc {
@@ -22,7 +22,7 @@ LLVM_LIBC_FUNCTION(char *, strcasestr,
return __llvm_libc::internal::tolower(a) -
__llvm_libc::internal::tolower(b);
};
- return strstr_implementation(haystack, needle, case_cmp);
+ return inline_strstr(haystack, needle, case_cmp);
}
} // namespace __llvm_libc
diff --git a/libc/src/string/strcmp.cpp b/libc/src/string/strcmp.cpp
index 72a490c9f0da81..aca8874b00c670 100644
--- a/libc/src/string/strcmp.cpp
+++ b/libc/src/string/strcmp.cpp
@@ -9,13 +9,13 @@
#include "src/string/strcmp.h"
#include "src/__support/common.h"
-#include "src/string/memory_utils/strcmp_implementations.h"
+#include "src/string/memory_utils/inline_strcmp.h"
namespace __llvm_libc {
LLVM_LIBC_FUNCTION(int, strcmp, (const char *left, const char *right)) {
auto comp = [](char l, char r) -> int { return l - r; };
- return strcmp_implementation(left, right, comp);
+ return inline_strcmp(left, right, comp);
}
} // namespace __llvm_libc
diff --git a/libc/src/string/strcpy.cpp b/libc/src/string/strcpy.cpp
index e9832e52e5de67..cac4f6e63037e0 100644
--- a/libc/src/string/strcpy.cpp
+++ b/libc/src/string/strcpy.cpp
@@ -7,7 +7,7 @@
//===----------------------------------------------------------------------===//
#include "src/string/strcpy.h"
-#include "src/string/memory_utils/memcpy_implementations.h"
+#include "src/string/memory_utils/inline_memcpy.h"
#include "src/string/string_utils.h"
#include "src/__support/common.h"
diff --git a/libc/src/string/strdup.cpp b/libc/src/string/strdup.cpp
index 444b2918b72ad1..cafa0cb6994132 100644
--- a/libc/src/string/strdup.cpp
+++ b/libc/src/string/strdup.cpp
@@ -9,7 +9,7 @@
#include "src/string/strdup.h"
#include "src/errno/libc_errno.h"
#include "src/string/allocating_string_utils.h"
-#include "src/string/memory_utils/memcpy_implementations.h"
+#include "src/string/memory_utils/inline_memcpy.h"
#include "src/__support/common.h"
diff --git a/libc/src/string/string_utils.h b/libc/src/string/string_utils.h
index da4bcb955ab473..49c95190d1baa7 100644
--- a/libc/src/string/string_utils.h
+++ b/libc/src/string/string_utils.h
@@ -16,8 +16,8 @@
#include "src/__support/CPP/bitset.h"
#include "src/__support/macros/optimization.h" // LIBC_UNLIKELY
-#include "src/string/memory_utils/bzero_implementations.h"
-#include "src/string/memory_utils/memcpy_implementations.h"
+#include "src/string/memory_utils/inline_bzero.h"
+#include "src/string/memory_utils/inline_memcpy.h"
#include <stddef.h> // For size_t
namespace __llvm_libc {
diff --git a/libc/src/string/strncasecmp.cpp b/libc/src/string/strncasecmp.cpp
index 0fb2f81b17fe17..48445ccd317ba6 100644
--- a/libc/src/string/strncasecmp.cpp
+++ b/libc/src/string/strncasecmp.cpp
@@ -10,7 +10,7 @@
#include "src/__support/common.h"
#include "src/__support/ctype_utils.h"
-#include "src/string/memory_utils/strcmp_implementations.h"
+#include "src/string/memory_utils/inline_strcmp.h"
namespace __llvm_libc {
@@ -20,7 +20,7 @@ LLVM_LIBC_FUNCTION(int, strncasecmp,
return __llvm_libc::internal::tolower(a) -
__llvm_libc::internal::tolower(b);
};
- return strncmp_implementation(left, right, n, case_cmp);
+ return inline_strncmp(left, right, n, case_cmp);
}
} // namespace __llvm_libc
diff --git a/libc/src/string/strncmp.cpp b/libc/src/string/strncmp.cpp
index b8506636bb4e01..098f9e121568fb 100644
--- a/libc/src/string/strncmp.cpp
+++ b/libc/src/string/strncmp.cpp
@@ -9,7 +9,7 @@
#include "src/string/strncmp.h"
#include "src/__support/common.h"
-#include "src/string/memory_utils/strcmp_implementations.h"
+#include "src/string/memory_utils/inline_strcmp.h"
#include <stddef.h>
@@ -18,7 +18,7 @@ namespace __llvm_libc {
LLVM_LIBC_FUNCTION(int, strncmp,
(const char *left, const char *right, size_t n)) {
auto comp = [](char l, char r) -> int { return l - r; };
- return strncmp_implementation(left, right, n, comp);
+ return inline_strncmp(left, right, n, comp);
}
} // namespace __llvm_libc
diff --git a/libc/src/string/strndup.cpp b/libc/src/string/strndup.cpp
index bf766e701586f4..ca1c6ec406b374 100644
--- a/libc/src/string/strndup.cpp
+++ b/libc/src/string/strndup.cpp
@@ -7,7 +7,7 @@
//===----------------------------------------------------------------------===//
#include "src/string/strndup.h"
-#include "src/string/memory_utils/memcpy_implementations.h"
+#include "src/string/memory_utils/inline_memcpy.h"
#include "src/string/string_utils.h"
#include "src/__support/CPP/new.h"
diff --git a/libc/src/string/strstr.cpp b/libc/src/string/strstr.cpp
index 643461da599354..3a826784524433 100644
--- a/libc/src/string/strstr.cpp
+++ b/libc/src/string/strstr.cpp
@@ -9,7 +9,7 @@
#include "src/string/strstr.h"
#include "src/__support/common.h"
-#include "src/string/memory_utils/strstr_implementations.h"
+#include "src/string/memory_utils/inline_strstr.h"
namespace __llvm_libc {
@@ -17,7 +17,7 @@ namespace __llvm_libc {
// improved upon using well known string matching algorithms.
LLVM_LIBC_FUNCTION(char *, strstr, (const char *haystack, const char *needle)) {
auto comp = [](char l, char r) -> int { return l - r; };
- return strstr_implementation(haystack, needle, comp);
+ return inline_strstr(haystack, needle, comp);
}
} // namespace __llvm_libc
diff --git a/libc/src/string/strxfrm.cpp b/libc/src/string/strxfrm.cpp
index 5ee96d465ada91..a37c220b360384 100644
--- a/libc/src/string/strxfrm.cpp
+++ b/libc/src/string/strxfrm.cpp
@@ -7,7 +7,7 @@
//===----------------------------------------------------------------------===//
#include "src/string/strxfrm.h"
-#include "src/string/memory_utils/memcpy_implementations.h"
+#include "src/string/memory_utils/inline_memcpy.h"
#include "src/string/string_utils.h"
#include "src/__support/common.h"
diff --git a/libc/startup/linux/aarch64/CMakeLists.txt b/libc/startup/linux/aarch64/CMakeLists.txt
index 14efe0e58f3024..b47db8eb5d23f3 100644
--- a/libc/startup/linux/aarch64/CMakeLists.txt
+++ b/libc/startup/linux/aarch64/CMakeLists.txt
@@ -10,7 +10,7 @@ add_startup_object(
libc.src.__support.OSUtil.osutil
libc.src.stdlib.exit
libc.src.stdlib.atexit
- libc.src.string.memory_utils.memcpy_implementation
+ libc.src.string.memory_utils.inline_memcpy
libc.src.unistd.environ
COMPILE_OPTIONS
-fno-omit-frame-pointer
diff --git a/libc/startup/linux/aarch64/start.cpp b/libc/startup/linux/aarch64/start.cpp
index 9153c44e5904bd..67253bcd15cc03 100644
--- a/libc/startup/linux/aarch64/start.cpp
+++ b/libc/startup/linux/aarch64/start.cpp
@@ -11,7 +11,7 @@
#include "src/__support/threads/thread.h"
#include "src/stdlib/atexit.h"
#include "src/stdlib/exit.h"
-#include "src/string/memory_utils/memcpy_implementations.h"
+#include "src/string/memory_utils/inline_memcpy.h"
#include <arm_acle.h>
diff --git a/libc/startup/linux/riscv64/CMakeLists.txt b/libc/startup/linux/riscv64/CMakeLists.txt
index 14efe0e58f3024..b47db8eb5d23f3 100644
--- a/libc/startup/linux/riscv64/CMakeLists.txt
+++ b/libc/startup/linux/riscv64/CMakeLists.txt
@@ -10,7 +10,7 @@ add_startup_object(
libc.src.__support.OSUtil.osutil
libc.src.stdlib.exit
libc.src.stdlib.atexit
- libc.src.string.memory_utils.memcpy_implementation
+ libc.src.string.memory_utils.inline_memcpy
libc.src.unistd.environ
COMPILE_OPTIONS
-fno-omit-frame-pointer
diff --git a/libc/startup/linux/riscv64/start.cpp b/libc/startup/linux/riscv64/start.cpp
index 67aa3e6f8772ed..0a78397c3890d2 100644
--- a/libc/startup/linux/riscv64/start.cpp
+++ b/libc/startup/linux/riscv64/start.cpp
@@ -11,7 +11,7 @@
#include "src/__support/threads/thread.h"
#include "src/stdlib/atexit.h"
#include "src/stdlib/exit.h"
-#include "src/string/memory_utils/memcpy_implementations.h"
+#include "src/string/memory_utils/inline_memcpy.h"
#include <linux/auxvec.h>
#include <linux/elf.h>
diff --git a/libc/startup/linux/x86_64/CMakeLists.txt b/libc/startup/linux/x86_64/CMakeLists.txt
index 75c8296ee9e676..40f01836c13134 100644
--- a/libc/startup/linux/x86_64/CMakeLists.txt
+++ b/libc/startup/linux/x86_64/CMakeLists.txt
@@ -11,7 +11,7 @@ add_startup_object(
libc.src.__support.OSUtil.osutil
libc.src.stdlib.exit
libc.src.stdlib.atexit
- libc.src.string.memory_utils.memcpy_implementation
+ libc.src.string.memory_utils.inline_memcpy
libc.src.unistd.environ
COMPILE_OPTIONS
-fno-omit-frame-pointer
diff --git a/libc/startup/linux/x86_64/start.cpp b/libc/startup/linux/x86_64/start.cpp
index d4f2f49928abab..bbcd9ae43dd840 100644
--- a/libc/startup/linux/x86_64/start.cpp
+++ b/libc/startup/linux/x86_64/start.cpp
@@ -11,7 +11,7 @@
#include "src/__support/threads/thread.h"
#include "src/stdlib/atexit.h"
#include "src/stdlib/exit.h"
-#include "src/string/memory_utils/memcpy_implementations.h"
+#include "src/string/memory_utils/inline_memcpy.h"
#include <asm/prctl.h>
#include <linux/auxvec.h>
diff --git a/libc/test/integration/startup/gpu/rpc_stream_test.cpp b/libc/test/integration/startup/gpu/rpc_stream_test.cpp
index 3b1548649e4035..c9b823fdecd230 100644
--- a/libc/test/integration/startup/gpu/rpc_stream_test.cpp
+++ b/libc/test/integration/startup/gpu/rpc_stream_test.cpp
@@ -9,8 +9,8 @@
#include "src/__support/GPU/utils.h"
#include "src/__support/RPC/rpc_client.h"
#include "src/__support/integer_to_string.h"
-#include "src/string/memory_utils/memcmp_implementations.h"
-#include "src/string/memory_utils/memcpy_implementations.h"
+#include "src/string/memory_utils/inline_memcmp.h"
+#include "src/string/memory_utils/inline_memcpy.h"
#include "src/string/string_utils.h"
#include "test/IntegrationTest/test.h"
diff --git a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
index 3aba99e6741e46..52f4d42044c129 100644
--- a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
@@ -2012,32 +2012,32 @@ libc_support_library(
],
defines = MEMORY_COPTS,
textual_hdrs = [
- "src/string/memory_utils/aarch64/bcmp_implementations.h",
- "src/string/memory_utils/aarch64/memcmp_implementations.h",
- "src/string/memory_utils/aarch64/memcpy_implementations.h",
- "src/string/memory_utils/aarch64/memmove_implementations.h",
- "src/string/memory_utils/aarch64/memset_implementations.h",
- "src/string/memory_utils/bcmp_implementations.h",
- "src/string/memory_utils/bzero_implementations.h",
+ "src/string/memory_utils/aarch64/inline_bcmp.h",
+ "src/string/memory_utils/aarch64/inline_memcmp.h",
+ "src/string/memory_utils/aarch64/inline_memcpy.h",
+ "src/string/memory_utils/aarch64/inline_memmove.h",
+ "src/string/memory_utils/aarch64/inline_memset.h",
"src/string/memory_utils/generic/aligned_access.h",
"src/string/memory_utils/generic/byte_per_byte.h",
- "src/string/memory_utils/memcmp_implementations.h",
- "src/string/memory_utils/memcpy_implementations.h",
- "src/string/memory_utils/memmem_implementations.h",
- "src/string/memory_utils/memmove_implementations.h",
- "src/string/memory_utils/memset_implementations.h",
- "src/string/memory_utils/riscv/bcmp_implementations.h",
- "src/string/memory_utils/riscv/memcmp_implementations.h",
- "src/string/memory_utils/riscv/memcpy_implementations.h",
- "src/string/memory_utils/riscv/memmove_implementations.h",
- "src/string/memory_utils/riscv/memset_implementations.h",
- "src/string/memory_utils/strcmp_implementations.h",
- "src/string/memory_utils/strstr_implementations.h",
- "src/string/memory_utils/x86_64/bcmp_implementations.h",
- "src/string/memory_utils/x86_64/memcmp_implementations.h",
- "src/string/memory_utils/x86_64/memcpy_implementations.h",
- "src/string/memory_utils/x86_64/memmove_implementations.h",
- "src/string/memory_utils/x86_64/memset_implementations.h",
+ "src/string/memory_utils/inline_bcmp.h",
+ "src/string/memory_utils/inline_bzero.h",
+ "src/string/memory_utils/inline_memcmp.h",
+ "src/string/memory_utils/inline_memcpy.h",
+ "src/string/memory_utils/inline_memmem.h",
+ "src/string/memory_utils/inline_memmove.h",
+ "src/string/memory_utils/inline_memset.h",
+ "src/string/memory_utils/inline_strcmp.h",
+ "src/string/memory_utils/inline_strstr.h",
+ "src/string/memory_utils/riscv/inline_bcmp.h",
+ "src/string/memory_utils/riscv/inline_memcmp.h",
+ "src/string/memory_utils/riscv/inline_memcpy.h",
+ "src/string/memory_utils/riscv/inline_memmove.h",
+ "src/string/memory_utils/riscv/inline_memset.h",
+ "src/string/memory_utils/x86_64/inline_bcmp.h",
+ "src/string/memory_utils/x86_64/inline_memcmp.h",
+ "src/string/memory_utils/x86_64/inline_memcpy.h",
+ "src/string/memory_utils/x86_64/inline_memmove.h",
+ "src/string/memory_utils/x86_64/inline_memset.h",
],
deps = [
":__support_common",
More information about the libc-commits
mailing list