[libc-commits] [libc] 90eb7be - [libc] Fix memcpy to adhere to qualified calls.
Paula Toth via libc-commits
libc-commits at lists.llvm.org
Fri Apr 3 15:28:21 PDT 2020
Author: Paula Toth
Date: 2020-04-03T15:27:57-07:00
New Revision: 90eb7be6a1753d426ad01de95e3f1a23b077f8df
URL: https://github.com/llvm/llvm-project/commit/90eb7be6a1753d426ad01de95e3f1a23b077f8df
DIFF: https://github.com/llvm/llvm-project/commit/90eb7be6a1753d426ad01de95e3f1a23b077f8df.diff
LOG: [libc] Fix memcpy to adhere to qualified calls.
Summary: Switched to using the new memcpy implementation.
Reviewers: sivachandra, abrachet, gchatelet
Reviewed By: abrachet, gchatelet
Subscribers: mgorny, MaskRay, tschuett, libc-commits
Tags: #libc-project
Differential Revision: https://reviews.llvm.org/D77277
Added:
Modified:
libc/fuzzing/string/CMakeLists.txt
libc/src/string/CMakeLists.txt
libc/src/string/strcpy.cpp
libc/test/src/string/CMakeLists.txt
Removed:
################################################################################
diff --git a/libc/fuzzing/string/CMakeLists.txt b/libc/fuzzing/string/CMakeLists.txt
index c28c0e4dd0d3..e70e91c0df99 100644
--- a/libc/fuzzing/string/CMakeLists.txt
+++ b/libc/fuzzing/string/CMakeLists.txt
@@ -5,4 +5,5 @@ add_libc_fuzzer(
DEPENDS
strcpy
strlen
+ memcpy
)
diff --git a/libc/src/string/CMakeLists.txt b/libc/src/string/CMakeLists.txt
index abe978767989..a22298a8cf52 100644
--- a/libc/src/string/CMakeLists.txt
+++ b/libc/src/string/CMakeLists.txt
@@ -21,6 +21,7 @@ add_entrypoint_object(
DEPENDS
string_h
strlen
+ memcpy
)
add_entrypoint_object(
diff --git a/libc/src/string/strcpy.cpp b/libc/src/string/strcpy.cpp
index 46cdb1c87314..b3cdeb7114ad 100644
--- a/libc/src/string/strcpy.cpp
+++ b/libc/src/string/strcpy.cpp
@@ -8,6 +8,7 @@
#include "src/string/strcpy.h"
#include "src/string/strlen.h"
+#include "src/string/memcpy.h"
#include "src/__support/common.h"
@@ -15,7 +16,7 @@ namespace __llvm_libc {
char *LLVM_LIBC_ENTRYPOINT(strcpy)(char *dest, const char *src) {
return reinterpret_cast<char *>(
- ::memcpy(dest, src, __llvm_libc::strlen(src) + 1));
+ __llvm_libc::memcpy(dest, src, __llvm_libc::strlen(src) + 1));
}
} // namespace __llvm_libc
diff --git a/libc/test/src/string/CMakeLists.txt b/libc/test/src/string/CMakeLists.txt
index cb134515081b..fe15145348cd 100644
--- a/libc/test/src/string/CMakeLists.txt
+++ b/libc/test/src/string/CMakeLists.txt
@@ -12,6 +12,8 @@ add_libc_unittest(
strcat
strcpy
strlen
+# TODO (sivachandra): remove redundant deps.
+ memcpy
)
add_libc_unittest(
@@ -23,6 +25,8 @@ add_libc_unittest(
DEPENDS
strcpy
strlen
+# TODO (sivachandra): remove redundant deps.
+ memcpy
)
add_libc_unittest(
More information about the libc-commits
mailing list