From 27eae8f4049cff8afd4ecdc7c9f697a8ef4ef08c Mon Sep 17 00:00:00 2001 From: Eric Salo Date: Wed, 27 Dec 2023 13:22:22 -0800 Subject: [PATCH] upb: delete mini_table/types.h PiperOrigin-RevId: 594089137 --- upb/mini_descriptor/decode.h | 1 + upb/mini_descriptor/link.h | 5 ++++- upb/mini_table/BUILD | 2 -- upb/mini_table/enum.h | 3 ++- upb/mini_table/extension.h | 5 ++++- upb/mini_table/field.h | 3 ++- upb/mini_table/file.h | 6 +++++- upb/mini_table/message.h | 5 ++++- upb/mini_table/sub.h | 5 ++++- upb/mini_table/types.h | 21 --------------------- upb/test/fuzz_util.h | 3 ++- 11 files changed, 28 insertions(+), 31 deletions(-) delete mode 100644 upb/mini_table/types.h diff --git a/upb/mini_descriptor/decode.h b/upb/mini_descriptor/decode.h index c73a44a5a0c2..ca0afc04d017 100644 --- a/upb/mini_descriptor/decode.h +++ b/upb/mini_descriptor/decode.h @@ -10,6 +10,7 @@ #include "upb/base/status.h" #include "upb/mem/arena.h" +#include "upb/mini_table/extension.h" #include "upb/mini_table/sub.h" // Export the newer headers, for legacy users. New users should include the diff --git a/upb/mini_descriptor/link.h b/upb/mini_descriptor/link.h index 3326e06fc38c..3e880fdd8784 100644 --- a/upb/mini_descriptor/link.h +++ b/upb/mini_descriptor/link.h @@ -18,7 +18,10 @@ #include "upb/base/status.h" #include "upb/mem/arena.h" -#include "upb/mini_table/types.h" +#include "upb/mini_table/enum.h" +#include "upb/mini_table/field.h" +#include "upb/mini_table/message.h" +#include "upb/mini_table/sub.h" // Must be last. #include "upb/port/def.inc" diff --git a/upb/mini_table/BUILD b/upb/mini_table/BUILD index 7fb1c1693ebf..71de9f2b5da8 100644 --- a/upb/mini_table/BUILD +++ b/upb/mini_table/BUILD @@ -24,7 +24,6 @@ cc_library( "file.h", "message.h", "sub.h", - "types.h", ], copts = UPB_DEFAULT_COPTS, visibility = ["//visibility:public"], @@ -55,7 +54,6 @@ cc_library( visibility = ["//visibility:public"], deps = [ "//upb:base", - "//upb:hash", "//upb:mem", "//upb:port", ], diff --git a/upb/mini_table/enum.h b/upb/mini_table/enum.h index 34656d07061b..cad31ec253c7 100644 --- a/upb/mini_table/enum.h +++ b/upb/mini_table/enum.h @@ -11,11 +11,12 @@ #include #include "upb/mini_table/internal/enum.h" -#include "upb/mini_table/types.h" // IWYU pragma: export // Must be last #include "upb/port/def.inc" +typedef struct upb_MiniTableEnum upb_MiniTableEnum; + #ifdef __cplusplus extern "C" { #endif diff --git a/upb/mini_table/extension.h b/upb/mini_table/extension.h index 341dff64d1b8..58a71b60c4a3 100644 --- a/upb/mini_table/extension.h +++ b/upb/mini_table/extension.h @@ -10,12 +10,15 @@ #include +#include "upb/mini_table/field.h" #include "upb/mini_table/internal/extension.h" -#include "upb/mini_table/types.h" // IWYU pragma: export +#include "upb/mini_table/message.h" // Must be last. #include "upb/port/def.inc" +typedef struct upb_MiniTableExtension upb_MiniTableExtension; + #ifdef __cplusplus extern "C" { #endif diff --git a/upb/mini_table/field.h b/upb/mini_table/field.h index c764164f401f..1df96cecc383 100644 --- a/upb/mini_table/field.h +++ b/upb/mini_table/field.h @@ -12,11 +12,12 @@ #include "upb/base/descriptor_constants.h" #include "upb/mini_table/internal/field.h" -#include "upb/mini_table/types.h" // IWYU pragma: export // Must be last. #include "upb/port/def.inc" +typedef struct upb_MiniTableField upb_MiniTableField; + #ifdef __cplusplus extern "C" { #endif diff --git a/upb/mini_table/file.h b/upb/mini_table/file.h index bae16ba34057..bc109eb0ebdd 100644 --- a/upb/mini_table/file.h +++ b/upb/mini_table/file.h @@ -8,12 +8,16 @@ #ifndef UPB_MINI_TABLE_FILE_H_ #define UPB_MINI_TABLE_FILE_H_ +#include "upb/mini_table/enum.h" +#include "upb/mini_table/extension.h" #include "upb/mini_table/internal/file.h" -#include "upb/mini_table/types.h" // IWYU pragma: export +#include "upb/mini_table/message.h" // Must be last. #include "upb/port/def.inc" +typedef struct upb_MiniTableFile upb_MiniTableFile; + #ifdef __cplusplus extern "C" { #endif diff --git a/upb/mini_table/message.h b/upb/mini_table/message.h index 986e429dcdc3..3a1517c13e73 100644 --- a/upb/mini_table/message.h +++ b/upb/mini_table/message.h @@ -8,12 +8,15 @@ #ifndef UPB_MINI_TABLE_MESSAGE_H_ #define UPB_MINI_TABLE_MESSAGE_H_ +#include "upb/mini_table/enum.h" +#include "upb/mini_table/field.h" #include "upb/mini_table/internal/message.h" -#include "upb/mini_table/types.h" // IWYU pragma: export // Must be last. #include "upb/port/def.inc" +typedef struct upb_MiniTable upb_MiniTable; + #ifdef __cplusplus extern "C" { #endif diff --git a/upb/mini_table/sub.h b/upb/mini_table/sub.h index e5cd52258361..c2798a18e833 100644 --- a/upb/mini_table/sub.h +++ b/upb/mini_table/sub.h @@ -8,12 +8,15 @@ #ifndef UPB_MINI_TABLE_SUB_H_ #define UPB_MINI_TABLE_SUB_H_ +#include "upb/mini_table/enum.h" #include "upb/mini_table/internal/sub.h" -#include "upb/mini_table/types.h" // IWYU pragma: export +#include "upb/mini_table/message.h" // Must be last. #include "upb/port/def.inc" +typedef union upb_MiniTableSub upb_MiniTableSub; + #ifdef __cplusplus extern "C" { #endif diff --git a/upb/mini_table/types.h b/upb/mini_table/types.h deleted file mode 100644 index ec82342c17cf..000000000000 --- a/upb/mini_table/types.h +++ /dev/null @@ -1,21 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2023 Google LLC. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd - -#ifndef UPB_MINI_TABLE_TYPES_H_ -#define UPB_MINI_TABLE_TYPES_H_ - -// Minitable types are recursively defined so declare them all together here. - -typedef struct upb_MiniTable upb_MiniTable; -typedef struct upb_MiniTableEnum upb_MiniTableEnum; -typedef struct upb_MiniTableExtension upb_MiniTableExtension; -typedef struct upb_MiniTableField upb_MiniTableField; -typedef struct upb_MiniTableFile upb_MiniTableFile; - -typedef union upb_MiniTableSub upb_MiniTableSub; - -#endif /* UPB_MINI_TABLE_TYPES_H_ */ diff --git a/upb/test/fuzz_util.h b/upb/test/fuzz_util.h index 72bf31ec8245..8e585d8124c9 100644 --- a/upb/test/fuzz_util.h +++ b/upb/test/fuzz_util.h @@ -11,8 +11,9 @@ #include #include +#include "upb/mem/arena.h" #include "upb/mini_table/extension_registry.h" -// #include "upb/mini_table/types.h" +#include "upb/mini_table/message.h" namespace upb { namespace fuzz {