[llvm] [libc] add mempcpy to bazel overlay (PR #75383)

Nick Desaulniers via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 13 13:22:53 PST 2023


https://github.com/nickdesaulniers created https://github.com/llvm/llvm-project/pull/75383

We'd like to begin overlaying mempcpy.


>From 2537ac96f188651f904b05c2124c0505e9391376 Mon Sep 17 00:00:00 2001
From: Nick Desaulniers <ndesaulniers at google.com>
Date: Wed, 13 Dec 2023 13:22:02 -0800
Subject: [PATCH] [libc] add mempcpy to bazel overlay

We'd like to begin overlaying mempcpy.
---
 utils/bazel/llvm-project-overlay/libc/BUILD.bazel   | 13 +++++++++++++
 .../libc/test/src/string/BUILD.bazel                |  8 ++++++++
 2 files changed, 21 insertions(+)

diff --git a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
index b9bdb8f7c6d3eb..d4f2c078db79d9 100644
--- a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
@@ -2274,6 +2274,19 @@ libc_function(
     ],
 )
 
+libc_function(
+    name = "mempcpy",
+    srcs = ["src/string/mempcpy.cpp"],
+    hdrs = ["src/string/mempcpy.h"],
+    copts = ["-mllvm --tail-merge-threshold=0"],
+    features = no_sanitize_features,
+    weak = True,
+    deps = [
+        ":__support_common",
+        ":string_memory_utils",
+    ],
+)
+
 libc_function(
     name = "bcopy",
     srcs = ["src/string/bcopy.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 723c0735b1a375..d96f390c0c3804 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
@@ -135,6 +135,14 @@ libc_test(
     deps = [":memory_check_utils"],
 )
 
+libc_test(
+    name = "mempcpy_test",
+    srcs = ["mempcpy_test.cpp"],
+    libc_function_deps = [
+        "//libc:mempcpy",
+    ],
+)
+
 libc_test(
     name = "memset_test",
     srcs = ["memset_test.cpp"],



More information about the llvm-commits mailing list