From 238538b6ce736c2443c92a992aa1059cade2aebd Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Thu, 21 Dec 2023 13:15:35 -0800 Subject: [PATCH] Fixed breaking ARM tests by properly aligning default options. This char array is interpreted as a proto, so it needs pointer alignment at least. PiperOrigin-RevId: 592935088 --- upb/port/def.inc | 7 + upb/port/undef.inc | 1 + upb/reflection/internal/def_builder.c | 3 +- .../stage0/google/protobuf/descriptor.upb.h | 180 ++++++++---------- .../google/protobuf/compiler/plugin.upb.h | 16 +- 5 files changed, 98 insertions(+), 109 deletions(-) diff --git a/upb/port/def.inc b/upb/port/def.inc index 4b8a09c3b4..5d07592b07 100644 --- a/upb/port/def.inc +++ b/upb/port/def.inc @@ -99,6 +99,13 @@ Error, UINTPTR_MAX is undefined #define UPB_ALIGN_OF(type) offsetof (struct { char c; type member; }, member) #endif +#ifdef _MSC_VER +// Some versions of our Windows compiler don't support the C11 syntax. +#define UPB_ALIGN_AS(x) __declspec(align(x)) +#else +#define UPB_ALIGN_AS(x) _Alignas(x) +#endif + // Hints to the compiler about likely/unlikely branches. #if defined (__GNUC__) || defined(__clang__) #define UPB_LIKELY(x) __builtin_expect((bool)(x), 1) diff --git a/upb/port/undef.inc b/upb/port/undef.inc index 537c5dc4bd..e4aec84b50 100644 --- a/upb/port/undef.inc +++ b/upb/port/undef.inc @@ -18,6 +18,7 @@ #undef UPB_ALIGN_DOWN #undef UPB_ALIGN_MALLOC #undef UPB_ALIGN_OF +#undef UPB_ALIGN_AS #undef UPB_MALLOC_ALIGN #undef UPB_LIKELY #undef UPB_UNLIKELY diff --git a/upb/reflection/internal/def_builder.c b/upb/reflection/internal/def_builder.c index dcd8ee2f1d..7e56017725 100644 --- a/upb/reflection/internal/def_builder.c +++ b/upb/reflection/internal/def_builder.c @@ -29,7 +29,8 @@ * initialized to zeroes. * * We have to allocate an extra pointer for upb's internal metadata. */ -static const char opt_default_buf[_UPB_MAXOPT_SIZE + sizeof(void*)] = {0}; +static UPB_ALIGN_AS(8) const + char opt_default_buf[_UPB_MAXOPT_SIZE + sizeof(void*)] = {0}; const char* kUpbDefOptDefault = &opt_default_buf[sizeof(void*)]; const char* _upb_DefBuilder_FullToShort(const char* fullname) { diff --git a/upb/reflection/stage0/google/protobuf/descriptor.upb.h b/upb/reflection/stage0/google/protobuf/descriptor.upb.h index e94e8d6ae2..932a8185f1 100644 --- a/upb/reflection/stage0/google/protobuf/descriptor.upb.h +++ b/upb/reflection/stage0/google/protobuf/descriptor.upb.h @@ -294,8 +294,8 @@ UPB_INLINE const upb_Array* _google_protobuf_FileDescriptorSet_file_upb_array(co } UPB_INLINE upb_Array* _google_protobuf_FileDescriptorSet_file_mutable_upb_array(google_protobuf_FileDescriptorSet* msg, size_t* size, upb_Arena* arena) { const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FileDescriptorSet_msg_init(), 1); - upb_Array* arr = upb_Message_GetOrCreateMutableArray( - UPB_UPCAST(msg), &field, arena); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), + &field, arena); if (size) { *size = arr ? arr->UPB_PRIVATE(size) : 0; } @@ -426,8 +426,8 @@ UPB_INLINE const upb_Array* _google_protobuf_FileDescriptorProto_dependency_upb_ } UPB_INLINE upb_Array* _google_protobuf_FileDescriptorProto_dependency_mutable_upb_array(google_protobuf_FileDescriptorProto* msg, size_t* size, upb_Arena* arena) { const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FileDescriptorProto_msg_init(), 3); - upb_Array* arr = upb_Message_GetOrCreateMutableArray( - UPB_UPCAST(msg), &field, arena); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), + &field, arena); if (size) { *size = arr ? arr->UPB_PRIVATE(size) : 0; } @@ -458,8 +458,8 @@ UPB_INLINE const upb_Array* _google_protobuf_FileDescriptorProto_message_type_up } UPB_INLINE upb_Array* _google_protobuf_FileDescriptorProto_message_type_mutable_upb_array(google_protobuf_FileDescriptorProto* msg, size_t* size, upb_Arena* arena) { const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FileDescriptorProto_msg_init(), 4); - upb_Array* arr = upb_Message_GetOrCreateMutableArray( - UPB_UPCAST(msg), &field, arena); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), + &field, arena); if (size) { *size = arr ? arr->UPB_PRIVATE(size) : 0; } @@ -490,8 +490,8 @@ UPB_INLINE const upb_Array* _google_protobuf_FileDescriptorProto_enum_type_upb_a } UPB_INLINE upb_Array* _google_protobuf_FileDescriptorProto_enum_type_mutable_upb_array(google_protobuf_FileDescriptorProto* msg, size_t* size, upb_Arena* arena) { const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FileDescriptorProto_msg_init(), 5); - upb_Array* arr = upb_Message_GetOrCreateMutableArray( - UPB_UPCAST(msg), &field, arena); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), + &field, arena); if (size) { *size = arr ? arr->UPB_PRIVATE(size) : 0; } @@ -522,8 +522,8 @@ UPB_INLINE const upb_Array* _google_protobuf_FileDescriptorProto_service_upb_arr } UPB_INLINE upb_Array* _google_protobuf_FileDescriptorProto_service_mutable_upb_array(google_protobuf_FileDescriptorProto* msg, size_t* size, upb_Arena* arena) { const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FileDescriptorProto_msg_init(), 6); - upb_Array* arr = upb_Message_GetOrCreateMutableArray( - UPB_UPCAST(msg), &field, arena); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), + &field, arena); if (size) { *size = arr ? arr->UPB_PRIVATE(size) : 0; } @@ -554,8 +554,8 @@ UPB_INLINE const upb_Array* _google_protobuf_FileDescriptorProto_extension_upb_a } UPB_INLINE upb_Array* _google_protobuf_FileDescriptorProto_extension_mutable_upb_array(google_protobuf_FileDescriptorProto* msg, size_t* size, upb_Arena* arena) { const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FileDescriptorProto_msg_init(), 7); - upb_Array* arr = upb_Message_GetOrCreateMutableArray( - UPB_UPCAST(msg), &field, arena); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), + &field, arena); if (size) { *size = arr ? arr->UPB_PRIVATE(size) : 0; } @@ -618,8 +618,8 @@ UPB_INLINE const upb_Array* _google_protobuf_FileDescriptorProto_public_dependen } UPB_INLINE upb_Array* _google_protobuf_FileDescriptorProto_public_dependency_mutable_upb_array(google_protobuf_FileDescriptorProto* msg, size_t* size, upb_Arena* arena) { const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FileDescriptorProto_msg_init(), 10); - upb_Array* arr = upb_Message_GetOrCreateMutableArray( - UPB_UPCAST(msg), &field, arena); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), + &field, arena); if (size) { *size = arr ? arr->UPB_PRIVATE(size) : 0; } @@ -650,8 +650,8 @@ UPB_INLINE const upb_Array* _google_protobuf_FileDescriptorProto_weak_dependency } UPB_INLINE upb_Array* _google_protobuf_FileDescriptorProto_weak_dependency_mutable_upb_array(google_protobuf_FileDescriptorProto* msg, size_t* size, upb_Arena* arena) { const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FileDescriptorProto_msg_init(), 11); - upb_Array* arr = upb_Message_GetOrCreateMutableArray( - UPB_UPCAST(msg), &field, arena); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), + &field, arena); if (size) { *size = arr ? arr->UPB_PRIVATE(size) : 0; } @@ -1012,8 +1012,8 @@ UPB_INLINE const upb_Array* _google_protobuf_DescriptorProto_field_upb_array(con } UPB_INLINE upb_Array* _google_protobuf_DescriptorProto_field_mutable_upb_array(google_protobuf_DescriptorProto* msg, size_t* size, upb_Arena* arena) { const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__DescriptorProto_msg_init(), 2); - upb_Array* arr = upb_Message_GetOrCreateMutableArray( - UPB_UPCAST(msg), &field, arena); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), + &field, arena); if (size) { *size = arr ? arr->UPB_PRIVATE(size) : 0; } @@ -1044,8 +1044,8 @@ UPB_INLINE const upb_Array* _google_protobuf_DescriptorProto_nested_type_upb_arr } UPB_INLINE upb_Array* _google_protobuf_DescriptorProto_nested_type_mutable_upb_array(google_protobuf_DescriptorProto* msg, size_t* size, upb_Arena* arena) { const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__DescriptorProto_msg_init(), 3); - upb_Array* arr = upb_Message_GetOrCreateMutableArray( - UPB_UPCAST(msg), &field, arena); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), + &field, arena); if (size) { *size = arr ? arr->UPB_PRIVATE(size) : 0; } @@ -1076,8 +1076,8 @@ UPB_INLINE const upb_Array* _google_protobuf_DescriptorProto_enum_type_upb_array } UPB_INLINE upb_Array* _google_protobuf_DescriptorProto_enum_type_mutable_upb_array(google_protobuf_DescriptorProto* msg, size_t* size, upb_Arena* arena) { const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__DescriptorProto_msg_init(), 4); - upb_Array* arr = upb_Message_GetOrCreateMutableArray( - UPB_UPCAST(msg), &field, arena); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), + &field, arena); if (size) { *size = arr ? arr->UPB_PRIVATE(size) : 0; } @@ -1108,8 +1108,8 @@ UPB_INLINE const upb_Array* _google_protobuf_DescriptorProto_extension_range_upb } UPB_INLINE upb_Array* _google_protobuf_DescriptorProto_extension_range_mutable_upb_array(google_protobuf_DescriptorProto* msg, size_t* size, upb_Arena* arena) { const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__DescriptorProto_msg_init(), 5); - upb_Array* arr = upb_Message_GetOrCreateMutableArray( - UPB_UPCAST(msg), &field, arena); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), + &field, arena); if (size) { *size = arr ? arr->UPB_PRIVATE(size) : 0; } @@ -1140,8 +1140,8 @@ UPB_INLINE const upb_Array* _google_protobuf_DescriptorProto_extension_upb_array } UPB_INLINE upb_Array* _google_protobuf_DescriptorProto_extension_mutable_upb_array(google_protobuf_DescriptorProto* msg, size_t* size, upb_Arena* arena) { const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__DescriptorProto_msg_init(), 6); - upb_Array* arr = upb_Message_GetOrCreateMutableArray( - UPB_UPCAST(msg), &field, arena); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), + &field, arena); if (size) { *size = arr ? arr->UPB_PRIVATE(size) : 0; } @@ -1188,8 +1188,8 @@ UPB_INLINE const upb_Array* _google_protobuf_DescriptorProto_oneof_decl_upb_arra } UPB_INLINE upb_Array* _google_protobuf_DescriptorProto_oneof_decl_mutable_upb_array(google_protobuf_DescriptorProto* msg, size_t* size, upb_Arena* arena) { const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__DescriptorProto_msg_init(), 8); - upb_Array* arr = upb_Message_GetOrCreateMutableArray( - UPB_UPCAST(msg), &field, arena); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), + &field, arena); if (size) { *size = arr ? arr->UPB_PRIVATE(size) : 0; } @@ -1220,8 +1220,8 @@ UPB_INLINE const upb_Array* _google_protobuf_DescriptorProto_reserved_range_upb_ } UPB_INLINE upb_Array* _google_protobuf_DescriptorProto_reserved_range_mutable_upb_array(google_protobuf_DescriptorProto* msg, size_t* size, upb_Arena* arena) { const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__DescriptorProto_msg_init(), 9); - upb_Array* arr = upb_Message_GetOrCreateMutableArray( - UPB_UPCAST(msg), &field, arena); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), + &field, arena); if (size) { *size = arr ? arr->UPB_PRIVATE(size) : 0; } @@ -1252,8 +1252,8 @@ UPB_INLINE const upb_Array* _google_protobuf_DescriptorProto_reserved_name_upb_a } UPB_INLINE upb_Array* _google_protobuf_DescriptorProto_reserved_name_mutable_upb_array(google_protobuf_DescriptorProto* msg, size_t* size, upb_Arena* arena) { const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__DescriptorProto_msg_init(), 10); - upb_Array* arr = upb_Message_GetOrCreateMutableArray( - UPB_UPCAST(msg), &field, arena); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), + &field, arena); if (size) { *size = arr ? arr->UPB_PRIVATE(size) : 0; } @@ -1760,8 +1760,8 @@ UPB_INLINE const upb_Array* _google_protobuf_ExtensionRangeOptions_declaration_u } UPB_INLINE upb_Array* _google_protobuf_ExtensionRangeOptions_declaration_mutable_upb_array(google_protobuf_ExtensionRangeOptions* msg, size_t* size, upb_Arena* arena) { const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__ExtensionRangeOptions_msg_init(), 2); - upb_Array* arr = upb_Message_GetOrCreateMutableArray( - UPB_UPCAST(msg), &field, arena); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), + &field, arena); if (size) { *size = arr ? arr->UPB_PRIVATE(size) : 0; } @@ -1824,8 +1824,8 @@ UPB_INLINE const upb_Array* _google_protobuf_ExtensionRangeOptions_uninterpreted } UPB_INLINE upb_Array* _google_protobuf_ExtensionRangeOptions_uninterpreted_option_mutable_upb_array(google_protobuf_ExtensionRangeOptions* msg, size_t* size, upb_Arena* arena) { const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__ExtensionRangeOptions_msg_init(), 999); - upb_Array* arr = upb_Message_GetOrCreateMutableArray( - UPB_UPCAST(msg), &field, arena); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), + &field, arena); if (size) { *size = arr ? arr->UPB_PRIVATE(size) : 0; } @@ -2476,8 +2476,8 @@ UPB_INLINE const upb_Array* _google_protobuf_EnumDescriptorProto_value_upb_array } UPB_INLINE upb_Array* _google_protobuf_EnumDescriptorProto_value_mutable_upb_array(google_protobuf_EnumDescriptorProto* msg, size_t* size, upb_Arena* arena) { const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__EnumDescriptorProto_msg_init(), 2); - upb_Array* arr = upb_Message_GetOrCreateMutableArray( - UPB_UPCAST(msg), &field, arena); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), + &field, arena); if (size) { *size = arr ? arr->UPB_PRIVATE(size) : 0; } @@ -2524,8 +2524,8 @@ UPB_INLINE const upb_Array* _google_protobuf_EnumDescriptorProto_reserved_range_ } UPB_INLINE upb_Array* _google_protobuf_EnumDescriptorProto_reserved_range_mutable_upb_array(google_protobuf_EnumDescriptorProto* msg, size_t* size, upb_Arena* arena) { const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__EnumDescriptorProto_msg_init(), 4); - upb_Array* arr = upb_Message_GetOrCreateMutableArray( - UPB_UPCAST(msg), &field, arena); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), + &field, arena); if (size) { *size = arr ? arr->UPB_PRIVATE(size) : 0; } @@ -2556,8 +2556,8 @@ UPB_INLINE const upb_Array* _google_protobuf_EnumDescriptorProto_reserved_name_u } UPB_INLINE upb_Array* _google_protobuf_EnumDescriptorProto_reserved_name_mutable_upb_array(google_protobuf_EnumDescriptorProto* msg, size_t* size, upb_Arena* arena) { const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__EnumDescriptorProto_msg_init(), 5); - upb_Array* arr = upb_Message_GetOrCreateMutableArray( - UPB_UPCAST(msg), &field, arena); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), + &field, arena); if (size) { *size = arr ? arr->UPB_PRIVATE(size) : 0; } @@ -2930,8 +2930,8 @@ UPB_INLINE const upb_Array* _google_protobuf_ServiceDescriptorProto_method_upb_a } UPB_INLINE upb_Array* _google_protobuf_ServiceDescriptorProto_method_mutable_upb_array(google_protobuf_ServiceDescriptorProto* msg, size_t* size, upb_Arena* arena) { const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__ServiceDescriptorProto_msg_init(), 2); - upb_Array* arr = upb_Message_GetOrCreateMutableArray( - UPB_UPCAST(msg), &field, arena); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), + &field, arena); if (size) { *size = arr ? arr->UPB_PRIVATE(size) : 0; } @@ -3475,22 +3475,6 @@ UPB_INLINE bool google_protobuf_FileOptions_has_php_namespace(const google_proto const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FileOptions_msg_init(), 41); return _upb_Message_HasNonExtensionField(UPB_UPCAST(msg), &field); } -UPB_INLINE void google_protobuf_FileOptions_clear_php_generic_services(google_protobuf_FileOptions* msg) { - const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FileOptions_msg_init(), 42); - _upb_Message_ClearNonExtensionField(UPB_UPCAST(msg), &field); -} -UPB_INLINE bool google_protobuf_FileOptions_php_generic_services(const google_protobuf_FileOptions* msg) { - bool default_val = false; - bool ret; - const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FileOptions_msg_init(), 42); - _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, - &default_val, &ret); - return ret; -} -UPB_INLINE bool google_protobuf_FileOptions_has_php_generic_services(const google_protobuf_FileOptions* msg) { - const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FileOptions_msg_init(), 42); - return _upb_Message_HasNonExtensionField(UPB_UPCAST(msg), &field); -} UPB_INLINE void google_protobuf_FileOptions_clear_php_metadata_namespace(google_protobuf_FileOptions* msg) { const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FileOptions_msg_init(), 44); _upb_Message_ClearNonExtensionField(UPB_UPCAST(msg), &field); @@ -3564,8 +3548,8 @@ UPB_INLINE const upb_Array* _google_protobuf_FileOptions_uninterpreted_option_up } UPB_INLINE upb_Array* _google_protobuf_FileOptions_uninterpreted_option_mutable_upb_array(google_protobuf_FileOptions* msg, size_t* size, upb_Arena* arena) { const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FileOptions_msg_init(), 999); - upb_Array* arr = upb_Message_GetOrCreateMutableArray( - UPB_UPCAST(msg), &field, arena); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), + &field, arena); if (size) { *size = arr ? arr->UPB_PRIVATE(size) : 0; } @@ -3640,10 +3624,6 @@ UPB_INLINE void google_protobuf_FileOptions_set_php_namespace(google_protobuf_Fi const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FileOptions_msg_init(), 41); _upb_Message_SetNonExtensionField((upb_Message *)msg, &field, &value); } -UPB_INLINE void google_protobuf_FileOptions_set_php_generic_services(google_protobuf_FileOptions *msg, bool value) { - const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FileOptions_msg_init(), 42); - _upb_Message_SetNonExtensionField((upb_Message *)msg, &field, &value); -} UPB_INLINE void google_protobuf_FileOptions_set_php_metadata_namespace(google_protobuf_FileOptions *msg, upb_StringView value) { const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FileOptions_msg_init(), 44); _upb_Message_SetNonExtensionField((upb_Message *)msg, &field, &value); @@ -3852,8 +3832,8 @@ UPB_INLINE const upb_Array* _google_protobuf_MessageOptions_uninterpreted_option } UPB_INLINE upb_Array* _google_protobuf_MessageOptions_uninterpreted_option_mutable_upb_array(google_protobuf_MessageOptions* msg, size_t* size, upb_Arena* arena) { const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__MessageOptions_msg_init(), 999); - upb_Array* arr = upb_Message_GetOrCreateMutableArray( - UPB_UPCAST(msg), &field, arena); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), + &field, arena); if (size) { *size = arr ? arr->UPB_PRIVATE(size) : 0; } @@ -4128,8 +4108,8 @@ UPB_INLINE const upb_Array* _google_protobuf_FieldOptions_targets_upb_array(cons } UPB_INLINE upb_Array* _google_protobuf_FieldOptions_targets_mutable_upb_array(google_protobuf_FieldOptions* msg, size_t* size, upb_Arena* arena) { const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FieldOptions_msg_init(), 19); - upb_Array* arr = upb_Message_GetOrCreateMutableArray( - UPB_UPCAST(msg), &field, arena); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), + &field, arena); if (size) { *size = arr ? arr->UPB_PRIVATE(size) : 0; } @@ -4160,8 +4140,8 @@ UPB_INLINE const upb_Array* _google_protobuf_FieldOptions_edition_defaults_upb_a } UPB_INLINE upb_Array* _google_protobuf_FieldOptions_edition_defaults_mutable_upb_array(google_protobuf_FieldOptions* msg, size_t* size, upb_Arena* arena) { const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FieldOptions_msg_init(), 20); - upb_Array* arr = upb_Message_GetOrCreateMutableArray( - UPB_UPCAST(msg), &field, arena); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), + &field, arena); if (size) { *size = arr ? arr->UPB_PRIVATE(size) : 0; } @@ -4208,8 +4188,8 @@ UPB_INLINE const upb_Array* _google_protobuf_FieldOptions_uninterpreted_option_u } UPB_INLINE upb_Array* _google_protobuf_FieldOptions_uninterpreted_option_mutable_upb_array(google_protobuf_FieldOptions* msg, size_t* size, upb_Arena* arena) { const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FieldOptions_msg_init(), 999); - upb_Array* arr = upb_Message_GetOrCreateMutableArray( - UPB_UPCAST(msg), &field, arena); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), + &field, arena); if (size) { *size = arr ? arr->UPB_PRIVATE(size) : 0; } @@ -4508,8 +4488,8 @@ UPB_INLINE const upb_Array* _google_protobuf_OneofOptions_uninterpreted_option_u } UPB_INLINE upb_Array* _google_protobuf_OneofOptions_uninterpreted_option_mutable_upb_array(google_protobuf_OneofOptions* msg, size_t* size, upb_Arena* arena) { const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__OneofOptions_msg_init(), 999); - upb_Array* arr = upb_Message_GetOrCreateMutableArray( - UPB_UPCAST(msg), &field, arena); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), + &field, arena); if (size) { *size = arr ? arr->UPB_PRIVATE(size) : 0; } @@ -4684,8 +4664,8 @@ UPB_INLINE const upb_Array* _google_protobuf_EnumOptions_uninterpreted_option_up } UPB_INLINE upb_Array* _google_protobuf_EnumOptions_uninterpreted_option_mutable_upb_array(google_protobuf_EnumOptions* msg, size_t* size, upb_Arena* arena) { const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__EnumOptions_msg_init(), 999); - upb_Array* arr = upb_Message_GetOrCreateMutableArray( - UPB_UPCAST(msg), &field, arena); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), + &field, arena); if (size) { *size = arr ? arr->UPB_PRIVATE(size) : 0; } @@ -4856,8 +4836,8 @@ UPB_INLINE const upb_Array* _google_protobuf_EnumValueOptions_uninterpreted_opti } UPB_INLINE upb_Array* _google_protobuf_EnumValueOptions_uninterpreted_option_mutable_upb_array(google_protobuf_EnumValueOptions* msg, size_t* size, upb_Arena* arena) { const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__EnumValueOptions_msg_init(), 999); - upb_Array* arr = upb_Message_GetOrCreateMutableArray( - UPB_UPCAST(msg), &field, arena); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), + &field, arena); if (size) { *size = arr ? arr->UPB_PRIVATE(size) : 0; } @@ -5008,8 +4988,8 @@ UPB_INLINE const upb_Array* _google_protobuf_ServiceOptions_uninterpreted_option } UPB_INLINE upb_Array* _google_protobuf_ServiceOptions_uninterpreted_option_mutable_upb_array(google_protobuf_ServiceOptions* msg, size_t* size, upb_Arena* arena) { const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__ServiceOptions_msg_init(), 999); - upb_Array* arr = upb_Message_GetOrCreateMutableArray( - UPB_UPCAST(msg), &field, arena); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), + &field, arena); if (size) { *size = arr ? arr->UPB_PRIVATE(size) : 0; } @@ -5172,8 +5152,8 @@ UPB_INLINE const upb_Array* _google_protobuf_MethodOptions_uninterpreted_option_ } UPB_INLINE upb_Array* _google_protobuf_MethodOptions_uninterpreted_option_mutable_upb_array(google_protobuf_MethodOptions* msg, size_t* size, upb_Arena* arena) { const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__MethodOptions_msg_init(), 999); - upb_Array* arr = upb_Message_GetOrCreateMutableArray( - UPB_UPCAST(msg), &field, arena); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), + &field, arena); if (size) { *size = arr ? arr->UPB_PRIVATE(size) : 0; } @@ -5292,8 +5272,8 @@ UPB_INLINE const upb_Array* _google_protobuf_UninterpretedOption_name_upb_array( } UPB_INLINE upb_Array* _google_protobuf_UninterpretedOption_name_mutable_upb_array(google_protobuf_UninterpretedOption* msg, size_t* size, upb_Arena* arena) { const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__UninterpretedOption_msg_init(), 2); - upb_Array* arr = upb_Message_GetOrCreateMutableArray( - UPB_UPCAST(msg), &field, arena); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), + &field, arena); if (size) { *size = arr ? arr->UPB_PRIVATE(size) : 0; } @@ -5748,8 +5728,8 @@ UPB_INLINE const upb_Array* _google_protobuf_FeatureSetDefaults_defaults_upb_arr } UPB_INLINE upb_Array* _google_protobuf_FeatureSetDefaults_defaults_mutable_upb_array(google_protobuf_FeatureSetDefaults* msg, size_t* size, upb_Arena* arena) { const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FeatureSetDefaults_msg_init(), 1); - upb_Array* arr = upb_Message_GetOrCreateMutableArray( - UPB_UPCAST(msg), &field, arena); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), + &field, arena); if (size) { *size = arr ? arr->UPB_PRIVATE(size) : 0; } @@ -5974,8 +5954,8 @@ UPB_INLINE const upb_Array* _google_protobuf_SourceCodeInfo_location_upb_array(c } UPB_INLINE upb_Array* _google_protobuf_SourceCodeInfo_location_mutable_upb_array(google_protobuf_SourceCodeInfo* msg, size_t* size, upb_Arena* arena) { const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__SourceCodeInfo_msg_init(), 1); - upb_Array* arr = upb_Message_GetOrCreateMutableArray( - UPB_UPCAST(msg), &field, arena); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), + &field, arena); if (size) { *size = arr ? arr->UPB_PRIVATE(size) : 0; } @@ -6074,8 +6054,8 @@ UPB_INLINE const upb_Array* _google_protobuf_SourceCodeInfo_Location_path_upb_ar } UPB_INLINE upb_Array* _google_protobuf_SourceCodeInfo_Location_path_mutable_upb_array(google_protobuf_SourceCodeInfo_Location* msg, size_t* size, upb_Arena* arena) { const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__SourceCodeInfo__Location_msg_init(), 1); - upb_Array* arr = upb_Message_GetOrCreateMutableArray( - UPB_UPCAST(msg), &field, arena); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), + &field, arena); if (size) { *size = arr ? arr->UPB_PRIVATE(size) : 0; } @@ -6106,8 +6086,8 @@ UPB_INLINE const upb_Array* _google_protobuf_SourceCodeInfo_Location_span_upb_ar } UPB_INLINE upb_Array* _google_protobuf_SourceCodeInfo_Location_span_mutable_upb_array(google_protobuf_SourceCodeInfo_Location* msg, size_t* size, upb_Arena* arena) { const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__SourceCodeInfo__Location_msg_init(), 2); - upb_Array* arr = upb_Message_GetOrCreateMutableArray( - UPB_UPCAST(msg), &field, arena); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), + &field, arena); if (size) { *size = arr ? arr->UPB_PRIVATE(size) : 0; } @@ -6170,8 +6150,8 @@ UPB_INLINE const upb_Array* _google_protobuf_SourceCodeInfo_Location_leading_det } UPB_INLINE upb_Array* _google_protobuf_SourceCodeInfo_Location_leading_detached_comments_mutable_upb_array(google_protobuf_SourceCodeInfo_Location* msg, size_t* size, upb_Arena* arena) { const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__SourceCodeInfo__Location_msg_init(), 6); - upb_Array* arr = upb_Message_GetOrCreateMutableArray( - UPB_UPCAST(msg), &field, arena); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), + &field, arena); if (size) { *size = arr ? arr->UPB_PRIVATE(size) : 0; } @@ -6332,8 +6312,8 @@ UPB_INLINE const upb_Array* _google_protobuf_GeneratedCodeInfo_annotation_upb_ar } UPB_INLINE upb_Array* _google_protobuf_GeneratedCodeInfo_annotation_mutable_upb_array(google_protobuf_GeneratedCodeInfo* msg, size_t* size, upb_Arena* arena) { const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__GeneratedCodeInfo_msg_init(), 1); - upb_Array* arr = upb_Message_GetOrCreateMutableArray( - UPB_UPCAST(msg), &field, arena); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), + &field, arena); if (size) { *size = arr ? arr->UPB_PRIVATE(size) : 0; } @@ -6432,8 +6412,8 @@ UPB_INLINE const upb_Array* _google_protobuf_GeneratedCodeInfo_Annotation_path_u } UPB_INLINE upb_Array* _google_protobuf_GeneratedCodeInfo_Annotation_path_mutable_upb_array(google_protobuf_GeneratedCodeInfo_Annotation* msg, size_t* size, upb_Arena* arena) { const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__GeneratedCodeInfo__Annotation_msg_init(), 1); - upb_Array* arr = upb_Message_GetOrCreateMutableArray( - UPB_UPCAST(msg), &field, arena); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), + &field, arena); if (size) { *size = arr ? arr->UPB_PRIVATE(size) : 0; } diff --git a/upb_generator/stage0/google/protobuf/compiler/plugin.upb.h b/upb_generator/stage0/google/protobuf/compiler/plugin.upb.h index f987de7a5c..fedc5299d5 100644 --- a/upb_generator/stage0/google/protobuf/compiler/plugin.upb.h +++ b/upb_generator/stage0/google/protobuf/compiler/plugin.upb.h @@ -219,8 +219,8 @@ UPB_INLINE const upb_Array* _google_protobuf_compiler_CodeGeneratorRequest_file_ } UPB_INLINE upb_Array* _google_protobuf_compiler_CodeGeneratorRequest_file_to_generate_mutable_upb_array(google_protobuf_compiler_CodeGeneratorRequest* msg, size_t* size, upb_Arena* arena) { const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__compiler__CodeGeneratorRequest_msg_init(), 1); - upb_Array* arr = upb_Message_GetOrCreateMutableArray( - UPB_UPCAST(msg), &field, arena); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), + &field, arena); if (size) { *size = arr ? arr->UPB_PRIVATE(size) : 0; } @@ -283,8 +283,8 @@ UPB_INLINE const upb_Array* _google_protobuf_compiler_CodeGeneratorRequest_proto } UPB_INLINE upb_Array* _google_protobuf_compiler_CodeGeneratorRequest_proto_file_mutable_upb_array(google_protobuf_compiler_CodeGeneratorRequest* msg, size_t* size, upb_Arena* arena) { const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__compiler__CodeGeneratorRequest_msg_init(), 15); - upb_Array* arr = upb_Message_GetOrCreateMutableArray( - UPB_UPCAST(msg), &field, arena); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), + &field, arena); if (size) { *size = arr ? arr->UPB_PRIVATE(size) : 0; } @@ -315,8 +315,8 @@ UPB_INLINE const upb_Array* _google_protobuf_compiler_CodeGeneratorRequest_sourc } UPB_INLINE upb_Array* _google_protobuf_compiler_CodeGeneratorRequest_source_file_descriptors_mutable_upb_array(google_protobuf_compiler_CodeGeneratorRequest* msg, size_t* size, upb_Arena* arena) { const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__compiler__CodeGeneratorRequest_msg_init(), 17); - upb_Array* arr = upb_Message_GetOrCreateMutableArray( - UPB_UPCAST(msg), &field, arena); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), + &field, arena); if (size) { *size = arr ? arr->UPB_PRIVATE(size) : 0; } @@ -553,8 +553,8 @@ UPB_INLINE const upb_Array* _google_protobuf_compiler_CodeGeneratorResponse_file } UPB_INLINE upb_Array* _google_protobuf_compiler_CodeGeneratorResponse_file_mutable_upb_array(google_protobuf_compiler_CodeGeneratorResponse* msg, size_t* size, upb_Arena* arena) { const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__compiler__CodeGeneratorResponse_msg_init(), 15); - upb_Array* arr = upb_Message_GetOrCreateMutableArray( - UPB_UPCAST(msg), &field, arena); + upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), + &field, arena); if (size) { *size = arr ? arr->UPB_PRIVATE(size) : 0; }