parent
33cb42e33b
commit
de7f589d44
|
@ -291,12 +291,6 @@ alias(
|
|||
visibility = ["//upb:friends"],
|
||||
)
|
||||
|
||||
alias(
|
||||
name = "mini_table_internal",
|
||||
actual = "//upb/mini_table:internal",
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
alias(
|
||||
name = "port",
|
||||
actual = "//upb/port",
|
||||
|
@ -409,7 +403,6 @@ upb_amalgamation(
|
|||
":mini_descriptor_internal",
|
||||
":mini_table",
|
||||
":mini_table_compat",
|
||||
":mini_table_internal",
|
||||
":port",
|
||||
":reflection",
|
||||
":reflection_internal",
|
||||
|
@ -458,7 +451,6 @@ upb_amalgamation(
|
|||
":mini_descriptor",
|
||||
":mini_descriptor_internal",
|
||||
":mini_table",
|
||||
":mini_table_internal",
|
||||
":port",
|
||||
":reflection",
|
||||
":reflection_internal",
|
||||
|
@ -508,7 +500,6 @@ upb_amalgamation(
|
|||
":mini_descriptor",
|
||||
":mini_descriptor_internal",
|
||||
":mini_table",
|
||||
":mini_table_internal",
|
||||
":port",
|
||||
":reflection",
|
||||
":reflection_internal",
|
||||
|
|
|
@ -37,7 +37,6 @@ cc_library(
|
|||
"//upb:mem",
|
||||
"//upb:message_types",
|
||||
"//upb:mini_table",
|
||||
"//upb:mini_table_internal",
|
||||
"//upb:port",
|
||||
"//upb:wire",
|
||||
"//upb:wire_reader",
|
||||
|
@ -59,7 +58,6 @@ cc_library(
|
|||
"//upb:base",
|
||||
"//upb:mem",
|
||||
"//upb:mini_table",
|
||||
"//upb:mini_table_internal",
|
||||
"//upb:port",
|
||||
],
|
||||
)
|
||||
|
@ -84,7 +82,6 @@ cc_library(
|
|||
"//upb:base",
|
||||
"//upb:mem",
|
||||
"//upb:mini_table",
|
||||
"//upb:mini_table_internal",
|
||||
"//upb:port",
|
||||
],
|
||||
)
|
||||
|
@ -122,7 +119,6 @@ cc_library(
|
|||
"//upb:hash",
|
||||
"//upb:mem",
|
||||
"//upb:mini_table",
|
||||
"//upb:mini_table_internal",
|
||||
"//upb:port",
|
||||
],
|
||||
)
|
||||
|
@ -183,7 +179,6 @@ cc_library(
|
|||
"//upb:eps_copy_input_stream",
|
||||
"//upb:mem",
|
||||
"//upb:mini_table",
|
||||
"//upb:mini_table_internal",
|
||||
"//upb:port",
|
||||
"//upb:wire",
|
||||
"//upb:wire_internal",
|
||||
|
|
|
@ -25,11 +25,6 @@
|
|||
#include "upb/message/tagged_ptr.h"
|
||||
#include "upb/message/types.h"
|
||||
#include "upb/mini_table/enum.h"
|
||||
#include "upb/mini_table/extension.h"
|
||||
#include "upb/mini_table/field.h"
|
||||
#include "upb/mini_table/internal/field.h"
|
||||
#include "upb/mini_table/message.h"
|
||||
#include "upb/mini_table/sub.h"
|
||||
|
||||
// Must be last.
|
||||
#include "upb/port/def.inc"
|
||||
|
|
|
@ -19,7 +19,8 @@
|
|||
#include "upb/port/def.inc"
|
||||
|
||||
upb_Array* upb_Array_New(upb_Arena* a, upb_CType type) {
|
||||
return UPB_PRIVATE(_upb_Array_New)(a, 4, upb_CType_SizeLg2(type));
|
||||
const int lg2 = UPB_PRIVATE(_upb_CType_SizeLg2)(type);
|
||||
return UPB_PRIVATE(_upb_Array_New)(a, 4, lg2);
|
||||
}
|
||||
|
||||
const void* upb_Array_DataPtr(const upb_Array* arr) {
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
#include "upb/message/tagged_ptr.h"
|
||||
#include "upb/mini_table/extension.h"
|
||||
#include "upb/mini_table/field.h"
|
||||
#include "upb/mini_table/internal/field.h"
|
||||
#include "upb/mini_table/internal/size_log2.h"
|
||||
#include "upb/mini_table/message.h"
|
||||
#include "upb/mini_table/sub.h"
|
||||
|
@ -139,9 +138,9 @@ static upb_Map* upb_Message_Map_DeepClone(const upb_Map* map,
|
|||
|
||||
upb_Array* upb_Array_DeepClone(const upb_Array* array, upb_CType value_type,
|
||||
const upb_MiniTable* sub, upb_Arena* arena) {
|
||||
size_t size = array->UPB_PRIVATE(size);
|
||||
upb_Array* cloned_array =
|
||||
UPB_PRIVATE(_upb_Array_New)(arena, size, upb_CType_SizeLg2(value_type));
|
||||
const size_t size = array->UPB_PRIVATE(size);
|
||||
const int lg2 = UPB_PRIVATE(_upb_CType_SizeLg2)(value_type);
|
||||
upb_Array* cloned_array = UPB_PRIVATE(_upb_Array_New)(arena, size, lg2);
|
||||
if (!cloned_array) {
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
#include "upb/message/tagged_ptr.h"
|
||||
#include "upb/mini_table/extension.h"
|
||||
#include "upb/mini_table/field.h"
|
||||
#include "upb/mini_table/internal/field.h"
|
||||
|
||||
// Must be last.
|
||||
#include "upb/port/def.inc"
|
||||
|
|
|
@ -24,7 +24,6 @@ cc_library(
|
|||
"//upb:base_internal",
|
||||
"//upb:mem",
|
||||
"//upb:mini_table",
|
||||
"//upb:mini_table_internal",
|
||||
"//upb:port",
|
||||
],
|
||||
)
|
||||
|
@ -65,7 +64,6 @@ cc_test(
|
|||
"//upb:mem",
|
||||
"//upb:message_accessors_internal",
|
||||
"//upb:mini_table",
|
||||
"//upb:mini_table_internal",
|
||||
"//upb:port",
|
||||
"//upb:wire",
|
||||
"@com_google_absl//absl/container:flat_hash_set",
|
||||
|
|
|
@ -10,9 +10,6 @@
|
|||
|
||||
#include "upb/base/status.h"
|
||||
#include "upb/mem/arena.h"
|
||||
#include "upb/mini_table/extension.h"
|
||||
#include "upb/mini_table/field.h"
|
||||
#include "upb/mini_table/message.h"
|
||||
#include "upb/mini_table/sub.h"
|
||||
|
||||
// Export the newer headers, for legacy users. New users should include the
|
||||
|
|
|
@ -25,8 +25,6 @@
|
|||
#include "upb/mini_descriptor/internal/modifiers.h"
|
||||
#include "upb/mini_table/enum.h"
|
||||
#include "upb/mini_table/field.h"
|
||||
#include "upb/mini_table/internal/field.h"
|
||||
#include "upb/mini_table/internal/message.h"
|
||||
#include "upb/mini_table/message.h"
|
||||
#include "upb/mini_table/sub.h"
|
||||
|
||||
|
|
|
@ -13,8 +13,6 @@
|
|||
#include "upb/base/descriptor_constants.h"
|
||||
#include "upb/mini_table/enum.h"
|
||||
#include "upb/mini_table/field.h"
|
||||
#include "upb/mini_table/internal/field.h"
|
||||
#include "upb/mini_table/internal/message.h"
|
||||
#include "upb/mini_table/message.h"
|
||||
#include "upb/mini_table/sub.h"
|
||||
|
||||
|
|
|
@ -18,10 +18,7 @@
|
|||
|
||||
#include "upb/base/status.h"
|
||||
#include "upb/mem/arena.h"
|
||||
#include "upb/mini_table/extension.h"
|
||||
#include "upb/mini_table/field.h"
|
||||
#include "upb/mini_table/message.h"
|
||||
#include "upb/mini_table/sub.h"
|
||||
#include "upb/mini_table/types.h"
|
||||
|
||||
// Must be last.
|
||||
#include "upb/port/def.inc"
|
||||
|
|
|
@ -10,6 +10,41 @@ load(
|
|||
"UPB_DEFAULT_COPTS",
|
||||
)
|
||||
|
||||
cc_library(
|
||||
name = "mini_table",
|
||||
srcs = [
|
||||
"extension_registry.c",
|
||||
"internal/message.c",
|
||||
"message.c",
|
||||
],
|
||||
hdrs = [
|
||||
"enum.h",
|
||||
"extension.h",
|
||||
"extension_registry.h",
|
||||
"field.h",
|
||||
"file.h",
|
||||
"internal/enum.h",
|
||||
"internal/extension.h",
|
||||
"internal/field.h",
|
||||
"internal/file.h",
|
||||
"internal/message.h",
|
||||
"internal/size_log2.h",
|
||||
"internal/sub.h",
|
||||
"message.h",
|
||||
"sub.h",
|
||||
"types.h",
|
||||
],
|
||||
copts = UPB_DEFAULT_COPTS,
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"//upb:base",
|
||||
"//upb:hash",
|
||||
"//upb:mem",
|
||||
"//upb:message_types",
|
||||
"//upb:port",
|
||||
],
|
||||
)
|
||||
|
||||
cc_library(
|
||||
name = "compat",
|
||||
srcs = [
|
||||
|
@ -29,54 +64,6 @@ cc_library(
|
|||
],
|
||||
)
|
||||
|
||||
cc_library(
|
||||
name = "mini_table",
|
||||
srcs = [
|
||||
"extension_registry.c",
|
||||
"message.c",
|
||||
],
|
||||
hdrs = [
|
||||
"enum.h",
|
||||
"extension.h",
|
||||
"extension_registry.h",
|
||||
"field.h",
|
||||
"file.h",
|
||||
"message.h",
|
||||
"sub.h",
|
||||
],
|
||||
copts = UPB_DEFAULT_COPTS,
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
":internal",
|
||||
"//upb:base",
|
||||
"//upb:hash",
|
||||
"//upb:mem",
|
||||
"//upb:port",
|
||||
],
|
||||
)
|
||||
|
||||
cc_library(
|
||||
name = "internal",
|
||||
srcs = [
|
||||
"internal/message.c",
|
||||
],
|
||||
hdrs = [
|
||||
"internal/enum.h",
|
||||
"internal/extension.h",
|
||||
"internal/field.h",
|
||||
"internal/file.h",
|
||||
"internal/message.h",
|
||||
"internal/size_log2.h",
|
||||
"internal/sub.h",
|
||||
],
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"//upb:base",
|
||||
"//upb:message_types",
|
||||
"//upb:port",
|
||||
],
|
||||
)
|
||||
|
||||
cc_test(
|
||||
name = "compat_test",
|
||||
srcs = ["compat_test.cc"],
|
||||
|
|
|
@ -11,12 +11,11 @@
|
|||
#include <stdint.h>
|
||||
|
||||
#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
|
||||
|
|
|
@ -11,17 +11,16 @@
|
|||
#include <stdint.h>
|
||||
|
||||
#include "upb/mini_table/internal/extension.h"
|
||||
#include "upb/mini_table/types.h" // IWYU pragma: export
|
||||
|
||||
// Must be last.
|
||||
#include "upb/port/def.inc"
|
||||
|
||||
typedef struct upb_MiniTableExtension upb_MiniTableExtension;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
UPB_API_INLINE const struct upb_MiniTableField* upb_MiniTableExtension_AsField(
|
||||
UPB_API_INLINE const upb_MiniTableField* upb_MiniTableExtension_AsField(
|
||||
const upb_MiniTableExtension* e) {
|
||||
return UPB_PRIVATE(_upb_MiniTableExtension_AsField)(e);
|
||||
}
|
||||
|
@ -31,13 +30,13 @@ upb_MiniTableExtension_Number(const upb_MiniTableExtension* e) {
|
|||
return UPB_PRIVATE(_upb_MiniTableExtension_Number)(e);
|
||||
}
|
||||
|
||||
UPB_API_INLINE const struct upb_MiniTable* upb_MiniTableExtension_GetSubMessage(
|
||||
UPB_API_INLINE const upb_MiniTable* upb_MiniTableExtension_GetSubMessage(
|
||||
const upb_MiniTableExtension* e) {
|
||||
return UPB_PRIVATE(_upb_MiniTableExtension_GetSubMessage)(e);
|
||||
}
|
||||
|
||||
UPB_API_INLINE void upb_MiniTableExtension_SetSubMessage(
|
||||
upb_MiniTableExtension* e, const struct upb_MiniTable* m) {
|
||||
upb_MiniTableExtension* e, const upb_MiniTable* m) {
|
||||
return UPB_PRIVATE(_upb_MiniTableExtension_SetSubMessage)(e, m);
|
||||
}
|
||||
|
||||
|
|
|
@ -12,12 +12,11 @@
|
|||
|
||||
#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
|
||||
|
|
|
@ -9,8 +9,7 @@
|
|||
#define UPB_MINI_TABLE_FILE_H_
|
||||
|
||||
#include "upb/mini_table/internal/file.h"
|
||||
|
||||
typedef struct upb_MiniTableFile upb_MiniTableFile;
|
||||
#include "upb/mini_table/types.h" // IWYU pragma: export
|
||||
|
||||
// Must be last.
|
||||
#include "upb/port/def.inc"
|
||||
|
@ -19,7 +18,7 @@ typedef struct upb_MiniTableFile upb_MiniTableFile;
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
UPB_API_INLINE const struct upb_MiniTableEnum* upb_MiniTableFile_Enum(
|
||||
UPB_API_INLINE const upb_MiniTableEnum* upb_MiniTableFile_Enum(
|
||||
const upb_MiniTableFile* f, int i) {
|
||||
return UPB_PRIVATE(_upb_MiniTableFile_Enum)(f, i);
|
||||
}
|
||||
|
@ -28,7 +27,7 @@ UPB_API_INLINE int upb_MiniTableFile_EnumCount(const upb_MiniTableFile* f) {
|
|||
return UPB_PRIVATE(_upb_MiniTableFile_EnumCount)(f);
|
||||
}
|
||||
|
||||
UPB_API_INLINE const struct upb_MiniTableExtension* upb_MiniTableFile_Extension(
|
||||
UPB_API_INLINE const upb_MiniTableExtension* upb_MiniTableFile_Extension(
|
||||
const upb_MiniTableFile* f, int i) {
|
||||
return UPB_PRIVATE(_upb_MiniTableFile_Extension)(f, i);
|
||||
}
|
||||
|
@ -38,7 +37,7 @@ UPB_API_INLINE int upb_MiniTableFile_ExtensionCount(
|
|||
return UPB_PRIVATE(_upb_MiniTableFile_ExtensionCount)(f);
|
||||
}
|
||||
|
||||
UPB_API_INLINE const struct upb_MiniTable* upb_MiniTableFile_Message(
|
||||
UPB_API_INLINE const upb_MiniTable* upb_MiniTableFile_Message(
|
||||
const upb_MiniTableFile* f, int i) {
|
||||
return UPB_PRIVATE(_upb_MiniTableFile_Message)(f, i);
|
||||
}
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "upb/mini_table/types.h"
|
||||
|
||||
// Must be last.
|
||||
#include "upb/port/def.inc"
|
||||
|
||||
|
@ -24,7 +26,7 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
UPB_INLINE bool UPB_PRIVATE(_upb_MiniTableEnum_CheckValue)(
|
||||
const struct upb_MiniTableEnum* e, uint32_t val) {
|
||||
const upb_MiniTableEnum* e, uint32_t val) {
|
||||
if (UPB_LIKELY(val < 64)) {
|
||||
const uint64_t mask =
|
||||
e->UPB_PRIVATE(data)[0] | ((uint64_t)e->UPB_PRIVATE(data)[1] << 32);
|
||||
|
|
|
@ -10,42 +10,41 @@
|
|||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "upb/mini_table/internal/field.h"
|
||||
#include "upb/mini_table/internal/sub.h"
|
||||
#include "upb/mini_table/field.h"
|
||||
#include "upb/mini_table/sub.h"
|
||||
|
||||
// Must be last.
|
||||
#include "upb/port/def.inc"
|
||||
|
||||
struct upb_MiniTableExtension {
|
||||
// Do not move this field. We need to be able to alias pointers.
|
||||
struct upb_MiniTableField UPB_PRIVATE(field);
|
||||
upb_MiniTableField UPB_PRIVATE(field);
|
||||
|
||||
const struct upb_MiniTable* UPB_PRIVATE(extendee);
|
||||
union upb_MiniTableSub UPB_PRIVATE(sub); // NULL unless submsg or proto2 enum
|
||||
const upb_MiniTable* UPB_PRIVATE(extendee);
|
||||
upb_MiniTableSub UPB_PRIVATE(sub); // NULL unless submsg or proto2 enum
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
UPB_INLINE const struct upb_MiniTableField* UPB_PRIVATE(
|
||||
_upb_MiniTableExtension_AsField)(const struct upb_MiniTableExtension* e) {
|
||||
return (const struct upb_MiniTableField*)&e->UPB_PRIVATE(field);
|
||||
UPB_INLINE const upb_MiniTableField* UPB_PRIVATE(
|
||||
_upb_MiniTableExtension_AsField)(const upb_MiniTableExtension* e) {
|
||||
return (const upb_MiniTableField*)&e->UPB_PRIVATE(field);
|
||||
}
|
||||
|
||||
UPB_INLINE uint32_t UPB_PRIVATE(_upb_MiniTableExtension_Number)(
|
||||
const struct upb_MiniTableExtension* e) {
|
||||
UPB_INLINE uint32_t
|
||||
UPB_PRIVATE(_upb_MiniTableExtension_Number)(const upb_MiniTableExtension* e) {
|
||||
return e->UPB_PRIVATE(field).UPB_ONLYBITS(number);
|
||||
}
|
||||
|
||||
UPB_INLINE const struct upb_MiniTable* UPB_PRIVATE(
|
||||
_upb_MiniTableExtension_GetSubMessage)(
|
||||
const struct upb_MiniTableExtension* e) {
|
||||
return e->UPB_PRIVATE(sub).UPB_PRIVATE(submsg);
|
||||
UPB_INLINE const upb_MiniTable* UPB_PRIVATE(
|
||||
_upb_MiniTableExtension_GetSubMessage)(const upb_MiniTableExtension* e) {
|
||||
return upb_MiniTableSub_Message(e->UPB_PRIVATE(sub));
|
||||
}
|
||||
|
||||
UPB_INLINE void UPB_PRIVATE(_upb_MiniTableExtension_SetSubMessage)(
|
||||
struct upb_MiniTableExtension* e, const struct upb_MiniTable* m) {
|
||||
upb_MiniTableExtension* e, const upb_MiniTable* m) {
|
||||
e->UPB_PRIVATE(sub).UPB_PRIVATE(submsg) = m;
|
||||
}
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
|
||||
#include "upb/base/descriptor_constants.h"
|
||||
#include "upb/mini_table/internal/size_log2.h"
|
||||
#include "upb/mini_table/types.h"
|
||||
|
||||
// Must be last.
|
||||
#include "upb/port/def.inc"
|
||||
|
@ -75,47 +76,47 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
UPB_INLINE upb_FieldMode
|
||||
UPB_PRIVATE(_upb_MiniTableField_Mode)(const struct upb_MiniTableField* f) {
|
||||
UPB_PRIVATE(_upb_MiniTableField_Mode)(const upb_MiniTableField* f) {
|
||||
return (upb_FieldMode)(f->UPB_ONLYBITS(mode) & kUpb_FieldMode_Mask);
|
||||
}
|
||||
|
||||
UPB_INLINE upb_FieldRep
|
||||
UPB_PRIVATE(_upb_MiniTableField_GetRep)(const struct upb_MiniTableField* f) {
|
||||
UPB_PRIVATE(_upb_MiniTableField_GetRep)(const upb_MiniTableField* f) {
|
||||
return (upb_FieldRep)(f->UPB_ONLYBITS(mode) >> kUpb_FieldRep_Shift);
|
||||
}
|
||||
|
||||
UPB_INLINE bool UPB_PRIVATE(_upb_MiniTableField_IsArray)(
|
||||
const struct upb_MiniTableField* f) {
|
||||
const upb_MiniTableField* f) {
|
||||
return UPB_PRIVATE(_upb_MiniTableField_Mode)(f) == kUpb_FieldMode_Array;
|
||||
}
|
||||
|
||||
UPB_INLINE bool UPB_PRIVATE(_upb_MiniTableField_IsMap)(
|
||||
const struct upb_MiniTableField* f) {
|
||||
const upb_MiniTableField* f) {
|
||||
return UPB_PRIVATE(_upb_MiniTableField_Mode)(f) == kUpb_FieldMode_Map;
|
||||
}
|
||||
|
||||
UPB_INLINE bool UPB_PRIVATE(_upb_MiniTableField_IsScalar)(
|
||||
const struct upb_MiniTableField* f) {
|
||||
const upb_MiniTableField* f) {
|
||||
return UPB_PRIVATE(_upb_MiniTableField_Mode)(f) == kUpb_FieldMode_Scalar;
|
||||
}
|
||||
|
||||
UPB_INLINE bool UPB_PRIVATE(_upb_MiniTableField_IsAlternate)(
|
||||
const struct upb_MiniTableField* f) {
|
||||
const upb_MiniTableField* f) {
|
||||
return (f->UPB_ONLYBITS(mode) & kUpb_LabelFlags_IsAlternate) != 0;
|
||||
}
|
||||
|
||||
UPB_INLINE bool UPB_PRIVATE(_upb_MiniTableField_IsExtension)(
|
||||
const struct upb_MiniTableField* f) {
|
||||
const upb_MiniTableField* f) {
|
||||
return (f->UPB_ONLYBITS(mode) & kUpb_LabelFlags_IsExtension) != 0;
|
||||
}
|
||||
|
||||
UPB_INLINE bool UPB_PRIVATE(_upb_MiniTableField_IsPacked)(
|
||||
const struct upb_MiniTableField* f) {
|
||||
const upb_MiniTableField* f) {
|
||||
return (f->UPB_ONLYBITS(mode) & kUpb_LabelFlags_IsPacked) != 0;
|
||||
}
|
||||
|
||||
UPB_INLINE upb_FieldType
|
||||
UPB_PRIVATE(_upb_MiniTableField_Type)(const struct upb_MiniTableField* f) {
|
||||
UPB_PRIVATE(_upb_MiniTableField_Type)(const upb_MiniTableField* f) {
|
||||
const upb_FieldType type = (upb_FieldType)f->UPB_PRIVATE(descriptortype);
|
||||
if (UPB_PRIVATE(_upb_MiniTableField_IsAlternate)(f)) {
|
||||
if (type == kUpb_FieldType_Int32) return kUpb_FieldType_Enum;
|
||||
|
@ -126,7 +127,7 @@ UPB_PRIVATE(_upb_MiniTableField_Type)(const struct upb_MiniTableField* f) {
|
|||
}
|
||||
|
||||
UPB_INLINE upb_CType
|
||||
UPB_PRIVATE(_upb_MiniTableField_CType)(const struct upb_MiniTableField* f) {
|
||||
UPB_PRIVATE(_upb_MiniTableField_CType)(const upb_MiniTableField* f) {
|
||||
return upb_FieldType_CType(UPB_PRIVATE(_upb_MiniTableField_Type)(f));
|
||||
}
|
||||
|
||||
|
@ -145,23 +146,23 @@ _upb_MiniTableField_HasbitOffset(const struct upb_MiniTableField* f) {
|
|||
}
|
||||
|
||||
UPB_INLINE bool UPB_PRIVATE(_upb_MiniTableField_IsClosedEnum)(
|
||||
const struct upb_MiniTableField* f) {
|
||||
const upb_MiniTableField* f) {
|
||||
return f->UPB_PRIVATE(descriptortype) == kUpb_FieldType_Enum;
|
||||
}
|
||||
|
||||
UPB_INLINE bool UPB_PRIVATE(_upb_MiniTableField_IsInOneof)(
|
||||
const struct upb_MiniTableField* f) {
|
||||
const upb_MiniTableField* f) {
|
||||
return f->presence < 0;
|
||||
}
|
||||
|
||||
UPB_INLINE bool UPB_PRIVATE(_upb_MiniTableField_IsSubMessage)(
|
||||
const struct upb_MiniTableField* f) {
|
||||
const upb_MiniTableField* f) {
|
||||
return f->UPB_PRIVATE(descriptortype) == kUpb_FieldType_Message ||
|
||||
f->UPB_PRIVATE(descriptortype) == kUpb_FieldType_Group;
|
||||
}
|
||||
|
||||
UPB_INLINE bool UPB_PRIVATE(_upb_MiniTableField_HasPresence)(
|
||||
const struct upb_MiniTableField* f) {
|
||||
const upb_MiniTableField* f) {
|
||||
if (UPB_PRIVATE(_upb_MiniTableField_IsExtension)(f)) {
|
||||
return UPB_PRIVATE(_upb_MiniTableField_IsScalar)(f);
|
||||
} else {
|
||||
|
@ -186,7 +187,7 @@ _upb_MiniTableField_OneofOffset(const struct upb_MiniTableField* f) {
|
|||
}
|
||||
|
||||
UPB_INLINE void UPB_PRIVATE(_upb_MiniTableField_CheckIsArray)(
|
||||
const struct upb_MiniTableField* f) {
|
||||
const upb_MiniTableField* f) {
|
||||
UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) ==
|
||||
kUpb_FieldRep_NativePointer);
|
||||
UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_IsArray)(f));
|
||||
|
@ -194,16 +195,17 @@ UPB_INLINE void UPB_PRIVATE(_upb_MiniTableField_CheckIsArray)(
|
|||
}
|
||||
|
||||
UPB_INLINE void UPB_PRIVATE(_upb_MiniTableField_CheckIsMap)(
|
||||
const struct upb_MiniTableField* f) {
|
||||
const upb_MiniTableField* f) {
|
||||
UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) ==
|
||||
kUpb_FieldRep_NativePointer);
|
||||
UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_IsMap)(f));
|
||||
UPB_ASSUME(f->presence == 0);
|
||||
}
|
||||
|
||||
UPB_INLINE size_t UPB_PRIVATE(_upb_MiniTableField_ElemSizeLg2)(
|
||||
const struct upb_MiniTableField* f) {
|
||||
return upb_FieldType_SizeLg2((upb_FieldType)f->UPB_PRIVATE(descriptortype));
|
||||
UPB_INLINE size_t
|
||||
UPB_PRIVATE(_upb_MiniTableField_ElemSizeLg2)(const upb_MiniTableField* f) {
|
||||
const upb_FieldType field_type = UPB_PRIVATE(_upb_MiniTableField_Type)(f);
|
||||
return UPB_PRIVATE(_upb_FieldType_SizeLg2)(field_type);
|
||||
}
|
||||
|
||||
// LINT.ThenChange(//depot/google3/third_party/upb/bits/typescript/mini_table_field.ts)
|
||||
|
|
|
@ -8,13 +8,15 @@
|
|||
#ifndef UPB_MINI_TABLE_INTERNAL_FILE_H_
|
||||
#define UPB_MINI_TABLE_INTERNAL_FILE_H_
|
||||
|
||||
#include "upb/mini_table/types.h"
|
||||
|
||||
// Must be last.
|
||||
#include "upb/port/def.inc"
|
||||
|
||||
struct upb_MiniTableFile {
|
||||
const struct upb_MiniTable** UPB_PRIVATE(msgs);
|
||||
const struct upb_MiniTableEnum** UPB_PRIVATE(enums);
|
||||
const struct upb_MiniTableExtension** UPB_PRIVATE(exts);
|
||||
const upb_MiniTable** UPB_PRIVATE(msgs);
|
||||
const upb_MiniTableEnum** UPB_PRIVATE(enums);
|
||||
const upb_MiniTableExtension** UPB_PRIVATE(exts);
|
||||
int UPB_PRIVATE(msg_count);
|
||||
int UPB_PRIVATE(enum_count);
|
||||
int UPB_PRIVATE(ext_count);
|
||||
|
@ -25,34 +27,34 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
UPB_INLINE int UPB_PRIVATE(_upb_MiniTableFile_EnumCount)(
|
||||
const struct upb_MiniTableFile* f) {
|
||||
const upb_MiniTableFile* f) {
|
||||
return f->UPB_PRIVATE(enum_count);
|
||||
}
|
||||
|
||||
UPB_INLINE int UPB_PRIVATE(_upb_MiniTableFile_ExtensionCount)(
|
||||
const struct upb_MiniTableFile* f) {
|
||||
const upb_MiniTableFile* f) {
|
||||
return f->UPB_PRIVATE(ext_count);
|
||||
}
|
||||
|
||||
UPB_INLINE int UPB_PRIVATE(_upb_MiniTableFile_MessageCount)(
|
||||
const struct upb_MiniTableFile* f) {
|
||||
const upb_MiniTableFile* f) {
|
||||
return f->UPB_PRIVATE(msg_count);
|
||||
}
|
||||
|
||||
UPB_INLINE const struct upb_MiniTableEnum* UPB_PRIVATE(_upb_MiniTableFile_Enum)(
|
||||
const struct upb_MiniTableFile* f, int i) {
|
||||
UPB_INLINE const upb_MiniTableEnum* UPB_PRIVATE(_upb_MiniTableFile_Enum)(
|
||||
const upb_MiniTableFile* f, int i) {
|
||||
UPB_ASSERT(i < f->UPB_PRIVATE(enum_count));
|
||||
return f->UPB_PRIVATE(enums)[i];
|
||||
}
|
||||
|
||||
UPB_INLINE const struct upb_MiniTableExtension* UPB_PRIVATE(
|
||||
_upb_MiniTableFile_Extension)(const struct upb_MiniTableFile* f, int i) {
|
||||
UPB_INLINE const upb_MiniTableExtension* UPB_PRIVATE(
|
||||
_upb_MiniTableFile_Extension)(const upb_MiniTableFile* f, int i) {
|
||||
UPB_ASSERT(i < f->UPB_PRIVATE(ext_count));
|
||||
return f->UPB_PRIVATE(exts)[i];
|
||||
}
|
||||
|
||||
UPB_INLINE const struct upb_MiniTable* UPB_PRIVATE(_upb_MiniTableFile_Message)(
|
||||
const struct upb_MiniTableFile* f, int i) {
|
||||
UPB_INLINE const upb_MiniTable* UPB_PRIVATE(_upb_MiniTableFile_Message)(
|
||||
const upb_MiniTableFile* f, int i) {
|
||||
UPB_ASSERT(i < f->UPB_PRIVATE(msg_count));
|
||||
return f->UPB_PRIVATE(msgs)[i];
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
// license that can be found in the LICENSE file or at
|
||||
// https://developers.google.com/open-source/licenses/bsd
|
||||
|
||||
#include "upb/mini_table/internal/message.h"
|
||||
#include "upb/mini_table/message.h"
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
|||
#include "upb/port/def.inc"
|
||||
|
||||
// A MiniTable for an empty message, used for unlinked sub-messages.
|
||||
const struct upb_MiniTable UPB_PRIVATE(_kUpb_MiniTable_Empty) = {
|
||||
const upb_MiniTable UPB_PRIVATE(_kUpb_MiniTable_Empty) = {
|
||||
.UPB_PRIVATE(subs) = NULL,
|
||||
.UPB_PRIVATE(fields) = NULL,
|
||||
.UPB_PRIVATE(size) = 0,
|
||||
|
|
|
@ -8,9 +8,12 @@
|
|||
#ifndef UPB_MINI_TABLE_INTERNAL_MESSAGE_H_
|
||||
#define UPB_MINI_TABLE_INTERNAL_MESSAGE_H_
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "upb/message/types.h"
|
||||
#include "upb/mini_table/internal/field.h"
|
||||
#include "upb/mini_table/internal/sub.h"
|
||||
#include "upb/mini_table/types.h"
|
||||
|
||||
// Must be last.
|
||||
#include "upb/port/def.inc"
|
||||
|
@ -39,10 +42,11 @@ typedef enum {
|
|||
// upb_MiniTable represents the memory layout of a given upb_MessageDef.
|
||||
// The members are public so generated code can initialize them,
|
||||
// but users MUST NOT directly read or write any of its members.
|
||||
|
||||
// LINT.IfChange(minitable_struct_definition)
|
||||
struct upb_MiniTable {
|
||||
const union upb_MiniTableSub* UPB_PRIVATE(subs);
|
||||
const struct upb_MiniTableField* UPB_ONLYBITS(fields);
|
||||
const upb_MiniTableSub* UPB_PRIVATE(subs);
|
||||
const upb_MiniTableField* UPB_ONLYBITS(fields);
|
||||
|
||||
// Must be aligned to sizeof(void*). Doesn't include internal members like
|
||||
// unknown fields, extension dict, pointer to msglayout, etc.
|
||||
|
@ -66,47 +70,43 @@ struct upb_MiniTable {
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
UPB_INLINE const struct upb_MiniTable* UPB_PRIVATE(_upb_MiniTable_Empty)(void) {
|
||||
extern const struct upb_MiniTable UPB_PRIVATE(_kUpb_MiniTable_Empty);
|
||||
UPB_INLINE const upb_MiniTable* UPB_PRIVATE(_upb_MiniTable_Empty)(void) {
|
||||
extern const upb_MiniTable UPB_PRIVATE(_kUpb_MiniTable_Empty);
|
||||
|
||||
return &UPB_PRIVATE(_kUpb_MiniTable_Empty);
|
||||
}
|
||||
|
||||
UPB_INLINE int UPB_PRIVATE(_upb_MiniTable_FieldCount)(
|
||||
const struct upb_MiniTable* m) {
|
||||
UPB_INLINE int UPB_PRIVATE(_upb_MiniTable_FieldCount)(const upb_MiniTable* m) {
|
||||
return m->UPB_ONLYBITS(field_count);
|
||||
}
|
||||
|
||||
UPB_INLINE bool UPB_PRIVATE(_upb_MiniTable_IsEmpty)(
|
||||
const struct upb_MiniTable* m) {
|
||||
extern const struct upb_MiniTable UPB_PRIVATE(_kUpb_MiniTable_Empty);
|
||||
UPB_INLINE bool UPB_PRIVATE(_upb_MiniTable_IsEmpty)(const upb_MiniTable* m) {
|
||||
extern const upb_MiniTable UPB_PRIVATE(_kUpb_MiniTable_Empty);
|
||||
|
||||
return m == &UPB_PRIVATE(_kUpb_MiniTable_Empty);
|
||||
}
|
||||
|
||||
UPB_INLINE const struct upb_MiniTableField* UPB_PRIVATE(
|
||||
_upb_MiniTable_GetFieldByIndex)(const struct upb_MiniTable* m, uint32_t i) {
|
||||
UPB_INLINE const upb_MiniTableField* UPB_PRIVATE(
|
||||
_upb_MiniTable_GetFieldByIndex)(const upb_MiniTable* m, uint32_t i) {
|
||||
return &m->UPB_ONLYBITS(fields)[i];
|
||||
}
|
||||
|
||||
UPB_INLINE const union upb_MiniTableSub* UPB_PRIVATE(
|
||||
_upb_MiniTable_GetSubByIndex)(const struct upb_MiniTable* m, uint32_t i) {
|
||||
UPB_INLINE const upb_MiniTableSub* UPB_PRIVATE(_upb_MiniTable_GetSubByIndex)(
|
||||
const upb_MiniTable* m, uint32_t i) {
|
||||
return &m->UPB_PRIVATE(subs)[i];
|
||||
}
|
||||
|
||||
UPB_INLINE const struct upb_MiniTable* UPB_PRIVATE(
|
||||
_upb_MiniTable_GetSubMessageTable)(const struct upb_MiniTable* m,
|
||||
const struct upb_MiniTableField* f) {
|
||||
UPB_INLINE const upb_MiniTable* UPB_PRIVATE(_upb_MiniTable_GetSubMessageTable)(
|
||||
const upb_MiniTable* m, const upb_MiniTableField* f) {
|
||||
UPB_ASSERT(UPB_PRIVATE(_upb_MiniTableField_CType)(f) == kUpb_CType_Message);
|
||||
const struct upb_MiniTable* ret = UPB_PRIVATE(_upb_MiniTableSub_Message)(
|
||||
const upb_MiniTable* ret = UPB_PRIVATE(_upb_MiniTableSub_Message)(
|
||||
m->UPB_PRIVATE(subs)[f->UPB_PRIVATE(submsg_index)]);
|
||||
UPB_ASSUME(ret);
|
||||
return UPB_PRIVATE(_upb_MiniTable_IsEmpty)(ret) ? NULL : ret;
|
||||
}
|
||||
|
||||
UPB_INLINE const struct upb_MiniTableEnum* UPB_PRIVATE(
|
||||
_upb_MiniTable_GetSubEnumTable)(const struct upb_MiniTable* m,
|
||||
const struct upb_MiniTableField* f) {
|
||||
UPB_INLINE const upb_MiniTableEnum* UPB_PRIVATE(_upb_MiniTable_GetSubEnumTable)(
|
||||
const upb_MiniTable* m, const upb_MiniTableField* f) {
|
||||
UPB_ASSERT(UPB_PRIVATE(_upb_MiniTableField_CType)(f) == kUpb_CType_Enum);
|
||||
return UPB_PRIVATE(_upb_MiniTableSub_Enum)(
|
||||
m->UPB_PRIVATE(subs)[f->UPB_PRIVATE(submsg_index)]);
|
||||
|
@ -131,7 +131,7 @@ UPB_INLINE const struct upb_MiniTableField* UPB_PRIVATE(
|
|||
}
|
||||
|
||||
UPB_INLINE bool UPB_PRIVATE(_upb_MiniTable_MessageFieldIsLinked)(
|
||||
const struct upb_MiniTable* m, const struct upb_MiniTableField* f) {
|
||||
const upb_MiniTable* m, const upb_MiniTableField* f) {
|
||||
return UPB_PRIVATE(_upb_MiniTable_GetSubMessageTable)(m, f) != NULL;
|
||||
}
|
||||
|
||||
|
@ -142,7 +142,7 @@ UPB_INLINE bool UPB_PRIVATE(_upb_MiniTable_MessageFieldIsLinked)(
|
|||
// RequiredMask(1) => 0b10 (0x2)
|
||||
// RequiredMask(5) => 0b111110 (0x3e)
|
||||
UPB_INLINE uint64_t
|
||||
UPB_PRIVATE(_upb_MiniTable_RequiredMask)(const struct upb_MiniTable* m) {
|
||||
UPB_PRIVATE(_upb_MiniTable_RequiredMask)(const upb_MiniTable* m) {
|
||||
int n = m->UPB_PRIVATE(required_count);
|
||||
UPB_ASSERT(0 < n && n <= 63);
|
||||
return ((1ULL << n) - 1) << 1;
|
||||
|
|
|
@ -22,7 +22,7 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
// Return the log2 of the storage size in bytes for a upb_CType
|
||||
UPB_INLINE int upb_CType_SizeLg2(upb_CType c_type) {
|
||||
UPB_INLINE int UPB_PRIVATE(_upb_CType_SizeLg2)(upb_CType c_type) {
|
||||
static const int8_t size[] = {
|
||||
0, // kUpb_CType_Bool
|
||||
2, // kUpb_CType_Float
|
||||
|
@ -42,7 +42,7 @@ UPB_INLINE int upb_CType_SizeLg2(upb_CType c_type) {
|
|||
}
|
||||
|
||||
// Return the log2 of the storage size in bytes for a upb_FieldType
|
||||
UPB_INLINE int upb_FieldType_SizeLg2(upb_FieldType field_type) {
|
||||
UPB_INLINE int UPB_PRIVATE(_upb_FieldType_SizeLg2)(upb_FieldType field_type) {
|
||||
static const int8_t size[] = {
|
||||
3, // kUpb_FieldType_Double
|
||||
2, // kUpb_FieldType_Float
|
||||
|
|
|
@ -8,39 +8,41 @@
|
|||
#ifndef UPB_MINI_TABLE_INTERNAL_SUB_H_
|
||||
#define UPB_MINI_TABLE_INTERNAL_SUB_H_
|
||||
|
||||
#include "upb/mini_table/types.h"
|
||||
|
||||
// Must be last.
|
||||
#include "upb/port/def.inc"
|
||||
|
||||
union upb_MiniTableSub {
|
||||
const struct upb_MiniTable* UPB_PRIVATE(submsg);
|
||||
const struct upb_MiniTableEnum* UPB_PRIVATE(subenum);
|
||||
const upb_MiniTable* UPB_PRIVATE(submsg);
|
||||
const upb_MiniTableEnum* UPB_PRIVATE(subenum);
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
UPB_INLINE union upb_MiniTableSub UPB_PRIVATE(_upb_MiniTableSub_FromEnum)(
|
||||
const struct upb_MiniTableEnum* subenum) {
|
||||
union upb_MiniTableSub out;
|
||||
UPB_INLINE upb_MiniTableSub
|
||||
UPB_PRIVATE(_upb_MiniTableSub_FromEnum)(const upb_MiniTableEnum* subenum) {
|
||||
upb_MiniTableSub out;
|
||||
out.UPB_PRIVATE(subenum) = subenum;
|
||||
return out;
|
||||
}
|
||||
|
||||
UPB_INLINE union upb_MiniTableSub UPB_PRIVATE(_upb_MiniTableSub_FromMessage)(
|
||||
const struct upb_MiniTable* submsg) {
|
||||
union upb_MiniTableSub out;
|
||||
UPB_INLINE upb_MiniTableSub
|
||||
UPB_PRIVATE(_upb_MiniTableSub_FromMessage)(const upb_MiniTable* submsg) {
|
||||
upb_MiniTableSub out;
|
||||
out.UPB_PRIVATE(submsg) = submsg;
|
||||
return out;
|
||||
}
|
||||
|
||||
UPB_INLINE const struct upb_MiniTableEnum* UPB_PRIVATE(_upb_MiniTableSub_Enum)(
|
||||
const union upb_MiniTableSub sub) {
|
||||
UPB_INLINE const upb_MiniTableEnum* UPB_PRIVATE(_upb_MiniTableSub_Enum)(
|
||||
const upb_MiniTableSub sub) {
|
||||
return sub.UPB_PRIVATE(subenum);
|
||||
}
|
||||
|
||||
UPB_INLINE const struct upb_MiniTable* UPB_PRIVATE(_upb_MiniTableSub_Message)(
|
||||
const union upb_MiniTableSub sub) {
|
||||
UPB_INLINE const upb_MiniTable* UPB_PRIVATE(_upb_MiniTableSub_Message)(
|
||||
const upb_MiniTableSub sub) {
|
||||
return sub.UPB_PRIVATE(submsg);
|
||||
}
|
||||
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
#include <stdint.h>
|
||||
|
||||
#include "upb/mini_table/field.h"
|
||||
#include "upb/mini_table/internal/message.h"
|
||||
|
||||
// Must be last.
|
||||
#include "upb/port/def.inc"
|
||||
|
|
|
@ -8,16 +8,12 @@
|
|||
#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/internal/sub.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
|
||||
|
|
|
@ -9,12 +9,11 @@
|
|||
#define UPB_MINI_TABLE_SUB_H_
|
||||
|
||||
#include "upb/mini_table/internal/sub.h"
|
||||
#include "upb/mini_table/types.h" // IWYU pragma: export
|
||||
|
||||
// Must be last.
|
||||
#include "upb/port/def.inc"
|
||||
|
||||
typedef union upb_MiniTableSub upb_MiniTableSub;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
@ -22,23 +21,23 @@ extern "C" {
|
|||
// Constructors
|
||||
|
||||
UPB_API_INLINE upb_MiniTableSub
|
||||
upb_MiniTableSub_FromEnum(const struct upb_MiniTableEnum* subenum) {
|
||||
upb_MiniTableSub_FromEnum(const upb_MiniTableEnum* subenum) {
|
||||
return UPB_PRIVATE(_upb_MiniTableSub_FromEnum)(subenum);
|
||||
}
|
||||
|
||||
UPB_API_INLINE upb_MiniTableSub
|
||||
upb_MiniTableSub_FromMessage(const struct upb_MiniTable* submsg) {
|
||||
upb_MiniTableSub_FromMessage(const upb_MiniTable* submsg) {
|
||||
return UPB_PRIVATE(_upb_MiniTableSub_FromMessage)(submsg);
|
||||
}
|
||||
|
||||
// Getters
|
||||
|
||||
UPB_API_INLINE const struct upb_MiniTableEnum* upb_MiniTableSub_Enum(
|
||||
UPB_API_INLINE const upb_MiniTableEnum* upb_MiniTableSub_Enum(
|
||||
upb_MiniTableSub sub) {
|
||||
return UPB_PRIVATE(_upb_MiniTableSub_Enum)(sub);
|
||||
}
|
||||
|
||||
UPB_API_INLINE const struct upb_MiniTable* upb_MiniTableSub_Message(
|
||||
UPB_API_INLINE const upb_MiniTable* upb_MiniTableSub_Message(
|
||||
upb_MiniTableSub sub) {
|
||||
return UPB_PRIVATE(_upb_MiniTableSub_Message)(sub);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
// 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_ */
|
|
@ -133,6 +133,7 @@ bootstrap_cc_library(
|
|||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"//upb:base",
|
||||
"//upb:base_internal",
|
||||
"//upb:hash",
|
||||
"//upb:mem",
|
||||
"//upb:message",
|
||||
|
@ -144,9 +145,7 @@ bootstrap_cc_library(
|
|||
"//upb:mini_descriptor",
|
||||
"//upb:mini_descriptor_internal",
|
||||
"//upb:mini_table",
|
||||
"//upb:mini_table_internal",
|
||||
"//upb:port",
|
||||
"//upb/base:internal",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
#include "upb/message/map.h"
|
||||
#include "upb/message/message.h"
|
||||
#include "upb/mini_table/field.h"
|
||||
#include "upb/mini_table/internal/field.h"
|
||||
#include "upb/reflection/def.h"
|
||||
#include "upb/reflection/def_pool.h"
|
||||
#include "upb/reflection/message_def.h"
|
||||
|
|
|
@ -168,7 +168,6 @@ cc_library(
|
|||
"//upb:message",
|
||||
"//upb:mini_descriptor",
|
||||
"//upb:mini_table",
|
||||
"//upb:mini_table_internal",
|
||||
"//upb:port",
|
||||
],
|
||||
)
|
||||
|
|
|
@ -57,7 +57,6 @@ cc_library(
|
|||
"//upb:message_internal_types",
|
||||
"//upb:message_tagged_ptr",
|
||||
"//upb:mini_table",
|
||||
"//upb:mini_table_internal",
|
||||
"//upb:port",
|
||||
"//third_party/utf8_range",
|
||||
],
|
||||
|
|
|
@ -31,8 +31,6 @@
|
|||
#include "upb/mini_table/extension.h"
|
||||
#include "upb/mini_table/extension_registry.h"
|
||||
#include "upb/mini_table/field.h"
|
||||
#include "upb/mini_table/internal/field.h"
|
||||
#include "upb/mini_table/internal/message.h"
|
||||
#include "upb/mini_table/internal/size_log2.h"
|
||||
#include "upb/mini_table/message.h"
|
||||
#include "upb/mini_table/sub.h"
|
||||
|
@ -505,7 +503,7 @@ static const char* _upb_Decoder_DecodeEnumPacked(
|
|||
upb_Array* _upb_Decoder_CreateArray(upb_Decoder* d,
|
||||
const upb_MiniTableField* field) {
|
||||
const upb_FieldType field_type = field->UPB_PRIVATE(descriptortype);
|
||||
const size_t lg2 = upb_FieldType_SizeLg2(field_type);
|
||||
const size_t lg2 = UPB_PRIVATE(_upb_FieldType_SizeLg2)(field_type);
|
||||
upb_Array* ret = UPB_PRIVATE(_upb_Array_New)(&d->arena, 4, lg2);
|
||||
if (!ret) _upb_Decoder_ErrorJmp(d, kUpb_DecodeStatus_OutOfMemory);
|
||||
return ret;
|
||||
|
|
|
@ -31,8 +31,6 @@
|
|||
#include "upb/message/tagged_ptr.h"
|
||||
#include "upb/mini_table/extension.h"
|
||||
#include "upb/mini_table/field.h"
|
||||
#include "upb/mini_table/internal/field.h"
|
||||
#include "upb/mini_table/internal/message.h"
|
||||
#include "upb/mini_table/message.h"
|
||||
#include "upb/mini_table/sub.h"
|
||||
#include "upb/wire/internal/constants.h"
|
||||
|
|
|
@ -104,7 +104,6 @@ bootstrap_cc_library(
|
|||
deps = [
|
||||
":mangle",
|
||||
"//upb:mini_table",
|
||||
"//upb:mini_table_internal",
|
||||
"//upb:port",
|
||||
"@com_google_absl//absl/strings",
|
||||
],
|
||||
|
@ -129,7 +128,6 @@ bootstrap_cc_library(
|
|||
"//upb:base",
|
||||
"//upb:mini_descriptor",
|
||||
"//upb:mini_table",
|
||||
"//upb:mini_table_internal",
|
||||
"//upb:port",
|
||||
"@com_google_absl//absl/container:flat_hash_map",
|
||||
"@com_google_absl//absl/strings",
|
||||
|
@ -267,7 +265,6 @@ bootstrap_cc_binary(
|
|||
deps = [
|
||||
"//upb:base",
|
||||
"//upb:mem",
|
||||
"//upb:mini_table_internal",
|
||||
"//upb:port",
|
||||
"//upb:wire_types",
|
||||
"@com_google_absl//absl/container:flat_hash_map",
|
||||
|
@ -307,7 +304,6 @@ bootstrap_cc_binary(
|
|||
"//upb:base",
|
||||
"//upb:mem",
|
||||
"//upb:mini_table",
|
||||
"//upb:mini_table_internal",
|
||||
"//upb:port",
|
||||
"//upb:wire_types",
|
||||
"@com_google_absl//absl/container:flat_hash_map",
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
#include "absl/strings/string_view.h"
|
||||
#include "absl/strings/substitute.h"
|
||||
#include "upb/mini_table/field.h"
|
||||
#include "upb/mini_table/internal/field.h"
|
||||
#include "upb/reflection/def.hpp"
|
||||
#include "upb_generator/mangle.h"
|
||||
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
#include <unordered_set>
|
||||
#include <vector>
|
||||
|
||||
#include "upb/mini_table/internal/extension.h"
|
||||
#include "upb/reflection/def.hpp"
|
||||
#include "upb_generator/common.h"
|
||||
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
#include "upb/base/string_view.h"
|
||||
#include "upb/mini_table/enum.h"
|
||||
#include "upb/mini_table/field.h"
|
||||
#include "upb/mini_table/internal/field.h"
|
||||
#include "upb/mini_table/message.h"
|
||||
#include "upb/reflection/def.hpp"
|
||||
#include "upb/wire/types.h"
|
||||
|
|
Loading…
Reference in New Issue