-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[libc] Switched calls to inline_memcpy to __builtin_memcpy for wide char utilities #143011
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@llvm/pr-subscribers-libc Author: Uzair Nawaz (uzairnawaz) ChangesSwitched calls to inline_memcpy to __builtin_memcpy for wide char utilities Full diff: https://github.com/llvm/llvm-project/pull/143011.diff 5 Files Affected:
diff --git a/libc/src/wchar/CMakeLists.txt b/libc/src/wchar/CMakeLists.txt
index 759f708c2247a..99fb1c4a9da53 100644
--- a/libc/src/wchar/CMakeLists.txt
+++ b/libc/src/wchar/CMakeLists.txt
@@ -206,7 +206,6 @@ add_entrypoint_object(
libc.hdr.types.size_t
libc.hdr.wchar_macros
libc.src.__support.wctype_utils
- libc.src.string.memory_utils.inline_memcpy
)
add_entrypoint_object(
@@ -218,6 +217,5 @@ add_entrypoint_object(
DEPENDS
libc.hdr.types.size_t
libc.hdr.wchar_macros
- libc.src.string.memory_utils.inline_memcpy
libc.src.string.string_utils
)
diff --git a/libc/src/wchar/wcscpy.cpp b/libc/src/wchar/wcscpy.cpp
index dc46b972c59f7..01ba994cecbb2 100644
--- a/libc/src/wchar/wcscpy.cpp
+++ b/libc/src/wchar/wcscpy.cpp
@@ -12,7 +12,6 @@
#include "hdr/types/wchar_t.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
-#include "src/string/memory_utils/inline_memcpy.h"
#include "src/string/string_utils.h"
namespace LIBC_NAMESPACE_DECL {
@@ -20,7 +19,7 @@ namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(wchar_t *, wcscpy,
(wchar_t *__restrict s1, const wchar_t *__restrict s2)) {
size_t size = internal::string_length(s2) + 1;
- inline_memcpy(s1, s2, size * sizeof(wchar_t));
+ __builtin_memcpy(s1, s2, size * sizeof(wchar_t));
return s1;
}
diff --git a/libc/src/wchar/wcsncpy.cpp b/libc/src/wchar/wcsncpy.cpp
index e7ae9a4a0da79..6ea95d3d97b15 100644
--- a/libc/src/wchar/wcsncpy.cpp
+++ b/libc/src/wchar/wcsncpy.cpp
@@ -12,7 +12,6 @@
#include "hdr/types/wchar_t.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
-#include "src/string/memory_utils/inline_memcpy.h"
#include "src/string/string_utils.h"
namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/wchar/wmemcpy.cpp b/libc/src/wchar/wmemcpy.cpp
index 56708d6cee496..bf92309b20944 100644
--- a/libc/src/wchar/wmemcpy.cpp
+++ b/libc/src/wchar/wmemcpy.cpp
@@ -12,14 +12,13 @@
#include "hdr/types/wchar_t.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
-#include "src/string/memory_utils/inline_memcpy.h"
namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(wchar_t *, wmemcpy,
(wchar_t *__restrict s1, const wchar_t *__restrict s2,
size_t n)) {
- inline_memcpy(s1, s2, n * sizeof(wchar_t));
+ __builtin_memcpy(s1, s2, n * sizeof(wchar_t));
return s1;
}
diff --git a/libc/src/wchar/wmempcpy.cpp b/libc/src/wchar/wmempcpy.cpp
index d8b89c0a88d05..21e16210a757a 100644
--- a/libc/src/wchar/wmempcpy.cpp
+++ b/libc/src/wchar/wmempcpy.cpp
@@ -11,14 +11,13 @@
#include "hdr/types/size_t.h"
#include "hdr/types/wchar_t.h"
#include "src/__support/common.h"
-#include "src/string/memory_utils/inline_memcpy.h"
namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(wchar_t *, wmempcpy,
(wchar_t *__restrict to, const wchar_t *__restrict from,
size_t size)) {
- inline_memcpy(to, from, size * sizeof(wchar_t));
+ __builtin_memcpy(to, from, size * sizeof(wchar_t));
return reinterpret_cast<wchar_t *>(to) + size;
}
|
libc/src/wchar/wcsncpy.cpp
Outdated
@@ -12,7 +12,6 @@ | |||
#include "hdr/types/wchar_t.h" | |||
#include "src/__support/common.h" | |||
#include "src/__support/macros/config.h" | |||
#include "src/string/memory_utils/inline_memcpy.h" | |||
#include "src/string/string_utils.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it doesn't seem like string_utils
is getting used here either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…har utilities (llvm#143011) Switched calls to inline_memcpy to __builtin_memcpy for wide char utilities Removed unnecessary wctype_utils dependencies from the cmake file
…har utilities (llvm#143011) Switched calls to inline_memcpy to __builtin_memcpy for wide char utilities Removed unnecessary wctype_utils dependencies from the cmake file
Switched calls to inline_memcpy to __builtin_memcpy for wide char utilities
Removed unnecessary wctype_utils dependencies from the cmake file