Skip to content

Commit b738b82

Browse files
authored
[libc] Combine the function prototype int (*compar)(const void *, const void *) (#134238)
Closes #134118.
1 parent 65fa57b commit b738b82

File tree

6 files changed

+24
-39
lines changed

6 files changed

+24
-39
lines changed

libc/include/CMakeLists.txt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -240,13 +240,13 @@ add_header_macro(
240240
../libc/include/search.yaml
241241
search.h
242242
DEPENDS
243-
.llvm_libc_common_h
244243
.llvm-libc-types.ACTION
245244
.llvm-libc-types.ENTRY
246-
.llvm-libc-types.struct_hsearch_data
247-
.llvm-libc-types.size_t
248245
.llvm-libc-types.VISIT
249-
.llvm-libc-types.__lsearchcompare_t
246+
.llvm-libc-types.__search_compare_t
247+
.llvm-libc-types.size_t
248+
.llvm-libc-types.struct_hsearch_data
249+
.llvm_libc_common_h
250250
)
251251

252252
add_header_macro(
@@ -343,17 +343,17 @@ add_header_macro(
343343
../libc/include/stdlib.yaml
344344
stdlib.h
345345
DEPENDS
346-
.llvm_libc_common_h
347346
.llvm-libc-macros.stdlib_macros
347+
.llvm-libc-types.__atexithandler_t
348+
.llvm-libc-types.__qsortcompare_t
349+
.llvm-libc-types.__qsortrcompare_t
350+
.llvm-libc-types.__search_compare_t
348351
.llvm-libc-types.div_t
349352
.llvm-libc-types.ldiv_t
350353
.llvm-libc-types.lldiv_t
351-
.llvm-libc-types.size_t
352-
.llvm-libc-types.__bsearchcompare_t
353-
.llvm-libc-types.__qsortcompare_t
354-
.llvm-libc-types.__qsortrcompare_t
355-
.llvm-libc-types.__atexithandler_t
356354
.llvm-libc-types.locale_t
355+
.llvm-libc-types.size_t
356+
.llvm_libc_common_h
357357
)
358358

359359
add_header_macro(

libc/include/llvm-libc-types/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ add_header(off64_t HDR off64_t.h)
22
add_header(size_t HDR size_t.h)
33
add_header(ssize_t HDR ssize_t.h)
44
add_header(__atfork_callback_t HDR __atfork_callback_t.h)
5-
add_header(__bsearchcompare_t HDR __bsearchcompare_t.h)
6-
add_header(__lsearchcompare_t HDR __lsearchcompare_t.h)
5+
add_header(__search_compare_t HDR __search_compare_t.h)
76
add_header(__call_once_func_t HDR __call_once_func_t.h)
87
add_header(__dl_iterate_phdr_callback_t HDR __dl_iterate_phdr_callback_t.h DEPENDS .size_t)
98
add_header(__exec_argv_t HDR __exec_argv_t.h)

libc/include/llvm-libc-types/__lsearchcompare_t.h

Lines changed: 0 additions & 14 deletions
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
//===-- Definition of type __bsearchcompare_t -----------------------------===//
1+
//===-- Definition of type __search_compare_t -----------------------------===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
55
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#ifndef LLVM_LIBC_TYPES___BSEARCHCOMPARE_T_H
10-
#define LLVM_LIBC_TYPES___BSEARCHCOMPARE_T_H
9+
#ifndef LLVM_LIBC_TYPES___SEARCH_COMPARE_T_H
10+
#define LLVM_LIBC_TYPES___SEARCH_COMPARE_T_H
1111

12-
typedef int (*__bsearchcompare_t)(const void *, const void *);
12+
typedef int (*__search_compare_t)(const void *, const void *);
1313

14-
#endif // LLVM_LIBC_TYPES___BSEARCHCOMPARE_T_H
14+
#endif // LLVM_LIBC_TYPES___SEARCH_COMPARE_T_H

libc/include/search.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ header: search.h
22
header_template: search.h.def
33
macros: []
44
types:
5-
- type_name: struct_hsearch_data
6-
- type_name: ENTRY
75
- type_name: ACTION
6+
- type_name: ENTRY
87
- type_name: VISIT
9-
- type_name: __lsearchcompare_t
8+
- type_name: __search_compare_t
9+
- type_name: struct_hsearch_data
1010
enums: []
1111
objects: []
1212
functions:
@@ -69,7 +69,7 @@ functions:
6969
- type: const void *
7070
- type: size_t *
7171
- type: size_t
72-
- type: __lsearchcompare_t
72+
- type: __search_compare_t
7373
- name: lsearch
7474
standards:
7575
- POSIX
@@ -79,4 +79,4 @@ functions:
7979
- type: void *
8080
- type: size_t *
8181
- type: size_t
82-
- type: __lsearchcompare_t
82+
- type: __search_compare_t

libc/include/stdlib.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ merge_yaml_files:
77
macros: []
88
types:
99
- type_name: __atexithandler_t
10-
- type_name: __qsortrcompare_t
1110
- type_name: __qsortcompare_t
12-
- type_name: __bsearchcompare_t
11+
- type_name: __qsortrcompare_t
12+
- type_name: __search_compare_t
1313
- type_name: div_t
1414
- type_name: ldiv_t
1515
- type_name: lldiv_t
@@ -87,7 +87,7 @@ functions:
8787
- type: const void *
8888
- type: size_t
8989
- type: size_t
90-
- type: __bsearchcompare_t
90+
- type: __search_compare_t
9191
- name: div
9292
standards:
9393
- stdc

0 commit comments

Comments
 (0)