[libc] Move implementations of strcat and strcpy to the string directory.
authorSiva Chandra Reddy <sivachandra@google.com>
Mon, 6 Jan 2020 18:38:45 +0000 (10:38 -0800)
committerSiva Chandra Reddy <sivachandra@google.com>
Tue, 7 Jan 2020 06:20:42 +0000 (22:20 -0800)
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

libc/src/string/CMakeLists.txt
libc/src/string/strcat.cpp [moved from libc/src/string/strcat/strcat.cpp with 90% similarity]
libc/src/string/strcat.h [moved from libc/src/string/strcat/strcat.h with 100% similarity]
libc/src/string/strcat/CMakeLists.txt [deleted file]
libc/src/string/strcpy.cpp [moved from libc/src/string/strcpy/strcpy.cpp with 94% similarity]
libc/src/string/strcpy.h [moved from libc/src/string/strcpy/strcpy.h with 100% similarity]
libc/src/string/strcpy/CMakeLists.txt [deleted file]
libc/test/src/string/strcat_test.cpp
libc/test/src/string/strcpy_test.cpp

index 459d948..b53da21 100644 (file)
@@ -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
+)
similarity index 90%
rename from libc/src/string/strcat/strcat.cpp
rename to libc/src/string/strcat.cpp
index 09cc62d..366b185 100644 (file)
@@ -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/CMakeLists.txt b/libc/src/string/strcat/CMakeLists.txt
deleted file mode 100644 (file)
index e37e426..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-add_entrypoint_object(
-  strcat
-  SRCS
-    strcat.cpp
-  HDRS
-    strcat.h
-  DEPENDS
-    strcpy
-    string_h
-)
similarity index 94%
rename from libc/src/string/strcpy/strcpy.cpp
rename to libc/src/string/strcpy.cpp
index 0dfb1e3..22fe4cc 100644 (file)
@@ -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/CMakeLists.txt b/libc/src/string/strcpy/CMakeLists.txt
deleted file mode 100644 (file)
index 411333a..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-add_entrypoint_object(
-  strcpy
-  SRCS
-    strcpy.cpp
-  HDRS
-    strcpy.h
-  DEPENDS
-    string_h
-)
index 3b8a7a7..fde432b 100644 (file)
@@ -8,7 +8,7 @@
 
 #include <string>
 
-#include "src/string/strcat/strcat.h"
+#include "src/string/strcat.h"
 #include "gtest/gtest.h"
 
 TEST(StrCatTest, EmptyDest) {
index e68ea51..56f75ac 100644 (file)
@@ -8,7 +8,7 @@
 
 #include <string>
 
-#include "src/string/strcpy/strcpy.h"
+#include "src/string/strcpy.h"
 #include "gtest/gtest.h"
 
 TEST(StrCpyTest, EmptyDest) {