Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

jtstogel
Copy link
Contributor

No description provided.

@llvmbot llvmbot added libc bazel "Peripheral" support tier build system: utils/bazel labels Sep 12, 2025
@llvmbot
Copy link
Member

llvmbot commented Sep 12, 2025

@llvm/pr-subscribers-libc

Author: None (jtstogel)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/158327.diff

3 Files Affected:

  • (modified) utils/bazel/llvm-project-overlay/libc/BUILD.bazel (+177)
  • (modified) utils/bazel/llvm-project-overlay/libc/test/src/string/BUILD.bazel (+104)
  • (modified) utils/bazel/llvm-project-overlay/libc/test/src/strings/BUILD.bazel (+34)
diff --git a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
index d9b1bb5635aaf..039ca4e37fdb8 100644
--- a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
@@ -5223,6 +5223,27 @@ libc_support_library(
     ],
 )
 
+libc_function(
+    name = "index",
+    srcs = ["src/strings/index.cpp"],
+    hdrs = ["src/strings/index.h"],
+    deps = [
+        ":__support_common",
+        ":string_utils",
+    ],
+)
+
+libc_function(
+    name = "rindex",
+    srcs = ["src/strings/rindex.cpp"],
+    hdrs = ["src/strings/rindex.h"],
+    deps = [
+        ":__support_common",
+        ":__support_macros_null_check",
+        ":string_utils",
+    ],
+)
+
 libc_function(
     name = "memchr",
     srcs = ["src/string/memchr.cpp"],
@@ -5245,6 +5266,16 @@ libc_function(
     ],
 )
 
+libc_function(
+    name = "memccpy",
+    srcs = ["src/string/memccpy.cpp"],
+    hdrs = ["src/string/memccpy.h"],
+    deps = [
+        ":__support_common",
+        ":__support_macros_null_check",
+    ],
+)
+
 libc_function(
     name = "memset",
     srcs = ["src/string/memset.cpp"],
@@ -5256,6 +5287,17 @@ libc_function(
     ],
 )
 
+libc_function(
+    name = "memset_explicit",
+    srcs = ["src/string/memset_explicit.cpp"],
+    hdrs = ["src/string/memset_explicit.h"],
+    deps = [
+        ":__support_common",
+        ":__support_macros_null_check",
+        ":string_memory_utils",
+    ],
+)
+
 libc_function(
     name = "memmove",
     srcs = ["src/string/memmove.cpp"],
@@ -5267,6 +5309,17 @@ libc_function(
     ],
 )
 
+libc_function(
+    name = "memmem",
+    srcs = ["src/string/memmem.cpp"],
+    hdrs = ["src/string/memmem.h"],
+    deps = [
+        ":__support_common",
+        ":__support_macros_null_check",
+        ":string_memory_utils",
+    ],
+)
+
 libc_function(
     name = "mempcpy",
     srcs = ["src/string/mempcpy.cpp"],
@@ -5331,6 +5384,30 @@ libc_function(
     ],
 )
 
+libc_function(
+    name = "stpcpy",
+    srcs = ["src/string/stpcpy.cpp"],
+    hdrs = ["src/string/stpcpy.h"],
+    deps = [
+        ":__support_common",
+        ":__support_macros_null_check",
+        ":string_memory_utils",
+        ":string_utils",
+    ],
+)
+
+libc_function(
+    name = "stpncpy",
+    srcs = ["src/string/stpncpy.cpp"],
+    hdrs = ["src/string/stpncpy.h"],
+    deps = [
+        ":__support_common",
+        ":__support_macros_null_check",
+        ":string_memory_utils",
+        ":string_utils",
+    ],
+)
+
 libc_function(
     name = "strlen",
     srcs = ["src/string/strlen.cpp"],
@@ -5354,6 +5431,17 @@ libc_function(
     ],
 )
 
+libc_function(
+    name = "strlcpy",
+    srcs = ["src/string/strlcpy.cpp"],
+    hdrs = ["src/string/strlcpy.h"],
+    deps = [
+        ":__support_common",
+        ":llvm_libc_types_size_t",
+        ":string_utils",
+    ],
+)
+
 libc_function(
     name = "strncpy",
     srcs = ["src/string/strncpy.cpp"],
@@ -5375,6 +5463,40 @@ libc_function(
     ],
 )
 
+libc_function(
+    name = "strncmp",
+    srcs = ["src/string/strncmp.cpp"],
+    hdrs = ["src/string/strncmp.h"],
+    deps = [
+        ":__support_common",
+        ":__support_macros_null_check",
+        ":string_memory_utils",
+        ":string_utils",
+    ],
+)
+
+libc_function(
+    name = "strcasecmp",
+    srcs = ["src/strings/strcasecmp.cpp"],
+    hdrs = ["src/strings/strcasecmp.h"],
+    deps = [
+        ":__support_common",
+        ":__support_ctype_utils",
+        ":string_memory_utils",
+    ],
+)
+
+libc_function(
+    name = "strncasecmp",
+    srcs = ["src/strings/strncasecmp.cpp"],
+    hdrs = ["src/strings/strncasecmp.h"],
+    deps = [
+        ":__support_common",
+        ":__support_ctype_utils",
+        ":string_memory_utils",
+    ],
+)
+
 libc_function(
     name = "strchr",
     srcs = ["src/string/strchr.cpp"],
@@ -5395,6 +5517,16 @@ libc_function(
     ],
 )
 
+libc_function(
+    name = "strchrnul",
+    srcs = ["src/string/strchrnul.cpp"],
+    hdrs = ["src/string/strchrnul.h"],
+    deps = [
+        ":__support_common",
+        ":string_utils",
+    ],
+)
+
 libc_function(
     name = "strsep",
     srcs = ["src/string/strsep.cpp"],
@@ -5420,6 +5552,51 @@ libc_function(
     ],
 )
 
+libc_function(
+    name = "strcasestr",
+    srcs = ["src/string/strcasestr.cpp"],
+    hdrs = ["src/string/strcasestr.h"],
+    deps = [
+        ":__support_common",
+        ":__support_ctype_utils",
+        ":__support_macros_null_check",
+        ":string_memory_utils",
+        ":string_utils",
+    ],
+)
+
+libc_function(
+    name = "strcat",
+    srcs = ["src/string/strcat.cpp"],
+    hdrs = ["src/string/strcat.h"],
+    deps = [
+        ":__support_common",
+        ":__support_macros_null_check",
+        ":string_utils",
+    ],
+)
+
+libc_function(
+    name = "strlcat",
+    srcs = ["src/string/strlcat.cpp"],
+    hdrs = ["src/string/strlcat.h"],
+    deps = [
+        ":__support_common",
+        ":string_utils",
+    ],
+)
+
+libc_function(
+    name = "strncat",
+    srcs = ["src/string/strncat.cpp"],
+    hdrs = ["src/string/strncat.h"],
+    deps = [
+        ":__support_common",
+        ":__support_macros_null_check",
+        ":string_utils",
+    ],
+)
+
 libc_function(
     name = "strnlen",
     srcs = ["src/string/strnlen.cpp"],
diff --git a/utils/bazel/llvm-project-overlay/libc/test/src/string/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/test/src/string/BUILD.bazel
index 1a95dece8bf20..e78f0a57de3ae 100644
--- a/utils/bazel/llvm-project-overlay/libc/test/src/string/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libc/test/src/string/BUILD.bazel
@@ -27,6 +27,33 @@ libc_test(
     ],
 )
 
+libc_test(
+    name = "strlcpy_test",
+    srcs = ["strlcpy_test.cpp"],
+    deps = [
+        "//libc:strlcpy",
+    ],
+)
+
+libc_test(
+    name = "stpcpy_test",
+    srcs = ["stpcpy_test.cpp"],
+    deps = [
+        "//libc:stpcpy",
+        "//libc:string_utils",
+    ],
+)
+
+libc_test(
+    name = "stpncpy_test",
+    srcs = ["stpncpy_test.cpp"],
+    deps = [
+        "//libc:__support_cpp_span",
+        "//libc:hdr_signal_macros",
+        "//libc:stpncpy",
+    ],
+)
+
 libc_test(
     name = "strcmp_test",
     srcs = ["strcmp_test.cpp"],
@@ -35,6 +62,14 @@ libc_test(
     ],
 )
 
+libc_test(
+    name = "strncmp_test",
+    srcs = ["strncmp_test.cpp"],
+    deps = [
+        "//libc:strncmp",
+    ],
+)
+
 libc_test(
     name = "memchr_test",
     srcs = ["memchr_test.cpp"],
@@ -59,6 +94,14 @@ libc_test(
     ],
 )
 
+libc_test(
+    name = "strchrnul_test",
+    srcs = ["strchrnul_test.cpp"],
+    deps = [
+        "//libc:strchrnul",
+    ],
+)
+
 libc_test(
     name = "strpbrk_test",
     srcs = ["strpbrk_test.cpp"],
@@ -110,6 +153,39 @@ libc_test(
     ],
 )
 
+libc_test(
+    name = "strcasestr_test",
+    srcs = ["strcasestr_test.cpp"],
+    deps = [
+        "//libc:strcasestr",
+    ],
+)
+
+libc_test(
+    name = "strcat_test",
+    srcs = ["strcat_test.cpp"],
+    deps = [
+        "//libc:hdr_signal_macros",
+        "//libc:strcat",
+    ],
+)
+
+libc_test(
+    name = "strlcat_test",
+    srcs = ["strlcat_test.cpp"],
+    deps = [
+        "//libc:strlcat",
+    ],
+)
+
+libc_test(
+    name = "strncat_test",
+    srcs = ["strncat_test.cpp"],
+    deps = [
+        "//libc:strncat",
+    ],
+)
+
 libc_test(
     name = "strcspn_test",
     srcs = ["strcspn_test.cpp"],
@@ -178,6 +254,15 @@ libc_test(
     ],
 )
 
+libc_test(
+    name = "memccpy_test",
+    srcs = ["memccpy_test.cpp"],
+    deps = [
+        "//libc:__support_cpp_span",
+        "//libc:memccpy",
+    ],
+)
+
 libc_test(
     name = "mempcpy_test",
     srcs = ["mempcpy_test.cpp"],
@@ -199,6 +284,16 @@ libc_test(
     ],
 )
 
+libc_test(
+    name = "memset_explicit_test",
+    srcs = ["memset_explicit_test.cpp"],
+    deps = [
+        "//libc:memset_explicit",
+        "//libc:string_memory_utils",
+        ":memory_check_utils",
+    ],
+)
+
 libc_test(
     name = "memmove_test",
     srcs = ["memmove_test.cpp"],
@@ -222,3 +317,12 @@ libc_test(
         "//libc/test/UnitTest:test_logger",
     ],
 )
+
+libc_test(
+    name = "memmem_test",
+    srcs = ["memmem_test.cpp"],
+    deps = [
+        "//libc:string_utils",
+        "//libc:memmem",
+    ],
+)
diff --git a/utils/bazel/llvm-project-overlay/libc/test/src/strings/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/test/src/strings/BUILD.bazel
index 2e6f5644eec71..e576d2177687e 100644
--- a/utils/bazel/llvm-project-overlay/libc/test/src/strings/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libc/test/src/strings/BUILD.bazel
@@ -39,3 +39,37 @@ libc_test(
         "//libc/test/src/string:memory_check_utils",
     ],
 )
+
+libc_test(
+    name = "index_test",
+    srcs = ["index_test.cpp"],
+    deps = [
+        "//libc:index",
+        "//libc/test/src/string:strchr_test_helper",
+    ],
+)
+
+libc_test(
+    name = "rindex_test",
+    srcs = ["rindex_test.cpp"],
+    deps = [
+        "//libc:rindex",
+        "//libc/test/src/string:strchr_test_helper",
+    ],
+)
+
+libc_test(
+    name = "strcasecmp_test",
+    srcs = ["strcasecmp_test.cpp"],
+    deps = [
+        "//libc:strcasecmp",
+    ],
+)
+
+libc_test(
+    name = "strncasecmp_test",
+    srcs = ["strncasecmp_test.cpp"],
+    deps = [
+        "//libc:strncasecmp",
+    ],
+)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bazel "Peripheral" support tier build system: utils/bazel libc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants