https://github.com/bassiounix updated https://github.com/llvm/llvm-project/pull/164090
>From 284db13e0fede3c8ca1aa4853ee1b86438f7ab02 Mon Sep 17 00:00:00 2001 From: bassiounix <[email protected]> Date: Tue, 14 Oct 2025 06:20:42 +0300 Subject: [PATCH] [libc][stdlib][annex_k] Add ignore_handler_s. --- libc/config/linux/aarch64/entrypoints.txt | 1 + libc/config/linux/riscv/entrypoints.txt | 1 + libc/config/linux/x86_64/entrypoints.txt | 1 + libc/include/CMakeLists.txt | 1 + libc/include/stdlib.yaml | 9 +++++++++ libc/src/stdlib/CMakeLists.txt | 13 +++++++++++++ libc/src/stdlib/ignore_handler_s.cpp | 16 ++++++++++++++++ libc/src/stdlib/ignore_handler_s.h | 22 ++++++++++++++++++++++ 8 files changed, 64 insertions(+) create mode 100644 libc/src/stdlib/ignore_handler_s.cpp create mode 100644 libc/src/stdlib/ignore_handler_s.h diff --git a/libc/config/linux/aarch64/entrypoints.txt b/libc/config/linux/aarch64/entrypoints.txt index 39e1d9caa98747..f99686d81d9a7b 100644 --- a/libc/config/linux/aarch64/entrypoints.txt +++ b/libc/config/linux/aarch64/entrypoints.txt @@ -1393,6 +1393,7 @@ if(LLVM_LIBC_FULL_BUILD) libc.src.stdlib.clearenv libc.src.stdlib.exit libc.src.stdlib.getenv + libc.src.stdlib.ignore_handler_s libc.src.stdlib.putenv libc.src.stdlib.secure_getenv libc.src.stdlib.setenv diff --git a/libc/config/linux/riscv/entrypoints.txt b/libc/config/linux/riscv/entrypoints.txt index 794cd156403c9f..e44725e0bc39cb 100644 --- a/libc/config/linux/riscv/entrypoints.txt +++ b/libc/config/linux/riscv/entrypoints.txt @@ -1574,6 +1574,7 @@ if(LLVM_LIBC_FULL_BUILD) libc.src.stdlib.clearenv libc.src.stdlib.exit libc.src.stdlib.getenv + libc.src.stdlib.ignore_handler_s libc.src.stdlib.putenv libc.src.stdlib.secure_getenv libc.src.stdlib.setenv diff --git a/libc/config/linux/x86_64/entrypoints.txt b/libc/config/linux/x86_64/entrypoints.txt index 7c40cc36f5b5b1..257cde1e4e1db9 100644 --- a/libc/config/linux/x86_64/entrypoints.txt +++ b/libc/config/linux/x86_64/entrypoints.txt @@ -1600,6 +1600,7 @@ if(LLVM_LIBC_FULL_BUILD) libc.src.stdlib.clearenv libc.src.stdlib.exit libc.src.stdlib.getenv + libc.src.stdlib.ignore_handler_s libc.src.stdlib.putenv libc.src.stdlib.secure_getenv libc.src.stdlib.setenv diff --git a/libc/include/CMakeLists.txt b/libc/include/CMakeLists.txt index d85b2b75a3fcf4..703ed29db743fc 100644 --- a/libc/include/CMakeLists.txt +++ b/libc/include/CMakeLists.txt @@ -539,6 +539,7 @@ add_header_macro( ../libc/include/stdlib.yaml stdlib.h DEPENDS + .llvm-libc-macros.annex_k_macros .llvm-libc-macros.null_macro .llvm-libc-macros.stdlib_macros .llvm-libc-types.__atexithandler_t diff --git a/libc/include/stdlib.yaml b/libc/include/stdlib.yaml index 77c9145cdd862b..dc761a12bf8071 100644 --- a/libc/include/stdlib.yaml +++ b/libc/include/stdlib.yaml @@ -131,6 +131,15 @@ functions: arguments: - type: double[] - type: int + - name: ignore_handler_s + standards: + - stdc + return_type: void + arguments: + - type: const char *__restrict + - type: void *__restrict + - type: errno_t + guard: 'LIBC_HAS_ANNEX_K' - name: labs standards: - stdc diff --git a/libc/src/stdlib/CMakeLists.txt b/libc/src/stdlib/CMakeLists.txt index 444499f6486040..5e88b1aeda7672 100644 --- a/libc/src/stdlib/CMakeLists.txt +++ b/libc/src/stdlib/CMakeLists.txt @@ -930,3 +930,16 @@ add_entrypoint_object( DEPENDS .${LIBC_TARGET_OS}.system ) + +add_entrypoint_object( + ignore_handler_s + HDRS + ignore_handler_s.h + SRCS + ignore_handler_s.cpp + DEPENDS + libc.hdr.types.errno_t + libc.src.__support.libc_errno + libc.src.__support.macros.config + libc.src.__support.macros.attributes +) diff --git a/libc/src/stdlib/ignore_handler_s.cpp b/libc/src/stdlib/ignore_handler_s.cpp new file mode 100644 index 00000000000000..172b1bcdb7b307 --- /dev/null +++ b/libc/src/stdlib/ignore_handler_s.cpp @@ -0,0 +1,16 @@ +//===-- Implementation header for ignore_handler_s --------------*- C++ -*-===// +// +// 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 +// +//===----------------------------------------------------------------------===// + +#include "src/stdlib/ignore_handler_s.h" + +namespace LIBC_NAMESPACE_DECL { + +LLVM_LIBC_FUNCTION(void, ignore_handler_s, + (const char *__restrict, void *__restrict, errno_t)) {} + +} // namespace LIBC_NAMESPACE_DECL diff --git a/libc/src/stdlib/ignore_handler_s.h b/libc/src/stdlib/ignore_handler_s.h new file mode 100644 index 00000000000000..07328d4be01ce0 --- /dev/null +++ b/libc/src/stdlib/ignore_handler_s.h @@ -0,0 +1,22 @@ +//===-- Implementation header for ignore_handler_s --------------*- C++ -*-===// +// +// 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_SRC_STDLIB_IGNORE_HANDLER_S_H +#define LLVM_LIBC_SRC_STDLIB_IGNORE_HANDLER_S_H + +#include "hdr/types/errno_t.h" +#include "src/__support/common.h" + +namespace LIBC_NAMESPACE_DECL { + +void ignore_handler_s(const char *__restrict msg, void *__restrict ptr, + errno_t error); + +} // namespace LIBC_NAMESPACE_DECL + +#endif // LLVM_LIBC_SRC_STDLIB_IGNORE_HANDLER_S_H _______________________________________________ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
