[libc-commits] [libc] dc1b614 - [libc] Move b* string functions to strings.h

Alex Brachet via libc-commits libc-commits at lists.llvm.org
Mon Jan 9 12:16:54 PST 2023


Author: Alex Brachet
Date: 2023-01-09T20:16:20Z
New Revision: dc1b614bb8b0181f7443848633807f5fb934c6b2

URL: https://github.com/llvm/llvm-project/commit/dc1b614bb8b0181f7443848633807f5fb934c6b2
DIFF: https://github.com/llvm/llvm-project/commit/dc1b614bb8b0181f7443848633807f5fb934c6b2.diff

LOG: [libc] Move b* string functions to strings.h

Traditionally these functions are exposed in string*s*.h not string.h

Differential Revision: https://reviews.llvm.org/D141237

Added: 
    libc/include/strings.h.def

Modified: 
    libc/include/CMakeLists.txt
    libc/spec/llvm_libc_ext.td

Removed: 
    


################################################################################
diff  --git a/libc/include/CMakeLists.txt b/libc/include/CMakeLists.txt
index 6fa2593f69769..df61a5599567e 100644
--- a/libc/include/CMakeLists.txt
+++ b/libc/include/CMakeLists.txt
@@ -95,6 +95,15 @@ add_gen_header(
     .llvm-libc-types.size_t
 )
 
+add_gen_header(
+  strings
+  DEF_FILE strings.h.def
+  GEN_HDR strings.h
+  DEPENDS
+    .llvm_libc_common_h
+    .llvm-libc-types.size_t
+)
+
 add_gen_header(
   time
   DEF_FILE time.h.def

diff  --git a/libc/include/strings.h.def b/libc/include/strings.h.def
new file mode 100644
index 0000000000000..f07ca30d5dbd0
--- /dev/null
+++ b/libc/include/strings.h.def
@@ -0,0 +1,16 @@
+//===-- C standard library header strings.h -------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_STRINGS_H
+#define LLVM_LIBC_STRINGS_H
+
+#include <__llvm-libc-common.h>
+
+%%public_api()
+
+#endif // LLVM_LIBC_STRINGS_H

diff  --git a/libc/spec/llvm_libc_ext.td b/libc/spec/llvm_libc_ext.td
index 731671f7306bc..5e1ae2cfd060d 100644
--- a/libc/spec/llvm_libc_ext.td
+++ b/libc/spec/llvm_libc_ext.td
@@ -1,6 +1,6 @@
 def LLVMLibcExt : StandardSpec<"llvm_libc_ext"> {
-  HeaderSpec String = HeaderSpec<
-      "string.h",
+  HeaderSpec Strings = HeaderSpec<
+      "strings.h",
       [], // Macros
       [], // Types
       [], // Enumerations
@@ -52,7 +52,7 @@ def LLVMLibcExt : StandardSpec<"llvm_libc_ext"> {
   >;
 
   let Headers = [
-    String,
+    Strings,
     Sched,
     Assert,
   ];


        


More information about the libc-commits mailing list