[libc] Add memmem implementation
authorCaslyn Tonelli <caslyn@google.com>
Fri, 7 Apr 2023 22:16:01 +0000 (22:16 +0000)
committerCaslyn Tonelli <caslyn@google.com>
Tue, 11 Apr 2023 20:49:25 +0000 (20:49 +0000)
commit718729e9971d4ad12d8c7cb088c661202564cf34
treedc38f3b53485679fde47eca928020e017ed48914
parent1fa26e64fd87c848ff54d08e9a14ea03e01ae645
[libc] Add memmem implementation

Introduce the `memmem` libc string function.

`memmem_implementation` performs shared logic for `strstr`,
`strcasestr`, and `memmem`; essentially reconfiguring what was the
`strstr_implementation` to support length parameters.

Differential Revision: https://reviews.llvm.org/D147822
19 files changed:
libc/config/baremetal/arm/entrypoints.txt
libc/config/darwin/arm/entrypoints.txt
libc/config/darwin/x86_64/entrypoints.txt
libc/config/gpu/entrypoints.txt
libc/config/linux/aarch64/entrypoints.txt
libc/config/linux/arm/entrypoints.txt
libc/config/linux/riscv64/entrypoints.txt
libc/config/linux/x86_64/entrypoints.txt
libc/config/windows/entrypoints.txt
libc/spec/gnu_ext.td
libc/src/string/CMakeLists.txt
libc/src/string/memmem.cpp [new file with mode: 0644]
libc/src/string/memmem.h [new file with mode: 0644]
libc/src/string/memory_utils/CMakeLists.txt
libc/src/string/memory_utils/memmem_implementations.h [new file with mode: 0644]
libc/src/string/memory_utils/strstr_implementations.h
libc/test/src/string/CMakeLists.txt
libc/test/src/string/memmem_test.cpp [new file with mode: 0644]
utils/bazel/llvm-project-overlay/libc/BUILD.bazel