https://github.com/bassiounix updated 
https://github.com/llvm/llvm-project/pull/163239

>From d3553994d951e44aeaf3f1e881f27cc81cf29fa0 Mon Sep 17 00:00:00 2001
From: bassiounix <[email protected]>
Date: Mon, 13 Oct 2025 21:38:25 +0300
Subject: [PATCH 1/2] [libc][annex_k] Add constraint_handler_t.

---
 libc/hdr/types/CMakeLists.txt                 |  9 ++++++++
 libc/hdr/types/constraint_handler_t.h         | 18 ++++++++++++++++
 libc/include/CMakeLists.txt                   |  1 +
 libc/include/llvm-libc-types/CMakeLists.txt   |  2 ++
 .../llvm-libc-types/constraint_handler_t.h    | 21 +++++++++++++++++++
 libc/include/stdlib.yaml                      |  1 +
 6 files changed, 52 insertions(+)
 create mode 100644 libc/hdr/types/constraint_handler_t.h
 create mode 100644 libc/include/llvm-libc-types/constraint_handler_t.h

diff --git a/libc/hdr/types/CMakeLists.txt b/libc/hdr/types/CMakeLists.txt
index 6fe26881f737e..111dd208997df 100644
--- a/libc/hdr/types/CMakeLists.txt
+++ b/libc/hdr/types/CMakeLists.txt
@@ -170,6 +170,15 @@ add_proxy_header_library(
     libc.include.fcntl
 )
 
+add_proxy_header_library(
+  constraint_handler_t
+  HDRS
+    constraint_handler_t.h
+  FULL_BUILD_DEPENDS
+    libc.include.llvm-libc-types.constraint_handler_t
+    libc.include.stdlib
+)
+
 add_proxy_header_library(
   errno_t
   HDRS
diff --git a/libc/hdr/types/constraint_handler_t.h 
b/libc/hdr/types/constraint_handler_t.h
new file mode 100644
index 0000000000000..ca7798b84228e
--- /dev/null
+++ b/libc/hdr/types/constraint_handler_t.h
@@ -0,0 +1,18 @@
+//===-- Proxy for constraint_handler_t 
------------------------------------===//
+//
+// 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_HDR_TYPES_CONSTRAINT_HANDLER_T_H
+#define LLVM_LIBC_HDR_TYPES_CONSTRAINT_HANDLER_T_H
+
+#define LIBC_HAS_ANNEX_K
+
+#include "include/llvm-libc-types/constraint_handler_t.h"
+
+#undef LIBC_HAS_ANNEX_K
+
+#endif // LLVM_LIBC_HDR_TYPES_CONSTRAINT_HANDLER_T_H
diff --git a/libc/include/CMakeLists.txt b/libc/include/CMakeLists.txt
index 5c89e00db0588..83a3e43835f1e 100644
--- a/libc/include/CMakeLists.txt
+++ b/libc/include/CMakeLists.txt
@@ -369,6 +369,7 @@ add_header_macro(
     .llvm-libc-types.__qsortcompare_t
     .llvm-libc-types.__qsortrcompare_t
     .llvm-libc-types.__search_compare_t
+    .llvm-libc-types.constraint_handler_t
     .llvm-libc-types.div_t
     .llvm-libc-types.ldiv_t
     .llvm-libc-types.lldiv_t
diff --git a/libc/include/llvm-libc-types/CMakeLists.txt 
b/libc/include/llvm-libc-types/CMakeLists.txt
index e104faf7ead71..af29579e00c72 100644
--- a/libc/include/llvm-libc-types/CMakeLists.txt
+++ b/libc/include/llvm-libc-types/CMakeLists.txt
@@ -301,3 +301,5 @@ add_header(EFI_SYSTEM_TABLE
     .EFI_TABLE_HEADER
     .char16_t
 )
+
+add_header(constraint_handler_t HDR constraint_handler_t.h DEPENDS .errno_t)
diff --git a/libc/include/llvm-libc-types/constraint_handler_t.h 
b/libc/include/llvm-libc-types/constraint_handler_t.h
new file mode 100644
index 0000000000000..efd21296cd399
--- /dev/null
+++ b/libc/include/llvm-libc-types/constraint_handler_t.h
@@ -0,0 +1,21 @@
+//===-- Definition of type constraint_handler_t 
---------------------------===//
+//
+// 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_INCLUDE_LLVM_LIBC_TYPES_CONSTRAINT_HANDLER_T_H
+#define LLVM_LIBC_INCLUDE_LLVM_LIBC_TYPES_CONSTRAINT_HANDLER_T_H
+
+#include "errno_t.h"
+
+#ifdef LIBC_HAS_ANNEX_K
+
+typedef void (*constraint_handler_t)(const char *__restrict, void *__restrict,
+                                     errno_t);
+
+#endif // LIBC_HAS_ANNEX_K
+
+#endif // LLVM_LIBC_INCLUDE_LLVM_LIBC_TYPES_CONSTRAINT_HANDLER_T_H
diff --git a/libc/include/stdlib.yaml b/libc/include/stdlib.yaml
index 3b2ff13c684b1..29fd6bc3a1e75 100644
--- a/libc/include/stdlib.yaml
+++ b/libc/include/stdlib.yaml
@@ -12,6 +12,7 @@ types:
   - type_name: __qsortcompare_t
   - type_name: __qsortrcompare_t
   - type_name: __search_compare_t
+  - type_name: constraint_handler_t
   - type_name: div_t
   - type_name: ldiv_t
   - type_name: lldiv_t

>From 1e25152da904a40fd109710458802cf7c812312a Mon Sep 17 00:00:00 2001
From: bassiounix <[email protected]>
Date: Tue, 14 Oct 2025 00:55:56 +0300
Subject: [PATCH 2/2] change location

---
 libc/include/llvm-libc-types/CMakeLists.txt | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/libc/include/llvm-libc-types/CMakeLists.txt 
b/libc/include/llvm-libc-types/CMakeLists.txt
index af29579e00c72..61dbca25c2205 100644
--- a/libc/include/llvm-libc-types/CMakeLists.txt
+++ b/libc/include/llvm-libc-types/CMakeLists.txt
@@ -31,6 +31,7 @@ add_header(DIR HDR DIR.h)
 add_header(dev_t HDR dev_t.h)
 add_header(div_t HDR div_t.h)
 add_header(errno_t HDR errno_t.h)
+add_header(constraint_handler_t HDR constraint_handler_t.h DEPENDS .errno_t)
 add_header(ldiv_t HDR ldiv_t.h)
 add_header(lldiv_t HDR lldiv_t.h)
 add_header(FILE HDR FILE.h)
@@ -301,5 +302,3 @@ add_header(EFI_SYSTEM_TABLE
     .EFI_TABLE_HEADER
     .char16_t
 )
-
-add_header(constraint_handler_t HDR constraint_handler_t.h DEPENDS .errno_t)

_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to