[libc-commits] [libc] 188f72a - [libc] Move implementations of strcat and strcpy to the string directory.
Siva Chandra Reddy via libc-commits
libc-commits at lists.llvm.org
Mon Jan 6 22:28:30 PST 2020
Author: Siva Chandra Reddy
Date: 2020-01-06T22:20:42-08:00
New Revision: 188f72ab20d9523d6ffde8ad8361ecf17bb75946
URL: https://github.com/llvm/llvm-project/commit/188f72ab20d9523d6ffde8ad8361ecf17bb75946
DIFF: https://github.com/llvm/llvm-project/commit/188f72ab20d9523d6ffde8ad8361ecf17bb75946.diff
LOG: [libc] Move implementations of strcat and strcpy to the string directory.
Summary:
Now that tests live in separate top-level directory, keeping the
implementations of individual functions in a directory of their own is
not meaningful. Hence, this change moves them into the higher level
string directory.
NFC intended.
Reviewers: MaskRay
Subscribers: mgorny, tschuett, libc-commits
Tags: #libc-project
Differential Revision: https://reviews.llvm.org/D72295
Added:
libc/src/string/strcat.cpp
libc/src/string/strcat.h
libc/src/string/strcpy.cpp
libc/src/string/strcpy.h
Modified:
libc/src/string/CMakeLists.txt
libc/test/src/string/strcat_test.cpp
libc/test/src/string/strcpy_test.cpp
Removed:
libc/src/string/strcat/CMakeLists.txt
libc/src/string/strcat/strcat.cpp
libc/src/string/strcat/strcat.h
libc/src/string/strcpy/CMakeLists.txt
libc/src/string/strcpy/strcpy.cpp
libc/src/string/strcpy/strcpy.h
################################################################################
diff --git a/libc/src/string/CMakeLists.txt b/libc/src/string/CMakeLists.txt
index 459d9489e3a9..b53da2118250 100644
--- a/libc/src/string/CMakeLists.txt
+++ b/libc/src/string/CMakeLists.txt
@@ -1,2 +1,20 @@
-add_subdirectory(strcpy)
-add_subdirectory(strcat)
+add_entrypoint_object(
+ strcat
+ SRCS
+ strcat.cpp
+ HDRS
+ strcat.h
+ DEPENDS
+ strcpy
+ string_h
+)
+
+add_entrypoint_object(
+ strcpy
+ SRCS
+ strcpy.cpp
+ HDRS
+ strcpy.h
+ DEPENDS
+ string_h
+)
diff --git a/libc/src/string/strcat/strcat.cpp b/libc/src/string/strcat.cpp
similarity index 90%
rename from libc/src/string/strcat/strcat.cpp
rename to libc/src/string/strcat.cpp
index 09cc62d25e2b..366b1854e601 100644
--- a/libc/src/string/strcat/strcat.cpp
+++ b/libc/src/string/strcat.cpp
@@ -6,10 +6,10 @@
//
//===----------------------------------------------------------------------===//
-#include "src/string/strcat/strcat.h"
+#include "src/string/strcat.h"
#include "src/__support/common.h"
-#include "src/string/strcpy/strcpy.h"
+#include "src/string/strcpy.h"
namespace __llvm_libc {
diff --git a/libc/src/string/strcat/strcat.h b/libc/src/string/strcat.h
similarity index 100%
rename from libc/src/string/strcat/strcat.h
rename to libc/src/string/strcat.h
diff --git a/libc/src/string/strcat/CMakeLists.txt b/libc/src/string/strcat/CMakeLists.txt
deleted file mode 100644
index e37e4262b3ef..000000000000
--- a/libc/src/string/strcat/CMakeLists.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-add_entrypoint_object(
- strcat
- SRCS
- strcat.cpp
- HDRS
- strcat.h
- DEPENDS
- strcpy
- string_h
-)
diff --git a/libc/src/string/strcpy/strcpy.cpp b/libc/src/string/strcpy.cpp
similarity index 94%
rename from libc/src/string/strcpy/strcpy.cpp
rename to libc/src/string/strcpy.cpp
index 0dfb1e35e41a..22fe4ccffa40 100644
--- a/libc/src/string/strcpy/strcpy.cpp
+++ b/libc/src/string/strcpy.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "src/string/strcpy/strcpy.h"
+#include "src/string/strcpy.h"
#include "src/__support/common.h"
diff --git a/libc/src/string/strcpy/strcpy.h b/libc/src/string/strcpy.h
similarity index 100%
rename from libc/src/string/strcpy/strcpy.h
rename to libc/src/string/strcpy.h
diff --git a/libc/src/string/strcpy/CMakeLists.txt b/libc/src/string/strcpy/CMakeLists.txt
deleted file mode 100644
index 411333a73a8e..000000000000
--- a/libc/src/string/strcpy/CMakeLists.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-add_entrypoint_object(
- strcpy
- SRCS
- strcpy.cpp
- HDRS
- strcpy.h
- DEPENDS
- string_h
-)
diff --git a/libc/test/src/string/strcat_test.cpp b/libc/test/src/string/strcat_test.cpp
index 3b8a7a7e4472..fde432bcec8a 100644
--- a/libc/test/src/string/strcat_test.cpp
+++ b/libc/test/src/string/strcat_test.cpp
@@ -8,7 +8,7 @@
#include <string>
-#include "src/string/strcat/strcat.h"
+#include "src/string/strcat.h"
#include "gtest/gtest.h"
TEST(StrCatTest, EmptyDest) {
diff --git a/libc/test/src/string/strcpy_test.cpp b/libc/test/src/string/strcpy_test.cpp
index e68ea5103dbb..56f75ac9e5f0 100644
--- a/libc/test/src/string/strcpy_test.cpp
+++ b/libc/test/src/string/strcpy_test.cpp
@@ -8,7 +8,7 @@
#include <string>
-#include "src/string/strcpy/strcpy.h"
+#include "src/string/strcpy.h"
#include "gtest/gtest.h"
TEST(StrCpyTest, EmptyDest) {
More information about the libc-commits
mailing list