[libc-commits] [libc] Draft (PR #132746)

Connector Switch via libc-commits libc-commits at lists.llvm.org
Mon Mar 24 07:32:47 PDT 2025


https://github.com/c8ef created https://github.com/llvm/llvm-project/pull/132746

None

>From e9b5523532198bf5d96f61c9d95272f45cd302c6 Mon Sep 17 00:00:00 2001
From: c8ef <c8ef at outlook.com>
Date: Mon, 24 Mar 2025 14:32:19 +0000
Subject: [PATCH] add visit type

---
 libc/include/CMakeLists.txt                 |  1 +
 libc/include/llvm-libc-types/CMakeLists.txt |  1 +
 libc/include/llvm-libc-types/VISIT.h        | 14 ++++++++++++++
 libc/include/search.yaml                    |  1 +
 4 files changed, 17 insertions(+)
 create mode 100644 libc/include/llvm-libc-types/VISIT.h

diff --git a/libc/include/CMakeLists.txt b/libc/include/CMakeLists.txt
index 409737762ac41..d1e116ac547d7 100644
--- a/libc/include/CMakeLists.txt
+++ b/libc/include/CMakeLists.txt
@@ -245,6 +245,7 @@ add_header_macro(
     .llvm-libc-types.ENTRY
     .llvm-libc-types.struct_hsearch_data
     .llvm-libc-types.size_t
+    .llvm-libc-types.VISIT
     .llvm-libc-types.__lsearchcompare_t
 )
 
diff --git a/libc/include/llvm-libc-types/CMakeLists.txt b/libc/include/llvm-libc-types/CMakeLists.txt
index bf8bdfe89943c..66e8527701873 100644
--- a/libc/include/llvm-libc-types/CMakeLists.txt
+++ b/libc/include/llvm-libc-types/CMakeLists.txt
@@ -128,6 +128,7 @@ add_header(struct_iovec HDR struct_iovec.h DEPENDS .size_t)
 add_header(struct_msghdr HDR struct_msghdr.h DEPENDS .size_t .socklen_t .struct_iovec)
 add_header(ACTION HDR ACTION.h)
 add_header(ENTRY HDR ENTRY.h)
+add_header(VISIT HDR VISIT.h)
 add_header(struct_hsearch_data HDR struct_hsearch_data.h)
 add_header(struct_epoll_event HDR struct_epoll_event.h)
 add_header(struct_epoll_data HDR struct_epoll_data.h)
diff --git a/libc/include/llvm-libc-types/VISIT.h b/libc/include/llvm-libc-types/VISIT.h
new file mode 100644
index 0000000000000..0a7ff6e50d469
--- /dev/null
+++ b/libc/include/llvm-libc-types/VISIT.h
@@ -0,0 +1,14 @@
+//===-- Definition of VISIT type ------------------------------------------===//
+//
+// 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_TYPES_VISIT_H
+#define LLVM_LIBC_TYPES_VISIT_H
+
+typedef enum { preorder, postorder, endorder, leaf } VISIT;
+
+#endif // LLVM_LIBC_TYPES_VISIT_H
diff --git a/libc/include/search.yaml b/libc/include/search.yaml
index f6f5d6cb062e5..e2e711cc93f4d 100644
--- a/libc/include/search.yaml
+++ b/libc/include/search.yaml
@@ -5,6 +5,7 @@ types:
   - type_name: struct_hsearch_data
   - type_name: ENTRY
   - type_name: ACTION
+  - type_name: VISIT
   - type_name: __lsearchcompare_t
 enums: []
 objects: []



More information about the libc-commits mailing list