[libc-commits] [libc] [libc] fix lfind old hdrgen (PR #115760)
Nick Desaulniers via libc-commits
libc-commits at lists.llvm.org
Mon Nov 11 11:42:56 PST 2024
https://github.com/nickdesaulniers updated https://github.com/llvm/llvm-project/pull/115760
>From a5594aafe00d9b2f4e12435bd2d2e782dacdf0e6 Mon Sep 17 00:00:00 2001
From: Nick Desaulniers <ndesaulniers at google.com>
Date: Mon, 11 Nov 2024 11:39:51 -0800
Subject: [PATCH 1/3] [libc] fix lfind old hdrgen
Fixes: #114692
---
libc/config/linux/api.td | 2 +-
libc/spec/posix.td | 7 +++----
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/libc/config/linux/api.td b/libc/config/linux/api.td
index 46523b4ca4b8df..a00e0f61b90df7 100644
--- a/libc/config/linux/api.td
+++ b/libc/config/linux/api.td
@@ -268,7 +268,7 @@ def SetJmpAPI : PublicAPI<"setjmp.h"> {
}
def SearchAPI : PublicAPI<"search.h"> {
- let Types = ["ACTION", "ENTRY", "struct hsearch_data"];
+ let Types = ["ACTION", "ENTRY", "struct hsearch_data", "__lsearchcompare_t"];
}
def SysStatvfsAPI : PublicAPI<"sys/statvfs.h"> {
diff --git a/libc/spec/posix.td b/libc/spec/posix.td
index d4712dc0c5d701..c9399ba6f4d15e 100644
--- a/libc/spec/posix.td
+++ b/libc/spec/posix.td
@@ -100,9 +100,6 @@ def StructStatvfs : NamedType<"struct statvfs">;
def StructStatvfsPtr : PtrType<StructStatvfs>;
def RestrictedStructStatvfsPtr : RestrictedPtrType<StructStatvfs>;
-// The function pointer type for the predicate for lsearch, lfind
-def LSearchCompareT : NamedType<"__lsearchcompare_t">;
-
def POSIX : StandardSpec<"POSIX"> {
PtrType CharPtr = PtrType<CharType>;
RestrictedPtrType RestrictedCharPtr = RestrictedPtrType<CharType>;
@@ -1577,12 +1574,14 @@ def POSIX : StandardSpec<"POSIX"> {
]
>;
+ NamedType LSearchCompareT = NamedType<"__lsearchcompare_t">;
HeaderSpec Search = HeaderSpec<
"search.h",
[], // Macros
[
ActionType,
- EntryType
+ EntryType,
+ LSearchCompareT,
], // Types
[], // Enumerations
[
>From 6b902092edabc9be2f59edd87ef5932e5bf65a7d Mon Sep 17 00:00:00 2001
From: Nick Desaulniers <ndesaulniers at google.com>
Date: Mon, 11 Nov 2024 11:42:14 -0800
Subject: [PATCH 2/3] put back old location
---
libc/spec/posix.td | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/libc/spec/posix.td b/libc/spec/posix.td
index c9399ba6f4d15e..a35d8e8cb41333 100644
--- a/libc/spec/posix.td
+++ b/libc/spec/posix.td
@@ -100,6 +100,9 @@ def StructStatvfs : NamedType<"struct statvfs">;
def StructStatvfsPtr : PtrType<StructStatvfs>;
def RestrictedStructStatvfsPtr : RestrictedPtrType<StructStatvfs>;
+// The function pointer type for the predicate for lsearch, lfin
+def LSearchCompareT : NamedType<"__lsearchcompare_t">;
+
def POSIX : StandardSpec<"POSIX"> {
PtrType CharPtr = PtrType<CharType>;
RestrictedPtrType RestrictedCharPtr = RestrictedPtrType<CharType>;
@@ -1574,7 +1577,6 @@ def POSIX : StandardSpec<"POSIX"> {
]
>;
- NamedType LSearchCompareT = NamedType<"__lsearchcompare_t">;
HeaderSpec Search = HeaderSpec<
"search.h",
[], // Macros
>From 304ed3efa3419f267eda6ec56fc75b22884e7a3b Mon Sep 17 00:00:00 2001
From: Nick Desaulniers <ndesaulniers at google.com>
Date: Mon, 11 Nov 2024 11:42:43 -0800
Subject: [PATCH 3/3] fix typo
---
libc/spec/posix.td | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libc/spec/posix.td b/libc/spec/posix.td
index a35d8e8cb41333..e354deef340f1b 100644
--- a/libc/spec/posix.td
+++ b/libc/spec/posix.td
@@ -100,7 +100,7 @@ def StructStatvfs : NamedType<"struct statvfs">;
def StructStatvfsPtr : PtrType<StructStatvfs>;
def RestrictedStructStatvfsPtr : RestrictedPtrType<StructStatvfs>;
-// The function pointer type for the predicate for lsearch, lfin
+// The function pointer type for the predicate for lsearch, lfind
def LSearchCompareT : NamedType<"__lsearchcompare_t">;
def POSIX : StandardSpec<"POSIX"> {
More information about the libc-commits
mailing list