Skip to content

Commit 7a5ce55

Browse files
authored
[libc] Add VISIT enum for search.h (llvm#132746)
This patch introduces the `VISIT` enum for tree search. Existing tests ensure the correct generation of headers.
1 parent 1c8075c commit 7a5ce55

File tree

4 files changed

+17
-0
lines changed

4 files changed

+17
-0
lines changed

libc/include/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ add_header_macro(
245245
.llvm-libc-types.ENTRY
246246
.llvm-libc-types.struct_hsearch_data
247247
.llvm-libc-types.size_t
248+
.llvm-libc-types.VISIT
248249
.llvm-libc-types.__lsearchcompare_t
249250
)
250251

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ add_header(struct_iovec HDR struct_iovec.h DEPENDS .size_t)
128128
add_header(struct_msghdr HDR struct_msghdr.h DEPENDS .size_t .socklen_t .struct_iovec)
129129
add_header(ACTION HDR ACTION.h)
130130
add_header(ENTRY HDR ENTRY.h)
131+
add_header(VISIT HDR VISIT.h)
131132
add_header(struct_hsearch_data HDR struct_hsearch_data.h)
132133
add_header(struct_epoll_event HDR struct_epoll_event.h)
133134
add_header(struct_epoll_data HDR struct_epoll_data.h)

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
//===-- Definition of VISIT type ------------------------------------------===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
9+
#ifndef LLVM_LIBC_TYPES_VISIT_H
10+
#define LLVM_LIBC_TYPES_VISIT_H
11+
12+
typedef enum { preorder, postorder, endorder, leaf } VISIT;
13+
14+
#endif // LLVM_LIBC_TYPES_VISIT_H

libc/include/search.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ types:
55
- type_name: struct_hsearch_data
66
- type_name: ENTRY
77
- type_name: ACTION
8+
- type_name: VISIT
89
- type_name: __lsearchcompare_t
910
enums: []
1011
objects: []

0 commit comments

Comments
 (0)