Auto-generate files after cl/586187469

pull/14882/head
Protobuf Team Bot 1 year ago
parent d0c85637e7
commit 842f56b57a
  1. 236
      php/ext/google/protobuf/php-upb.c
  2. 132
      php/ext/google/protobuf/php-upb.h
  3. 236
      ruby/ext/google/protobuf_c/ruby-upb.c
  4. 132
      ruby/ext/google/protobuf_c/ruby-upb.h
  5. 142
      upb/cmake/google/protobuf/descriptor.upb_minitable.c

@ -392,7 +392,7 @@ void upb_Status_VAppendErrorFormat(upb_Status* status, const char* fmt,
// Must be last.
static const upb_MiniTableSub google_protobuf_FileDescriptorSet_submsgs[1] = {
{.submsg = &google__protobuf__FileDescriptorProto_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__FileDescriptorProto_msg_init},
};
static const upb_MiniTableField google_protobuf_FileDescriptorSet__fields[1] = {
@ -410,13 +410,13 @@ const upb_MiniTable google__protobuf__FileDescriptorSet_msg_init = {
};
static const upb_MiniTableSub google_protobuf_FileDescriptorProto_submsgs[7] = {
{.submsg = &google__protobuf__DescriptorProto_msg_init},
{.submsg = &google__protobuf__EnumDescriptorProto_msg_init},
{.submsg = &google__protobuf__ServiceDescriptorProto_msg_init},
{.submsg = &google__protobuf__FieldDescriptorProto_msg_init},
{.submsg = &google__protobuf__FileOptions_msg_init},
{.submsg = &google__protobuf__SourceCodeInfo_msg_init},
{.subenum = &google_protobuf_Edition_enum_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__DescriptorProto_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__EnumDescriptorProto_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__ServiceDescriptorProto_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__FieldDescriptorProto_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__FileOptions_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__SourceCodeInfo_msg_init},
{.UPB_PRIVATE(subenum) = &google_protobuf_Edition_enum_init},
};
static const upb_MiniTableField google_protobuf_FileDescriptorProto__fields[13] = {
@ -460,14 +460,14 @@ const upb_MiniTable google__protobuf__FileDescriptorProto_msg_init = {
};
static const upb_MiniTableSub google_protobuf_DescriptorProto_submsgs[8] = {
{.submsg = &google__protobuf__FieldDescriptorProto_msg_init},
{.submsg = &google__protobuf__DescriptorProto_msg_init},
{.submsg = &google__protobuf__EnumDescriptorProto_msg_init},
{.submsg = &google__protobuf__DescriptorProto__ExtensionRange_msg_init},
{.submsg = &google__protobuf__FieldDescriptorProto_msg_init},
{.submsg = &google__protobuf__MessageOptions_msg_init},
{.submsg = &google__protobuf__OneofDescriptorProto_msg_init},
{.submsg = &google__protobuf__DescriptorProto__ReservedRange_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__FieldDescriptorProto_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__DescriptorProto_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__EnumDescriptorProto_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__DescriptorProto__ExtensionRange_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__FieldDescriptorProto_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__MessageOptions_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__OneofDescriptorProto_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__DescriptorProto__ReservedRange_msg_init},
};
static const upb_MiniTableField google_protobuf_DescriptorProto__fields[10] = {
@ -508,7 +508,7 @@ const upb_MiniTable google__protobuf__DescriptorProto_msg_init = {
};
static const upb_MiniTableSub google_protobuf_DescriptorProto_ExtensionRange_submsgs[1] = {
{.submsg = &google__protobuf__ExtensionRangeOptions_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__ExtensionRangeOptions_msg_init},
};
static const upb_MiniTableField google_protobuf_DescriptorProto_ExtensionRange__fields[3] = {
@ -547,10 +547,10 @@ const upb_MiniTable google__protobuf__DescriptorProto__ReservedRange_msg_init =
};
static const upb_MiniTableSub google_protobuf_ExtensionRangeOptions_submsgs[4] = {
{.submsg = &google__protobuf__ExtensionRangeOptions__Declaration_msg_init},
{.submsg = &google__protobuf__FeatureSet_msg_init},
{.submsg = &google__protobuf__UninterpretedOption_msg_init},
{.subenum = &google_protobuf_ExtensionRangeOptions_VerificationState_enum_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__ExtensionRangeOptions__Declaration_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__FeatureSet_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__UninterpretedOption_msg_init},
{.UPB_PRIVATE(subenum) = &google_protobuf_ExtensionRangeOptions_VerificationState_enum_init},
};
static const upb_MiniTableField google_protobuf_ExtensionRangeOptions__fields[4] = {
@ -625,9 +625,9 @@ const upb_MiniTable google__protobuf__ExtensionRangeOptions__Declaration_msg_ini
};
static const upb_MiniTableSub google_protobuf_FieldDescriptorProto_submsgs[3] = {
{.submsg = &google__protobuf__FieldOptions_msg_init},
{.subenum = &google_protobuf_FieldDescriptorProto_Label_enum_init},
{.subenum = &google_protobuf_FieldDescriptorProto_Type_enum_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__FieldOptions_msg_init},
{.UPB_PRIVATE(subenum) = &google_protobuf_FieldDescriptorProto_Label_enum_init},
{.UPB_PRIVATE(subenum) = &google_protobuf_FieldDescriptorProto_Type_enum_init},
};
static const upb_MiniTableField google_protobuf_FieldDescriptorProto__fields[11] = {
@ -685,7 +685,7 @@ const upb_MiniTable google__protobuf__FieldDescriptorProto_msg_init = {
};
static const upb_MiniTableSub google_protobuf_OneofDescriptorProto_submsgs[1] = {
{.submsg = &google__protobuf__OneofOptions_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__OneofOptions_msg_init},
};
static const upb_MiniTableField google_protobuf_OneofDescriptorProto__fields[2] = {
@ -706,9 +706,9 @@ const upb_MiniTable google__protobuf__OneofDescriptorProto_msg_init = {
};
static const upb_MiniTableSub google_protobuf_EnumDescriptorProto_submsgs[3] = {
{.submsg = &google__protobuf__EnumValueDescriptorProto_msg_init},
{.submsg = &google__protobuf__EnumOptions_msg_init},
{.submsg = &google__protobuf__EnumDescriptorProto__EnumReservedRange_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__EnumValueDescriptorProto_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__EnumOptions_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__EnumDescriptorProto__EnumReservedRange_msg_init},
};
static const upb_MiniTableField google_protobuf_EnumDescriptorProto__fields[5] = {
@ -753,7 +753,7 @@ const upb_MiniTable google__protobuf__EnumDescriptorProto__EnumReservedRange_msg
};
static const upb_MiniTableSub google_protobuf_EnumValueDescriptorProto_submsgs[1] = {
{.submsg = &google__protobuf__EnumValueOptions_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__EnumValueOptions_msg_init},
};
static const upb_MiniTableField google_protobuf_EnumValueDescriptorProto__fields[3] = {
@ -775,8 +775,8 @@ const upb_MiniTable google__protobuf__EnumValueDescriptorProto_msg_init = {
};
static const upb_MiniTableSub google_protobuf_ServiceDescriptorProto_submsgs[2] = {
{.submsg = &google__protobuf__MethodDescriptorProto_msg_init},
{.submsg = &google__protobuf__ServiceOptions_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__MethodDescriptorProto_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__ServiceOptions_msg_init},
};
static const upb_MiniTableField google_protobuf_ServiceDescriptorProto__fields[3] = {
@ -798,7 +798,7 @@ const upb_MiniTable google__protobuf__ServiceDescriptorProto_msg_init = {
};
static const upb_MiniTableSub google_protobuf_MethodDescriptorProto_submsgs[1] = {
{.submsg = &google__protobuf__MethodOptions_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__MethodOptions_msg_init},
};
static const upb_MiniTableField google_protobuf_MethodDescriptorProto__fields[6] = {
@ -827,9 +827,9 @@ const upb_MiniTable google__protobuf__MethodDescriptorProto_msg_init = {
};
static const upb_MiniTableSub google_protobuf_FileOptions_submsgs[3] = {
{.submsg = &google__protobuf__FeatureSet_msg_init},
{.submsg = &google__protobuf__UninterpretedOption_msg_init},
{.subenum = &google_protobuf_FileOptions_OptimizeMode_enum_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__FeatureSet_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__UninterpretedOption_msg_init},
{.UPB_PRIVATE(subenum) = &google_protobuf_FileOptions_OptimizeMode_enum_init},
};
static const upb_MiniTableField google_protobuf_FileOptions__fields[22] = {
@ -898,8 +898,8 @@ const upb_MiniTable google__protobuf__FileOptions_msg_init = {
};
static const upb_MiniTableSub google_protobuf_MessageOptions_submsgs[2] = {
{.submsg = &google__protobuf__FeatureSet_msg_init},
{.submsg = &google__protobuf__UninterpretedOption_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__FeatureSet_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__UninterpretedOption_msg_init},
};
static const upb_MiniTableField google_protobuf_MessageOptions__fields[7] = {
@ -953,13 +953,13 @@ const upb_MiniTable google__protobuf__MessageOptions_msg_init = {
};
static const upb_MiniTableSub google_protobuf_FieldOptions_submsgs[7] = {
{.submsg = &google__protobuf__FieldOptions__EditionDefault_msg_init},
{.submsg = &google__protobuf__FeatureSet_msg_init},
{.submsg = &google__protobuf__UninterpretedOption_msg_init},
{.subenum = &google_protobuf_FieldOptions_CType_enum_init},
{.subenum = &google_protobuf_FieldOptions_JSType_enum_init},
{.subenum = &google_protobuf_FieldOptions_OptionRetention_enum_init},
{.subenum = &google_protobuf_FieldOptions_OptionTargetType_enum_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__FieldOptions__EditionDefault_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__FeatureSet_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__UninterpretedOption_msg_init},
{.UPB_PRIVATE(subenum) = &google_protobuf_FieldOptions_CType_enum_init},
{.UPB_PRIVATE(subenum) = &google_protobuf_FieldOptions_JSType_enum_init},
{.UPB_PRIVATE(subenum) = &google_protobuf_FieldOptions_OptionRetention_enum_init},
{.UPB_PRIVATE(subenum) = &google_protobuf_FieldOptions_OptionTargetType_enum_init},
};
static const upb_MiniTableField google_protobuf_FieldOptions__fields[13] = {
@ -1019,7 +1019,7 @@ const upb_MiniTable google__protobuf__FieldOptions_msg_init = {
};
static const upb_MiniTableSub google_protobuf_FieldOptions_EditionDefault_submsgs[1] = {
{.subenum = &google_protobuf_Edition_enum_init},
{.UPB_PRIVATE(subenum) = &google_protobuf_Edition_enum_init},
};
static const upb_MiniTableField google_protobuf_FieldOptions_EditionDefault__fields[2] = {
@ -1040,8 +1040,8 @@ const upb_MiniTable google__protobuf__FieldOptions__EditionDefault_msg_init = {
};
static const upb_MiniTableSub google_protobuf_OneofOptions_submsgs[2] = {
{.submsg = &google__protobuf__FeatureSet_msg_init},
{.submsg = &google__protobuf__UninterpretedOption_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__FeatureSet_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__UninterpretedOption_msg_init},
};
static const upb_MiniTableField google_protobuf_OneofOptions__fields[2] = {
@ -1090,8 +1090,8 @@ const upb_MiniTable google__protobuf__OneofOptions_msg_init = {
};
static const upb_MiniTableSub google_protobuf_EnumOptions_submsgs[2] = {
{.submsg = &google__protobuf__FeatureSet_msg_init},
{.submsg = &google__protobuf__UninterpretedOption_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__FeatureSet_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__UninterpretedOption_msg_init},
};
static const upb_MiniTableField google_protobuf_EnumOptions__fields[5] = {
@ -1143,8 +1143,8 @@ const upb_MiniTable google__protobuf__EnumOptions_msg_init = {
};
static const upb_MiniTableSub google_protobuf_EnumValueOptions_submsgs[2] = {
{.submsg = &google__protobuf__FeatureSet_msg_init},
{.submsg = &google__protobuf__UninterpretedOption_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__FeatureSet_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__UninterpretedOption_msg_init},
};
static const upb_MiniTableField google_protobuf_EnumValueOptions__fields[4] = {
@ -1195,8 +1195,8 @@ const upb_MiniTable google__protobuf__EnumValueOptions_msg_init = {
};
static const upb_MiniTableSub google_protobuf_ServiceOptions_submsgs[2] = {
{.submsg = &google__protobuf__FeatureSet_msg_init},
{.submsg = &google__protobuf__UninterpretedOption_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__FeatureSet_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__UninterpretedOption_msg_init},
};
static const upb_MiniTableField google_protobuf_ServiceOptions__fields[3] = {
@ -1246,9 +1246,9 @@ const upb_MiniTable google__protobuf__ServiceOptions_msg_init = {
};
static const upb_MiniTableSub google_protobuf_MethodOptions_submsgs[3] = {
{.submsg = &google__protobuf__FeatureSet_msg_init},
{.submsg = &google__protobuf__UninterpretedOption_msg_init},
{.subenum = &google_protobuf_MethodOptions_IdempotencyLevel_enum_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__FeatureSet_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__UninterpretedOption_msg_init},
{.UPB_PRIVATE(subenum) = &google_protobuf_MethodOptions_IdempotencyLevel_enum_init},
};
static const upb_MiniTableField google_protobuf_MethodOptions__fields[4] = {
@ -1299,7 +1299,7 @@ const upb_MiniTable google__protobuf__MethodOptions_msg_init = {
};
static const upb_MiniTableSub google_protobuf_UninterpretedOption_submsgs[1] = {
{.submsg = &google__protobuf__UninterpretedOption__NamePart_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__UninterpretedOption__NamePart_msg_init},
};
static const upb_MiniTableField google_protobuf_UninterpretedOption__fields[7] = {
@ -1354,12 +1354,12 @@ const upb_MiniTable google__protobuf__UninterpretedOption__NamePart_msg_init = {
};
static const upb_MiniTableSub google_protobuf_FeatureSet_submsgs[6] = {
{.subenum = &google_protobuf_FeatureSet_FieldPresence_enum_init},
{.subenum = &google_protobuf_FeatureSet_EnumType_enum_init},
{.subenum = &google_protobuf_FeatureSet_RepeatedFieldEncoding_enum_init},
{.subenum = &google_protobuf_FeatureSet_Utf8Validation_enum_init},
{.subenum = &google_protobuf_FeatureSet_MessageEncoding_enum_init},
{.subenum = &google_protobuf_FeatureSet_JsonFormat_enum_init},
{.UPB_PRIVATE(subenum) = &google_protobuf_FeatureSet_FieldPresence_enum_init},
{.UPB_PRIVATE(subenum) = &google_protobuf_FeatureSet_EnumType_enum_init},
{.UPB_PRIVATE(subenum) = &google_protobuf_FeatureSet_RepeatedFieldEncoding_enum_init},
{.UPB_PRIVATE(subenum) = &google_protobuf_FeatureSet_Utf8Validation_enum_init},
{.UPB_PRIVATE(subenum) = &google_protobuf_FeatureSet_MessageEncoding_enum_init},
{.UPB_PRIVATE(subenum) = &google_protobuf_FeatureSet_JsonFormat_enum_init},
};
static const upb_MiniTableField google_protobuf_FeatureSet__fields[6] = {
@ -1378,9 +1378,9 @@ const upb_MiniTable google__protobuf__FeatureSet_msg_init = {
};
static const upb_MiniTableSub google_protobuf_FeatureSetDefaults_submsgs[3] = {
{.submsg = &google__protobuf__FeatureSetDefaults__FeatureSetEditionDefault_msg_init},
{.subenum = &google_protobuf_Edition_enum_init},
{.subenum = &google_protobuf_Edition_enum_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__FeatureSetDefaults__FeatureSetEditionDefault_msg_init},
{.UPB_PRIVATE(subenum) = &google_protobuf_Edition_enum_init},
{.UPB_PRIVATE(subenum) = &google_protobuf_Edition_enum_init},
};
static const upb_MiniTableField google_protobuf_FeatureSetDefaults__fields[3] = {
@ -1400,8 +1400,8 @@ const upb_MiniTable google__protobuf__FeatureSetDefaults_msg_init = {
};
static const upb_MiniTableSub google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_submsgs[2] = {
{.submsg = &google__protobuf__FeatureSet_msg_init},
{.subenum = &google_protobuf_Edition_enum_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__FeatureSet_msg_init},
{.UPB_PRIVATE(subenum) = &google_protobuf_Edition_enum_init},
};
static const upb_MiniTableField google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault__fields[2] = {
@ -1422,7 +1422,7 @@ const upb_MiniTable google__protobuf__FeatureSetDefaults__FeatureSetEditionDefau
};
static const upb_MiniTableSub google_protobuf_SourceCodeInfo_submsgs[1] = {
{.submsg = &google__protobuf__SourceCodeInfo__Location_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__SourceCodeInfo__Location_msg_init},
};
static const upb_MiniTableField google_protobuf_SourceCodeInfo__fields[1] = {
@ -1464,7 +1464,7 @@ const upb_MiniTable google__protobuf__SourceCodeInfo__Location_msg_init = {
};
static const upb_MiniTableSub google_protobuf_GeneratedCodeInfo_submsgs[1] = {
{.submsg = &google__protobuf__GeneratedCodeInfo__Annotation_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__GeneratedCodeInfo__Annotation_msg_init},
};
static const upb_MiniTableField google_protobuf_GeneratedCodeInfo__fields[1] = {
@ -1482,7 +1482,7 @@ const upb_MiniTable google__protobuf__GeneratedCodeInfo_msg_init = {
};
static const upb_MiniTableSub google_protobuf_GeneratedCodeInfo_Annotation_submsgs[1] = {
{.subenum = &google_protobuf_GeneratedCodeInfo_Annotation_Semantic_enum_init},
{.UPB_PRIVATE(subenum) = &google_protobuf_GeneratedCodeInfo_Annotation_Semantic_enum_init},
};
static const upb_MiniTableField google_protobuf_GeneratedCodeInfo_Annotation__fields[5] = {
@ -5881,11 +5881,12 @@ void upb_Arena_DecRefFor(upb_Arena* arena, const void* owner) {
upb_MapInsertStatus upb_Message_InsertMapEntry(upb_Map* map,
const upb_MiniTable* mini_table,
const upb_MiniTableField* field,
const upb_MiniTableField* f,
upb_Message* map_entry_message,
upb_Arena* arena) {
// TODO: use a variant of upb_MiniTable_GetSubMessageTable() here.
const upb_MiniTable* map_entry_mini_table =
mini_table->subs[field->UPB_PRIVATE(submsg_index)].submsg;
upb_MiniTableSub_Message(mini_table->subs[f->UPB_PRIVATE(submsg_index)]);
UPB_ASSERT(map_entry_mini_table);
UPB_ASSERT(map_entry_mini_table->field_count == 2);
const upb_MiniTableField* map_entry_key_field =
@ -6016,11 +6017,12 @@ upb_Map* upb_Map_DeepClone(const upb_Map* map, upb_CType key_type,
static upb_Map* upb_Message_Map_DeepClone(const upb_Map* map,
const upb_MiniTable* mini_table,
const upb_MiniTableField* field,
const upb_MiniTableField* f,
upb_Message* clone,
upb_Arena* arena) {
// TODO: use a variant of upb_MiniTable_GetSubMessageTable() here.
const upb_MiniTable* map_entry_table =
mini_table->subs[field->UPB_PRIVATE(submsg_index)].submsg;
upb_MiniTableSub_Message(mini_table->subs[f->UPB_PRIVATE(submsg_index)]);
UPB_ASSERT(map_entry_table);
const upb_MiniTableField* key_field = &map_entry_table->fields[0];
@ -6032,7 +6034,7 @@ static upb_Map* upb_Message_Map_DeepClone(const upb_Map* map,
if (!cloned_map) {
return NULL;
}
_upb_Message_SetNonExtensionField(clone, field, &cloned_map);
_upb_Message_SetNonExtensionField(clone, f, &cloned_map);
return cloned_map;
}
@ -6168,9 +6170,9 @@ upb_Message* _upb_Message_Copy(upb_Message* dst, const upb_Message* src,
} else {
upb_Array* msg_array = (upb_Array*)msg_ext->data.ptr;
UPB_ASSERT(msg_array);
upb_Array* cloned_array =
upb_Array_DeepClone(msg_array, upb_MiniTableField_CType(field),
msg_ext->ext->UPB_PRIVATE(sub).submsg, arena);
upb_Array* cloned_array = upb_Array_DeepClone(
msg_array, upb_MiniTableField_CType(field),
upb_MiniTableExtension_GetSubMessage(msg_ext->ext), arena);
if (!cloned_array) {
return NULL;
}
@ -7206,7 +7208,7 @@ static void upb_MtDecoder_AllocateSubs(upb_MtDecoder* d,
upb_MdDecoder_CheckOutOfMemory(&d->base, subs);
uint32_t i = 0;
for (; i < sub_counts.submsg_count; i++) {
subs[i].submsg = &_kUpb_MiniTable_Empty;
subs[i].UPB_PRIVATE(submsg) = &_kUpb_MiniTable_Empty;
}
if (sub_counts.subenum_count) {
upb_MiniTableField* f = d->fields;
@ -7217,7 +7219,7 @@ static void upb_MtDecoder_AllocateSubs(upb_MtDecoder* d,
}
}
for (; i < sub_counts.submsg_count + sub_counts.subenum_count; i++) {
subs[i].subenum = NULL;
subs[i].UPB_PRIVATE(subenum) = NULL;
}
}
d->table->subs = subs;
@ -7690,6 +7692,10 @@ upb_MiniTable* _upb_MiniTable_Build(const char* data, size_t len,
}
#include <stddef.h>
#include <stdint.h>
// Must be last.
bool upb_MiniTable_SetSubMessage(upb_MiniTable* table,
@ -7725,7 +7731,7 @@ bool upb_MiniTable_SetSubMessage(upb_MiniTable* table,
// TODO: Add this assert back once YouTube is updated to not call
// this function repeatedly.
// UPB_ASSERT(table_sub->submsg == &_kUpb_MiniTable_Empty);
table_sub->submsg = sub;
*table_sub = upb_MiniTableSub_FromMessage(sub);
return true;
}
@ -7738,7 +7744,7 @@ bool upb_MiniTable_SetSubEnum(upb_MiniTable* table, upb_MiniTableField* field,
upb_MiniTableSub* table_sub =
(void*)&table->subs[field->UPB_PRIVATE(submsg_index)];
table_sub->subenum = sub;
*table_sub = upb_MiniTableSub_FromEnum(sub);
return true;
}
@ -10283,9 +10289,11 @@ void _upb_FieldDef_BuildMiniTableExtension(upb_DefBuilder* ctx,
upb_MiniTableExtension* mut_ext = (upb_MiniTableExtension*)ext;
upb_MiniTableSub sub = {NULL};
if (upb_FieldDef_IsSubMessage(f)) {
sub.submsg = upb_MessageDef_MiniTable(f->sub.msgdef);
const upb_MiniTable* submsg = upb_MessageDef_MiniTable(f->sub.msgdef);
sub = upb_MiniTableSub_FromMessage(submsg);
} else if (_upb_FieldDef_IsClosedEnum(f)) {
sub.subenum = _upb_EnumDef_MiniTable(f->sub.enumdef);
const upb_MiniTableEnum* subenum = _upb_EnumDef_MiniTable(f->sub.enumdef);
sub = upb_MiniTableSub_FromEnum(subenum);
}
bool ok2 = upb_MiniTableExtension_Init(desc.data, desc.size, mut_ext,
upb_MessageDef_MiniTable(f->msgdef),
@ -12618,6 +12626,25 @@ typedef union {
uint32_t size;
} wireval;
// Ideally these two functions should take the owning MiniTable pointer as a
// first argument, then we could just put them in mini_table/message.h as nice
// clean getters. But we don't have that so instead we gotta write these
// Frankenfunctions that take an array of subtables.
// Returns the MiniTable corresponding to a given MiniTableField
// from an array of MiniTableSubs.
static const upb_MiniTable* _upb_MiniTableSubs_MessageByField(
const upb_MiniTableSub* subs, const upb_MiniTableField* field) {
return upb_MiniTableSub_Message(subs[field->UPB_PRIVATE(submsg_index)]);
}
// Returns the MiniTableEnum corresponding to a given MiniTableField
// from an array of MiniTableSub.
static const upb_MiniTableEnum* _upb_MiniTableSubs_EnumByField(
const upb_MiniTableSub* subs, const upb_MiniTableField* field) {
return upb_MiniTableSub_Enum(subs[field->UPB_PRIVATE(submsg_index)]);
}
static const char* _upb_Decoder_DecodeMessage(upb_Decoder* d, const char* ptr,
upb_Message* msg,
const upb_MiniTable* layout);
@ -12754,7 +12781,7 @@ static upb_Message* _upb_Decoder_NewSubMessage(upb_Decoder* d,
const upb_MiniTableSub* subs,
const upb_MiniTableField* field,
upb_TaggedMessagePtr* target) {
const upb_MiniTable* subl = subs[field->UPB_PRIVATE(submsg_index)].submsg;
const upb_MiniTable* subl = _upb_MiniTableSubs_MessageByField(subs, field);
UPB_ASSERT(subl);
upb_Message* msg = _upb_Message_New(subl, &d->arena);
if (!msg) _upb_Decoder_ErrorJmp(d, kUpb_DecodeStatus_OutOfMemory);
@ -12778,7 +12805,7 @@ static upb_Message* _upb_Decoder_ReuseSubMessage(
upb_Decoder* d, const upb_MiniTableSub* subs,
const upb_MiniTableField* field, upb_TaggedMessagePtr* target) {
upb_TaggedMessagePtr tagged = *target;
const upb_MiniTable* subl = subs[field->UPB_PRIVATE(submsg_index)].submsg;
const upb_MiniTable* subl = _upb_MiniTableSubs_MessageByField(subs, field);
UPB_ASSERT(subl);
if (!upb_TaggedMessagePtr_IsEmpty(tagged) || subl == &_kUpb_MiniTable_Empty) {
return _upb_TaggedMessagePtr_GetMessage(tagged);
@ -12829,7 +12856,7 @@ static const char* _upb_Decoder_DecodeSubMessage(
upb_Decoder* d, const char* ptr, upb_Message* submsg,
const upb_MiniTableSub* subs, const upb_MiniTableField* field, int size) {
int saved_delta = upb_EpsCopyInputStream_PushLimit(&d->input, ptr, size);
const upb_MiniTable* subl = subs[field->UPB_PRIVATE(submsg_index)].submsg;
const upb_MiniTable* subl = _upb_MiniTableSubs_MessageByField(subs, field);
UPB_ASSERT(subl);
ptr = _upb_Decoder_RecurseSubMessage(d, ptr, submsg, subl, DECODE_NOGROUP);
upb_EpsCopyInputStream_PopLimit(&d->input, ptr, saved_delta);
@ -12860,7 +12887,7 @@ UPB_FORCEINLINE
static const char* _upb_Decoder_DecodeKnownGroup(
upb_Decoder* d, const char* ptr, upb_Message* submsg,
const upb_MiniTableSub* subs, const upb_MiniTableField* field) {
const upb_MiniTable* subl = subs[field->UPB_PRIVATE(submsg_index)].submsg;
const upb_MiniTable* subl = _upb_MiniTableSubs_MessageByField(subs, field);
UPB_ASSERT(subl);
return _upb_Decoder_DecodeGroup(d, ptr, submsg, subl, field->number);
}
@ -12913,7 +12940,7 @@ static const char* _upb_Decoder_DecodeEnumArray(upb_Decoder* d, const char* ptr,
const upb_MiniTableSub* subs,
const upb_MiniTableField* field,
wireval* val) {
const upb_MiniTableEnum* e = subs[field->UPB_PRIVATE(submsg_index)].subenum;
const upb_MiniTableEnum* e = _upb_MiniTableSubs_EnumByField(subs, field);
if (!_upb_Decoder_CheckEnum(d, ptr, msg, e, field, val)) return ptr;
void* mem = UPB_PTR_AT(_upb_array_ptr(arr), arr->size * 4, void);
arr->size++;
@ -12984,7 +13011,7 @@ static const char* _upb_Decoder_DecodeEnumPacked(
upb_Decoder* d, const char* ptr, upb_Message* msg, upb_Array* arr,
const upb_MiniTableSub* subs, const upb_MiniTableField* field,
wireval* val) {
const upb_MiniTableEnum* e = subs[field->UPB_PRIVATE(submsg_index)].subenum;
const upb_MiniTableEnum* e = _upb_MiniTableSubs_EnumByField(subs, field);
int saved_limit = upb_EpsCopyInputStream_PushLimit(&d->input, ptr, val->size);
char* out = UPB_PTR_AT(_upb_array_ptr(arr), arr->size * 4, void);
while (!_upb_Decoder_IsDone(d, &ptr)) {
@ -13124,7 +13151,7 @@ static const char* _upb_Decoder_DecodeToMap(upb_Decoder* d, const char* ptr,
upb_Map* map = *map_p;
upb_MapEntry ent;
UPB_ASSERT(upb_MiniTableField_Type(field) == kUpb_FieldType_Message);
const upb_MiniTable* entry = subs[field->UPB_PRIVATE(submsg_index)].submsg;
const upb_MiniTable* entry = _upb_MiniTableSubs_MessageByField(subs, field);
UPB_ASSERT(entry);
UPB_ASSERT(entry->field_count == 2);
@ -13184,7 +13211,7 @@ static const char* _upb_Decoder_DecodeToSubMessage(
if (UPB_UNLIKELY(op == kUpb_DecodeOp_Enum) &&
!_upb_Decoder_CheckEnum(d, ptr, msg,
subs[field->UPB_PRIVATE(submsg_index)].subenum,
_upb_MiniTableSubs_EnumByField(subs, field),
field, val)) {
return ptr;
}
@ -13502,9 +13529,10 @@ static void _upb_Decoder_CheckUnlinked(upb_Decoder* d, const upb_MiniTable* mt,
int* op) {
// If sub-message is not linked, treat as unknown.
if (field->mode & kUpb_LabelFlags_IsExtension) return;
const upb_MiniTableSub* sub = &mt->subs[field->UPB_PRIVATE(submsg_index)];
const upb_MiniTable* mt_sub =
_upb_MiniTableSubs_MessageByField(mt->subs, field);
if ((d->options & kUpb_DecodeOption_ExperimentalAllowUnlinked) ||
sub->submsg != &_kUpb_MiniTable_Empty) {
mt_sub != &_kUpb_MiniTable_Empty) {
return;
}
#ifndef NDEBUG
@ -14784,7 +14812,8 @@ static const char* fastdecode_tosubmsg(upb_EpsCopyInputStream* e,
upb_Message** dst; \
uint32_t submsg_idx = (data >> 16) & 0xff; \
const upb_MiniTable* tablep = decode_totablep(table); \
const upb_MiniTable* subtablep = tablep->subs[submsg_idx].submsg; \
const upb_MiniTable* subtablep = \
upb_MiniTableSub_Message(tablep->subs[submsg_idx]); \
fastdecode_submsgdata submsg = {decode_totable(subtablep)}; \
fastdecode_arr farr; \
\
@ -15108,7 +15137,8 @@ static void encode_scalar(upb_encstate* e, const void* _field_mem,
case kUpb_FieldType_Group: {
size_t size;
upb_TaggedMessagePtr submsg = *(upb_TaggedMessagePtr*)field_mem;
const upb_MiniTable* subm = subs[f->UPB_PRIVATE(submsg_index)].submsg;
const upb_MiniTable* subm =
upb_MiniTableSub_Message(subs[f->UPB_PRIVATE(submsg_index)]);
if (submsg == 0) {
return;
}
@ -15122,7 +15152,8 @@ static void encode_scalar(upb_encstate* e, const void* _field_mem,
case kUpb_FieldType_Message: {
size_t size;
upb_TaggedMessagePtr submsg = *(upb_TaggedMessagePtr*)field_mem;
const upb_MiniTable* subm = subs[f->UPB_PRIVATE(submsg_index)].submsg;
const upb_MiniTable* subm =
upb_MiniTableSub_Message(subs[f->UPB_PRIVATE(submsg_index)]);
if (submsg == 0) {
return;
}
@ -15211,7 +15242,8 @@ static void encode_array(upb_encstate* e, const upb_Message* msg,
case kUpb_FieldType_Group: {
const upb_TaggedMessagePtr* start = _upb_array_constptr(arr);
const upb_TaggedMessagePtr* ptr = start + arr->size;
const upb_MiniTable* subm = subs[f->UPB_PRIVATE(submsg_index)].submsg;
const upb_MiniTable* subm =
upb_MiniTableSub_Message(subs[f->UPB_PRIVATE(submsg_index)]);
if (--e->depth == 0) encode_err(e, kUpb_EncodeStatus_MaxDepthExceeded);
do {
size_t size;
@ -15226,7 +15258,8 @@ static void encode_array(upb_encstate* e, const upb_Message* msg,
case kUpb_FieldType_Message: {
const upb_TaggedMessagePtr* start = _upb_array_constptr(arr);
const upb_TaggedMessagePtr* ptr = start + arr->size;
const upb_MiniTable* subm = subs[f->UPB_PRIVATE(submsg_index)].submsg;
const upb_MiniTable* subm =
upb_MiniTableSub_Message(subs[f->UPB_PRIVATE(submsg_index)]);
if (--e->depth == 0) encode_err(e, kUpb_EncodeStatus_MaxDepthExceeded);
do {
size_t size;
@ -15265,7 +15298,8 @@ static void encode_map(upb_encstate* e, const upb_Message* msg,
const upb_MiniTableSub* subs,
const upb_MiniTableField* f) {
const upb_Map* map = *UPB_PTR_AT(msg, f->offset, const upb_Map*);
const upb_MiniTable* layout = subs[f->UPB_PRIVATE(submsg_index)].submsg;
const upb_MiniTable* layout =
upb_MiniTableSub_Message(subs[f->UPB_PRIVATE(submsg_index)]);
UPB_ASSERT(layout->field_count == 2);
if (map == NULL) return;

@ -738,8 +738,8 @@ UPB_API_INLINE upb_Arena* upb_Arena_New(void) {
#include <stdint.h>
#ifndef UPB_MINI_TABLE_TYPES_H_
#define UPB_MINI_TABLE_TYPES_H_
#ifndef UPB_MINI_TABLE_TAGGED_PTR_H_
#define UPB_MINI_TABLE_TAGGED_PTR_H_
#include <stdint.h>
@ -755,10 +755,6 @@ typedef void upb_Message;
// Must be last.
#ifdef __cplusplus
extern "C" {
#endif
// When a upb_Message* is stored in a message, array, or map, it is stored in a
// tagged form. If the tag bit is set, the referenced upb_Message is of type
// _kUpb_MiniTable_Empty (a sentinel message type with no fields) instead of
@ -767,8 +763,13 @@ extern "C" {
//
// See the documentation for kUpb_DecodeOption_ExperimentalAllowUnlinked for
// more information.
typedef uintptr_t upb_TaggedMessagePtr;
#ifdef __cplusplus
extern "C" {
#endif
// Internal-only because empty messages cannot be created by the user.
UPB_INLINE upb_TaggedMessagePtr _upb_TaggedMessagePtr_Pack(upb_Message* ptr,
bool empty) {
@ -805,7 +806,7 @@ UPB_INLINE upb_Message* _upb_TaggedMessagePtr_GetEmptyMessage(
#endif
#endif /* UPB_MINI_TABLE_TYPES_H_ */
#endif /* UPB_MINI_TABLE_TAGGED_PTR_H_ */
typedef union {
bool bool_val;
@ -1380,21 +1381,96 @@ UPB_INLINE uint64_t upb_MiniTable_requiredmask(const struct upb_MiniTable* l) {
#endif /* UPB_MINI_TABLE_INTERNAL_MESSAGE_H_ */
#ifndef UPB_MINI_TABLE_SUB_H_
#define UPB_MINI_TABLE_SUB_H_
#ifndef UPB_MINI_TABLE_INTERNAL_SUB_H_
#define UPB_MINI_TABLE_INTERNAL_SUB_H_
// Must be last.
union upb_MiniTableSub {
const struct upb_MiniTable* submsg;
const struct upb_MiniTableEnum* subenum;
const struct upb_MiniTable* UPB_PRIVATE(submsg);
const struct 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;
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;
out.UPB_PRIVATE(submsg) = submsg;
return out;
}
UPB_INLINE const struct upb_MiniTableEnum* UPB_PRIVATE(_upb_MiniTableSub_Enum)(
const union upb_MiniTableSub sub) {
return sub.UPB_PRIVATE(subenum);
}
UPB_INLINE const struct upb_MiniTable* UPB_PRIVATE(_upb_MiniTableSub_Message)(
const union upb_MiniTableSub sub) {
return sub.UPB_PRIVATE(submsg);
}
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* UPB_MINI_TABLE_INTERNAL_SUB_H_ */
// Must be last.
typedef union upb_MiniTableSub upb_MiniTableSub;
#ifdef __cplusplus
extern "C" {
#endif
// Constructors
UPB_API_INLINE upb_MiniTableSub
upb_MiniTableSub_FromEnum(const struct upb_MiniTableEnum* subenum) {
return UPB_PRIVATE(_upb_MiniTableSub_FromEnum)(subenum);
}
UPB_API_INLINE upb_MiniTableSub
upb_MiniTableSub_FromMessage(const struct upb_MiniTable* submsg) {
return UPB_PRIVATE(_upb_MiniTableSub_FromMessage)(submsg);
}
// Getters
UPB_API_INLINE const struct 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_MiniTableSub sub) {
return UPB_PRIVATE(_upb_MiniTableSub_Message)(sub);
}
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* UPB_MINI_TABLE_SUB_H_ */
// Must be last.
#ifdef __cplusplus
extern "C" {
#endif
@ -1414,8 +1490,8 @@ UPB_API_INLINE const upb_MiniTableField* upb_MiniTable_GetFieldByIndex(
UPB_API_INLINE const upb_MiniTable* upb_MiniTable_GetSubMessageTable(
const upb_MiniTable* mini_table, const upb_MiniTableField* field) {
UPB_ASSERT(upb_MiniTableField_CType(field) == kUpb_CType_Message);
const upb_MiniTable* ret =
mini_table->subs[field->UPB_PRIVATE(submsg_index)].submsg;
const upb_MiniTable* ret = upb_MiniTableSub_Message(
mini_table->subs[field->UPB_PRIVATE(submsg_index)]);
UPB_ASSUME(ret);
return ret == &_kUpb_MiniTable_Empty ? NULL : ret;
}
@ -1423,9 +1499,9 @@ UPB_API_INLINE const upb_MiniTable* upb_MiniTable_GetSubMessageTable(
// Returns the MiniTableEnum for this enum field. If the field is unlinked,
// returns NULL.
UPB_API_INLINE const upb_MiniTableEnum* upb_MiniTable_GetSubEnumTable(
const upb_MiniTable* mini_table, const upb_MiniTableField* field) {
UPB_ASSERT(upb_MiniTableField_CType(field) == kUpb_CType_Enum);
return mini_table->subs[field->UPB_PRIVATE(submsg_index)].subenum;
const upb_MiniTable* mini_table, const upb_MiniTableField* f) {
UPB_ASSERT(upb_MiniTableField_CType(f) == kUpb_CType_Enum);
return upb_MiniTableSub_Enum(mini_table->subs[f->UPB_PRIVATE(submsg_index)]);
}
// Returns true if this MiniTable field is linked to a MiniTable for the
@ -1533,12 +1609,12 @@ UPB_INLINE uint32_t UPB_PRIVATE(_upb_MiniTableExtension_Number)(
UPB_INLINE const struct upb_MiniTable* UPB_PRIVATE(
_upb_MiniTableExtension_GetSubMessage)(
const struct upb_MiniTableExtension* e) {
return e->UPB_PRIVATE(sub).submsg;
return e->UPB_PRIVATE(sub).UPB_PRIVATE(submsg);
}
UPB_INLINE void UPB_PRIVATE(_upb_MiniTableExtension_SetSubMessage)(
struct upb_MiniTableExtension* e, const struct upb_MiniTable* m) {
e->UPB_PRIVATE(sub).submsg = m;
e->UPB_PRIVATE(sub).UPB_PRIVATE(submsg) = m;
}
#ifdef __cplusplus
@ -3135,7 +3211,8 @@ UPB_API_INLINE void _upb_Message_SetTaggedMessagePtr(
UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(field) ==
UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte));
UPB_ASSUME(upb_MiniTableField_IsScalar(field));
UPB_ASSERT(mini_table->subs[field->UPB_PRIVATE(submsg_index)].submsg);
UPB_ASSERT(upb_MiniTableSub_Message(
mini_table->subs[field->UPB_PRIVATE(submsg_index)]));
_upb_Message_SetNonExtensionField(msg, field, &sub_message);
}
@ -3154,8 +3231,8 @@ UPB_API_INLINE upb_Message* upb_Message_GetOrCreateMutableMessage(
UPB_ASSUME(upb_MiniTableField_CType(field) == kUpb_CType_Message);
upb_Message* sub_message = *UPB_PTR_AT(msg, field->offset, upb_Message*);
if (!sub_message) {
const upb_MiniTable* sub_mini_table =
mini_table->subs[field->UPB_PRIVATE(submsg_index)].submsg;
const upb_MiniTable* sub_mini_table = upb_MiniTableSub_Message(
mini_table->subs[field->UPB_PRIVATE(submsg_index)]);
UPB_ASSERT(sub_mini_table);
sub_message = _upb_Message_New(sub_mini_table, arena);
*UPB_PTR_AT(msg, field->offset, upb_Message*) = sub_message;
@ -3306,14 +3383,6 @@ UPB_INLINE void _upb_msg_map_set_value(void* msg, const void* val,
#define UPB_MINI_TABLE_DECODE_H_
#ifndef UPB_MINI_TABLE_SUB_H_
#define UPB_MINI_TABLE_SUB_H_
typedef union upb_MiniTableSub upb_MiniTableSub;
#endif /* UPB_MINI_TABLE_INTERNAL_SUB_H_ */
// Export the newer headers, for legacy users. New users should include the
// more specific headers directly.
// IWYU pragma: begin_exports
@ -3473,8 +3542,7 @@ UPB_API upb_MiniTableExtension* _upb_MiniTableExtension_Build(
UPB_API_INLINE upb_MiniTableExtension* upb_MiniTableExtension_Build(
const char* data, size_t len, const upb_MiniTable* extendee,
upb_Arena* arena, upb_Status* status) {
upb_MiniTableSub sub;
sub.submsg = NULL;
upb_MiniTableSub sub = upb_MiniTableSub_FromMessage(NULL);
return _upb_MiniTableExtension_Build(
data, len, extendee, sub, kUpb_MiniTablePlatform_Native, arena, status);
}
@ -3482,8 +3550,7 @@ UPB_API_INLINE upb_MiniTableExtension* upb_MiniTableExtension_Build(
UPB_API_INLINE upb_MiniTableExtension* upb_MiniTableExtension_BuildMessage(
const char* data, size_t len, const upb_MiniTable* extendee,
upb_MiniTable* submsg, upb_Arena* arena, upb_Status* status) {
upb_MiniTableSub sub;
sub.submsg = submsg;
upb_MiniTableSub sub = upb_MiniTableSub_FromMessage(submsg);
return _upb_MiniTableExtension_Build(
data, len, extendee, sub, kUpb_MiniTablePlatform_Native, arena, status);
}
@ -3491,8 +3558,7 @@ UPB_API_INLINE upb_MiniTableExtension* upb_MiniTableExtension_BuildMessage(
UPB_API_INLINE upb_MiniTableExtension* upb_MiniTableExtension_BuildEnum(
const char* data, size_t len, const upb_MiniTable* extendee,
upb_MiniTableEnum* subenum, upb_Arena* arena, upb_Status* status) {
upb_MiniTableSub sub;
sub.subenum = subenum;
upb_MiniTableSub sub = upb_MiniTableSub_FromEnum(subenum);
return _upb_MiniTableExtension_Build(
data, len, extendee, sub, kUpb_MiniTablePlatform_Native, arena, status);
}

@ -392,7 +392,7 @@ void upb_Status_VAppendErrorFormat(upb_Status* status, const char* fmt,
// Must be last.
static const upb_MiniTableSub google_protobuf_FileDescriptorSet_submsgs[1] = {
{.submsg = &google__protobuf__FileDescriptorProto_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__FileDescriptorProto_msg_init},
};
static const upb_MiniTableField google_protobuf_FileDescriptorSet__fields[1] = {
@ -410,13 +410,13 @@ const upb_MiniTable google__protobuf__FileDescriptorSet_msg_init = {
};
static const upb_MiniTableSub google_protobuf_FileDescriptorProto_submsgs[7] = {
{.submsg = &google__protobuf__DescriptorProto_msg_init},
{.submsg = &google__protobuf__EnumDescriptorProto_msg_init},
{.submsg = &google__protobuf__ServiceDescriptorProto_msg_init},
{.submsg = &google__protobuf__FieldDescriptorProto_msg_init},
{.submsg = &google__protobuf__FileOptions_msg_init},
{.submsg = &google__protobuf__SourceCodeInfo_msg_init},
{.subenum = &google_protobuf_Edition_enum_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__DescriptorProto_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__EnumDescriptorProto_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__ServiceDescriptorProto_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__FieldDescriptorProto_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__FileOptions_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__SourceCodeInfo_msg_init},
{.UPB_PRIVATE(subenum) = &google_protobuf_Edition_enum_init},
};
static const upb_MiniTableField google_protobuf_FileDescriptorProto__fields[13] = {
@ -460,14 +460,14 @@ const upb_MiniTable google__protobuf__FileDescriptorProto_msg_init = {
};
static const upb_MiniTableSub google_protobuf_DescriptorProto_submsgs[8] = {
{.submsg = &google__protobuf__FieldDescriptorProto_msg_init},
{.submsg = &google__protobuf__DescriptorProto_msg_init},
{.submsg = &google__protobuf__EnumDescriptorProto_msg_init},
{.submsg = &google__protobuf__DescriptorProto__ExtensionRange_msg_init},
{.submsg = &google__protobuf__FieldDescriptorProto_msg_init},
{.submsg = &google__protobuf__MessageOptions_msg_init},
{.submsg = &google__protobuf__OneofDescriptorProto_msg_init},
{.submsg = &google__protobuf__DescriptorProto__ReservedRange_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__FieldDescriptorProto_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__DescriptorProto_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__EnumDescriptorProto_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__DescriptorProto__ExtensionRange_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__FieldDescriptorProto_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__MessageOptions_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__OneofDescriptorProto_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__DescriptorProto__ReservedRange_msg_init},
};
static const upb_MiniTableField google_protobuf_DescriptorProto__fields[10] = {
@ -508,7 +508,7 @@ const upb_MiniTable google__protobuf__DescriptorProto_msg_init = {
};
static const upb_MiniTableSub google_protobuf_DescriptorProto_ExtensionRange_submsgs[1] = {
{.submsg = &google__protobuf__ExtensionRangeOptions_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__ExtensionRangeOptions_msg_init},
};
static const upb_MiniTableField google_protobuf_DescriptorProto_ExtensionRange__fields[3] = {
@ -547,10 +547,10 @@ const upb_MiniTable google__protobuf__DescriptorProto__ReservedRange_msg_init =
};
static const upb_MiniTableSub google_protobuf_ExtensionRangeOptions_submsgs[4] = {
{.submsg = &google__protobuf__ExtensionRangeOptions__Declaration_msg_init},
{.submsg = &google__protobuf__FeatureSet_msg_init},
{.submsg = &google__protobuf__UninterpretedOption_msg_init},
{.subenum = &google_protobuf_ExtensionRangeOptions_VerificationState_enum_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__ExtensionRangeOptions__Declaration_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__FeatureSet_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__UninterpretedOption_msg_init},
{.UPB_PRIVATE(subenum) = &google_protobuf_ExtensionRangeOptions_VerificationState_enum_init},
};
static const upb_MiniTableField google_protobuf_ExtensionRangeOptions__fields[4] = {
@ -625,9 +625,9 @@ const upb_MiniTable google__protobuf__ExtensionRangeOptions__Declaration_msg_ini
};
static const upb_MiniTableSub google_protobuf_FieldDescriptorProto_submsgs[3] = {
{.submsg = &google__protobuf__FieldOptions_msg_init},
{.subenum = &google_protobuf_FieldDescriptorProto_Label_enum_init},
{.subenum = &google_protobuf_FieldDescriptorProto_Type_enum_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__FieldOptions_msg_init},
{.UPB_PRIVATE(subenum) = &google_protobuf_FieldDescriptorProto_Label_enum_init},
{.UPB_PRIVATE(subenum) = &google_protobuf_FieldDescriptorProto_Type_enum_init},
};
static const upb_MiniTableField google_protobuf_FieldDescriptorProto__fields[11] = {
@ -685,7 +685,7 @@ const upb_MiniTable google__protobuf__FieldDescriptorProto_msg_init = {
};
static const upb_MiniTableSub google_protobuf_OneofDescriptorProto_submsgs[1] = {
{.submsg = &google__protobuf__OneofOptions_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__OneofOptions_msg_init},
};
static const upb_MiniTableField google_protobuf_OneofDescriptorProto__fields[2] = {
@ -706,9 +706,9 @@ const upb_MiniTable google__protobuf__OneofDescriptorProto_msg_init = {
};
static const upb_MiniTableSub google_protobuf_EnumDescriptorProto_submsgs[3] = {
{.submsg = &google__protobuf__EnumValueDescriptorProto_msg_init},
{.submsg = &google__protobuf__EnumOptions_msg_init},
{.submsg = &google__protobuf__EnumDescriptorProto__EnumReservedRange_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__EnumValueDescriptorProto_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__EnumOptions_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__EnumDescriptorProto__EnumReservedRange_msg_init},
};
static const upb_MiniTableField google_protobuf_EnumDescriptorProto__fields[5] = {
@ -753,7 +753,7 @@ const upb_MiniTable google__protobuf__EnumDescriptorProto__EnumReservedRange_msg
};
static const upb_MiniTableSub google_protobuf_EnumValueDescriptorProto_submsgs[1] = {
{.submsg = &google__protobuf__EnumValueOptions_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__EnumValueOptions_msg_init},
};
static const upb_MiniTableField google_protobuf_EnumValueDescriptorProto__fields[3] = {
@ -775,8 +775,8 @@ const upb_MiniTable google__protobuf__EnumValueDescriptorProto_msg_init = {
};
static const upb_MiniTableSub google_protobuf_ServiceDescriptorProto_submsgs[2] = {
{.submsg = &google__protobuf__MethodDescriptorProto_msg_init},
{.submsg = &google__protobuf__ServiceOptions_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__MethodDescriptorProto_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__ServiceOptions_msg_init},
};
static const upb_MiniTableField google_protobuf_ServiceDescriptorProto__fields[3] = {
@ -798,7 +798,7 @@ const upb_MiniTable google__protobuf__ServiceDescriptorProto_msg_init = {
};
static const upb_MiniTableSub google_protobuf_MethodDescriptorProto_submsgs[1] = {
{.submsg = &google__protobuf__MethodOptions_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__MethodOptions_msg_init},
};
static const upb_MiniTableField google_protobuf_MethodDescriptorProto__fields[6] = {
@ -827,9 +827,9 @@ const upb_MiniTable google__protobuf__MethodDescriptorProto_msg_init = {
};
static const upb_MiniTableSub google_protobuf_FileOptions_submsgs[3] = {
{.submsg = &google__protobuf__FeatureSet_msg_init},
{.submsg = &google__protobuf__UninterpretedOption_msg_init},
{.subenum = &google_protobuf_FileOptions_OptimizeMode_enum_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__FeatureSet_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__UninterpretedOption_msg_init},
{.UPB_PRIVATE(subenum) = &google_protobuf_FileOptions_OptimizeMode_enum_init},
};
static const upb_MiniTableField google_protobuf_FileOptions__fields[22] = {
@ -898,8 +898,8 @@ const upb_MiniTable google__protobuf__FileOptions_msg_init = {
};
static const upb_MiniTableSub google_protobuf_MessageOptions_submsgs[2] = {
{.submsg = &google__protobuf__FeatureSet_msg_init},
{.submsg = &google__protobuf__UninterpretedOption_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__FeatureSet_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__UninterpretedOption_msg_init},
};
static const upb_MiniTableField google_protobuf_MessageOptions__fields[7] = {
@ -953,13 +953,13 @@ const upb_MiniTable google__protobuf__MessageOptions_msg_init = {
};
static const upb_MiniTableSub google_protobuf_FieldOptions_submsgs[7] = {
{.submsg = &google__protobuf__FieldOptions__EditionDefault_msg_init},
{.submsg = &google__protobuf__FeatureSet_msg_init},
{.submsg = &google__protobuf__UninterpretedOption_msg_init},
{.subenum = &google_protobuf_FieldOptions_CType_enum_init},
{.subenum = &google_protobuf_FieldOptions_JSType_enum_init},
{.subenum = &google_protobuf_FieldOptions_OptionRetention_enum_init},
{.subenum = &google_protobuf_FieldOptions_OptionTargetType_enum_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__FieldOptions__EditionDefault_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__FeatureSet_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__UninterpretedOption_msg_init},
{.UPB_PRIVATE(subenum) = &google_protobuf_FieldOptions_CType_enum_init},
{.UPB_PRIVATE(subenum) = &google_protobuf_FieldOptions_JSType_enum_init},
{.UPB_PRIVATE(subenum) = &google_protobuf_FieldOptions_OptionRetention_enum_init},
{.UPB_PRIVATE(subenum) = &google_protobuf_FieldOptions_OptionTargetType_enum_init},
};
static const upb_MiniTableField google_protobuf_FieldOptions__fields[13] = {
@ -1019,7 +1019,7 @@ const upb_MiniTable google__protobuf__FieldOptions_msg_init = {
};
static const upb_MiniTableSub google_protobuf_FieldOptions_EditionDefault_submsgs[1] = {
{.subenum = &google_protobuf_Edition_enum_init},
{.UPB_PRIVATE(subenum) = &google_protobuf_Edition_enum_init},
};
static const upb_MiniTableField google_protobuf_FieldOptions_EditionDefault__fields[2] = {
@ -1040,8 +1040,8 @@ const upb_MiniTable google__protobuf__FieldOptions__EditionDefault_msg_init = {
};
static const upb_MiniTableSub google_protobuf_OneofOptions_submsgs[2] = {
{.submsg = &google__protobuf__FeatureSet_msg_init},
{.submsg = &google__protobuf__UninterpretedOption_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__FeatureSet_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__UninterpretedOption_msg_init},
};
static const upb_MiniTableField google_protobuf_OneofOptions__fields[2] = {
@ -1090,8 +1090,8 @@ const upb_MiniTable google__protobuf__OneofOptions_msg_init = {
};
static const upb_MiniTableSub google_protobuf_EnumOptions_submsgs[2] = {
{.submsg = &google__protobuf__FeatureSet_msg_init},
{.submsg = &google__protobuf__UninterpretedOption_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__FeatureSet_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__UninterpretedOption_msg_init},
};
static const upb_MiniTableField google_protobuf_EnumOptions__fields[5] = {
@ -1143,8 +1143,8 @@ const upb_MiniTable google__protobuf__EnumOptions_msg_init = {
};
static const upb_MiniTableSub google_protobuf_EnumValueOptions_submsgs[2] = {
{.submsg = &google__protobuf__FeatureSet_msg_init},
{.submsg = &google__protobuf__UninterpretedOption_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__FeatureSet_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__UninterpretedOption_msg_init},
};
static const upb_MiniTableField google_protobuf_EnumValueOptions__fields[4] = {
@ -1195,8 +1195,8 @@ const upb_MiniTable google__protobuf__EnumValueOptions_msg_init = {
};
static const upb_MiniTableSub google_protobuf_ServiceOptions_submsgs[2] = {
{.submsg = &google__protobuf__FeatureSet_msg_init},
{.submsg = &google__protobuf__UninterpretedOption_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__FeatureSet_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__UninterpretedOption_msg_init},
};
static const upb_MiniTableField google_protobuf_ServiceOptions__fields[3] = {
@ -1246,9 +1246,9 @@ const upb_MiniTable google__protobuf__ServiceOptions_msg_init = {
};
static const upb_MiniTableSub google_protobuf_MethodOptions_submsgs[3] = {
{.submsg = &google__protobuf__FeatureSet_msg_init},
{.submsg = &google__protobuf__UninterpretedOption_msg_init},
{.subenum = &google_protobuf_MethodOptions_IdempotencyLevel_enum_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__FeatureSet_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__UninterpretedOption_msg_init},
{.UPB_PRIVATE(subenum) = &google_protobuf_MethodOptions_IdempotencyLevel_enum_init},
};
static const upb_MiniTableField google_protobuf_MethodOptions__fields[4] = {
@ -1299,7 +1299,7 @@ const upb_MiniTable google__protobuf__MethodOptions_msg_init = {
};
static const upb_MiniTableSub google_protobuf_UninterpretedOption_submsgs[1] = {
{.submsg = &google__protobuf__UninterpretedOption__NamePart_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__UninterpretedOption__NamePart_msg_init},
};
static const upb_MiniTableField google_protobuf_UninterpretedOption__fields[7] = {
@ -1354,12 +1354,12 @@ const upb_MiniTable google__protobuf__UninterpretedOption__NamePart_msg_init = {
};
static const upb_MiniTableSub google_protobuf_FeatureSet_submsgs[6] = {
{.subenum = &google_protobuf_FeatureSet_FieldPresence_enum_init},
{.subenum = &google_protobuf_FeatureSet_EnumType_enum_init},
{.subenum = &google_protobuf_FeatureSet_RepeatedFieldEncoding_enum_init},
{.subenum = &google_protobuf_FeatureSet_Utf8Validation_enum_init},
{.subenum = &google_protobuf_FeatureSet_MessageEncoding_enum_init},
{.subenum = &google_protobuf_FeatureSet_JsonFormat_enum_init},
{.UPB_PRIVATE(subenum) = &google_protobuf_FeatureSet_FieldPresence_enum_init},
{.UPB_PRIVATE(subenum) = &google_protobuf_FeatureSet_EnumType_enum_init},
{.UPB_PRIVATE(subenum) = &google_protobuf_FeatureSet_RepeatedFieldEncoding_enum_init},
{.UPB_PRIVATE(subenum) = &google_protobuf_FeatureSet_Utf8Validation_enum_init},
{.UPB_PRIVATE(subenum) = &google_protobuf_FeatureSet_MessageEncoding_enum_init},
{.UPB_PRIVATE(subenum) = &google_protobuf_FeatureSet_JsonFormat_enum_init},
};
static const upb_MiniTableField google_protobuf_FeatureSet__fields[6] = {
@ -1378,9 +1378,9 @@ const upb_MiniTable google__protobuf__FeatureSet_msg_init = {
};
static const upb_MiniTableSub google_protobuf_FeatureSetDefaults_submsgs[3] = {
{.submsg = &google__protobuf__FeatureSetDefaults__FeatureSetEditionDefault_msg_init},
{.subenum = &google_protobuf_Edition_enum_init},
{.subenum = &google_protobuf_Edition_enum_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__FeatureSetDefaults__FeatureSetEditionDefault_msg_init},
{.UPB_PRIVATE(subenum) = &google_protobuf_Edition_enum_init},
{.UPB_PRIVATE(subenum) = &google_protobuf_Edition_enum_init},
};
static const upb_MiniTableField google_protobuf_FeatureSetDefaults__fields[3] = {
@ -1400,8 +1400,8 @@ const upb_MiniTable google__protobuf__FeatureSetDefaults_msg_init = {
};
static const upb_MiniTableSub google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_submsgs[2] = {
{.submsg = &google__protobuf__FeatureSet_msg_init},
{.subenum = &google_protobuf_Edition_enum_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__FeatureSet_msg_init},
{.UPB_PRIVATE(subenum) = &google_protobuf_Edition_enum_init},
};
static const upb_MiniTableField google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault__fields[2] = {
@ -1422,7 +1422,7 @@ const upb_MiniTable google__protobuf__FeatureSetDefaults__FeatureSetEditionDefau
};
static const upb_MiniTableSub google_protobuf_SourceCodeInfo_submsgs[1] = {
{.submsg = &google__protobuf__SourceCodeInfo__Location_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__SourceCodeInfo__Location_msg_init},
};
static const upb_MiniTableField google_protobuf_SourceCodeInfo__fields[1] = {
@ -1464,7 +1464,7 @@ const upb_MiniTable google__protobuf__SourceCodeInfo__Location_msg_init = {
};
static const upb_MiniTableSub google_protobuf_GeneratedCodeInfo_submsgs[1] = {
{.submsg = &google__protobuf__GeneratedCodeInfo__Annotation_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__GeneratedCodeInfo__Annotation_msg_init},
};
static const upb_MiniTableField google_protobuf_GeneratedCodeInfo__fields[1] = {
@ -1482,7 +1482,7 @@ const upb_MiniTable google__protobuf__GeneratedCodeInfo_msg_init = {
};
static const upb_MiniTableSub google_protobuf_GeneratedCodeInfo_Annotation_submsgs[1] = {
{.subenum = &google_protobuf_GeneratedCodeInfo_Annotation_Semantic_enum_init},
{.UPB_PRIVATE(subenum) = &google_protobuf_GeneratedCodeInfo_Annotation_Semantic_enum_init},
};
static const upb_MiniTableField google_protobuf_GeneratedCodeInfo_Annotation__fields[5] = {
@ -5396,11 +5396,12 @@ void upb_Arena_DecRefFor(upb_Arena* arena, const void* owner) {
upb_MapInsertStatus upb_Message_InsertMapEntry(upb_Map* map,
const upb_MiniTable* mini_table,
const upb_MiniTableField* field,
const upb_MiniTableField* f,
upb_Message* map_entry_message,
upb_Arena* arena) {
// TODO: use a variant of upb_MiniTable_GetSubMessageTable() here.
const upb_MiniTable* map_entry_mini_table =
mini_table->subs[field->UPB_PRIVATE(submsg_index)].submsg;
upb_MiniTableSub_Message(mini_table->subs[f->UPB_PRIVATE(submsg_index)]);
UPB_ASSERT(map_entry_mini_table);
UPB_ASSERT(map_entry_mini_table->field_count == 2);
const upb_MiniTableField* map_entry_key_field =
@ -5531,11 +5532,12 @@ upb_Map* upb_Map_DeepClone(const upb_Map* map, upb_CType key_type,
static upb_Map* upb_Message_Map_DeepClone(const upb_Map* map,
const upb_MiniTable* mini_table,
const upb_MiniTableField* field,
const upb_MiniTableField* f,
upb_Message* clone,
upb_Arena* arena) {
// TODO: use a variant of upb_MiniTable_GetSubMessageTable() here.
const upb_MiniTable* map_entry_table =
mini_table->subs[field->UPB_PRIVATE(submsg_index)].submsg;
upb_MiniTableSub_Message(mini_table->subs[f->UPB_PRIVATE(submsg_index)]);
UPB_ASSERT(map_entry_table);
const upb_MiniTableField* key_field = &map_entry_table->fields[0];
@ -5547,7 +5549,7 @@ static upb_Map* upb_Message_Map_DeepClone(const upb_Map* map,
if (!cloned_map) {
return NULL;
}
_upb_Message_SetNonExtensionField(clone, field, &cloned_map);
_upb_Message_SetNonExtensionField(clone, f, &cloned_map);
return cloned_map;
}
@ -5683,9 +5685,9 @@ upb_Message* _upb_Message_Copy(upb_Message* dst, const upb_Message* src,
} else {
upb_Array* msg_array = (upb_Array*)msg_ext->data.ptr;
UPB_ASSERT(msg_array);
upb_Array* cloned_array =
upb_Array_DeepClone(msg_array, upb_MiniTableField_CType(field),
msg_ext->ext->UPB_PRIVATE(sub).submsg, arena);
upb_Array* cloned_array = upb_Array_DeepClone(
msg_array, upb_MiniTableField_CType(field),
upb_MiniTableExtension_GetSubMessage(msg_ext->ext), arena);
if (!cloned_array) {
return NULL;
}
@ -6721,7 +6723,7 @@ static void upb_MtDecoder_AllocateSubs(upb_MtDecoder* d,
upb_MdDecoder_CheckOutOfMemory(&d->base, subs);
uint32_t i = 0;
for (; i < sub_counts.submsg_count; i++) {
subs[i].submsg = &_kUpb_MiniTable_Empty;
subs[i].UPB_PRIVATE(submsg) = &_kUpb_MiniTable_Empty;
}
if (sub_counts.subenum_count) {
upb_MiniTableField* f = d->fields;
@ -6732,7 +6734,7 @@ static void upb_MtDecoder_AllocateSubs(upb_MtDecoder* d,
}
}
for (; i < sub_counts.submsg_count + sub_counts.subenum_count; i++) {
subs[i].subenum = NULL;
subs[i].UPB_PRIVATE(subenum) = NULL;
}
}
d->table->subs = subs;
@ -7205,6 +7207,10 @@ upb_MiniTable* _upb_MiniTable_Build(const char* data, size_t len,
}
#include <stddef.h>
#include <stdint.h>
// Must be last.
bool upb_MiniTable_SetSubMessage(upb_MiniTable* table,
@ -7240,7 +7246,7 @@ bool upb_MiniTable_SetSubMessage(upb_MiniTable* table,
// TODO: Add this assert back once YouTube is updated to not call
// this function repeatedly.
// UPB_ASSERT(table_sub->submsg == &_kUpb_MiniTable_Empty);
table_sub->submsg = sub;
*table_sub = upb_MiniTableSub_FromMessage(sub);
return true;
}
@ -7253,7 +7259,7 @@ bool upb_MiniTable_SetSubEnum(upb_MiniTable* table, upb_MiniTableField* field,
upb_MiniTableSub* table_sub =
(void*)&table->subs[field->UPB_PRIVATE(submsg_index)];
table_sub->subenum = sub;
*table_sub = upb_MiniTableSub_FromEnum(sub);
return true;
}
@ -9798,9 +9804,11 @@ void _upb_FieldDef_BuildMiniTableExtension(upb_DefBuilder* ctx,
upb_MiniTableExtension* mut_ext = (upb_MiniTableExtension*)ext;
upb_MiniTableSub sub = {NULL};
if (upb_FieldDef_IsSubMessage(f)) {
sub.submsg = upb_MessageDef_MiniTable(f->sub.msgdef);
const upb_MiniTable* submsg = upb_MessageDef_MiniTable(f->sub.msgdef);
sub = upb_MiniTableSub_FromMessage(submsg);
} else if (_upb_FieldDef_IsClosedEnum(f)) {
sub.subenum = _upb_EnumDef_MiniTable(f->sub.enumdef);
const upb_MiniTableEnum* subenum = _upb_EnumDef_MiniTable(f->sub.enumdef);
sub = upb_MiniTableSub_FromEnum(subenum);
}
bool ok2 = upb_MiniTableExtension_Init(desc.data, desc.size, mut_ext,
upb_MessageDef_MiniTable(f->msgdef),
@ -12133,6 +12141,25 @@ typedef union {
uint32_t size;
} wireval;
// Ideally these two functions should take the owning MiniTable pointer as a
// first argument, then we could just put them in mini_table/message.h as nice
// clean getters. But we don't have that so instead we gotta write these
// Frankenfunctions that take an array of subtables.
// Returns the MiniTable corresponding to a given MiniTableField
// from an array of MiniTableSubs.
static const upb_MiniTable* _upb_MiniTableSubs_MessageByField(
const upb_MiniTableSub* subs, const upb_MiniTableField* field) {
return upb_MiniTableSub_Message(subs[field->UPB_PRIVATE(submsg_index)]);
}
// Returns the MiniTableEnum corresponding to a given MiniTableField
// from an array of MiniTableSub.
static const upb_MiniTableEnum* _upb_MiniTableSubs_EnumByField(
const upb_MiniTableSub* subs, const upb_MiniTableField* field) {
return upb_MiniTableSub_Enum(subs[field->UPB_PRIVATE(submsg_index)]);
}
static const char* _upb_Decoder_DecodeMessage(upb_Decoder* d, const char* ptr,
upb_Message* msg,
const upb_MiniTable* layout);
@ -12269,7 +12296,7 @@ static upb_Message* _upb_Decoder_NewSubMessage(upb_Decoder* d,
const upb_MiniTableSub* subs,
const upb_MiniTableField* field,
upb_TaggedMessagePtr* target) {
const upb_MiniTable* subl = subs[field->UPB_PRIVATE(submsg_index)].submsg;
const upb_MiniTable* subl = _upb_MiniTableSubs_MessageByField(subs, field);
UPB_ASSERT(subl);
upb_Message* msg = _upb_Message_New(subl, &d->arena);
if (!msg) _upb_Decoder_ErrorJmp(d, kUpb_DecodeStatus_OutOfMemory);
@ -12293,7 +12320,7 @@ static upb_Message* _upb_Decoder_ReuseSubMessage(
upb_Decoder* d, const upb_MiniTableSub* subs,
const upb_MiniTableField* field, upb_TaggedMessagePtr* target) {
upb_TaggedMessagePtr tagged = *target;
const upb_MiniTable* subl = subs[field->UPB_PRIVATE(submsg_index)].submsg;
const upb_MiniTable* subl = _upb_MiniTableSubs_MessageByField(subs, field);
UPB_ASSERT(subl);
if (!upb_TaggedMessagePtr_IsEmpty(tagged) || subl == &_kUpb_MiniTable_Empty) {
return _upb_TaggedMessagePtr_GetMessage(tagged);
@ -12344,7 +12371,7 @@ static const char* _upb_Decoder_DecodeSubMessage(
upb_Decoder* d, const char* ptr, upb_Message* submsg,
const upb_MiniTableSub* subs, const upb_MiniTableField* field, int size) {
int saved_delta = upb_EpsCopyInputStream_PushLimit(&d->input, ptr, size);
const upb_MiniTable* subl = subs[field->UPB_PRIVATE(submsg_index)].submsg;
const upb_MiniTable* subl = _upb_MiniTableSubs_MessageByField(subs, field);
UPB_ASSERT(subl);
ptr = _upb_Decoder_RecurseSubMessage(d, ptr, submsg, subl, DECODE_NOGROUP);
upb_EpsCopyInputStream_PopLimit(&d->input, ptr, saved_delta);
@ -12375,7 +12402,7 @@ UPB_FORCEINLINE
static const char* _upb_Decoder_DecodeKnownGroup(
upb_Decoder* d, const char* ptr, upb_Message* submsg,
const upb_MiniTableSub* subs, const upb_MiniTableField* field) {
const upb_MiniTable* subl = subs[field->UPB_PRIVATE(submsg_index)].submsg;
const upb_MiniTable* subl = _upb_MiniTableSubs_MessageByField(subs, field);
UPB_ASSERT(subl);
return _upb_Decoder_DecodeGroup(d, ptr, submsg, subl, field->number);
}
@ -12428,7 +12455,7 @@ static const char* _upb_Decoder_DecodeEnumArray(upb_Decoder* d, const char* ptr,
const upb_MiniTableSub* subs,
const upb_MiniTableField* field,
wireval* val) {
const upb_MiniTableEnum* e = subs[field->UPB_PRIVATE(submsg_index)].subenum;
const upb_MiniTableEnum* e = _upb_MiniTableSubs_EnumByField(subs, field);
if (!_upb_Decoder_CheckEnum(d, ptr, msg, e, field, val)) return ptr;
void* mem = UPB_PTR_AT(_upb_array_ptr(arr), arr->size * 4, void);
arr->size++;
@ -12499,7 +12526,7 @@ static const char* _upb_Decoder_DecodeEnumPacked(
upb_Decoder* d, const char* ptr, upb_Message* msg, upb_Array* arr,
const upb_MiniTableSub* subs, const upb_MiniTableField* field,
wireval* val) {
const upb_MiniTableEnum* e = subs[field->UPB_PRIVATE(submsg_index)].subenum;
const upb_MiniTableEnum* e = _upb_MiniTableSubs_EnumByField(subs, field);
int saved_limit = upb_EpsCopyInputStream_PushLimit(&d->input, ptr, val->size);
char* out = UPB_PTR_AT(_upb_array_ptr(arr), arr->size * 4, void);
while (!_upb_Decoder_IsDone(d, &ptr)) {
@ -12639,7 +12666,7 @@ static const char* _upb_Decoder_DecodeToMap(upb_Decoder* d, const char* ptr,
upb_Map* map = *map_p;
upb_MapEntry ent;
UPB_ASSERT(upb_MiniTableField_Type(field) == kUpb_FieldType_Message);
const upb_MiniTable* entry = subs[field->UPB_PRIVATE(submsg_index)].submsg;
const upb_MiniTable* entry = _upb_MiniTableSubs_MessageByField(subs, field);
UPB_ASSERT(entry);
UPB_ASSERT(entry->field_count == 2);
@ -12699,7 +12726,7 @@ static const char* _upb_Decoder_DecodeToSubMessage(
if (UPB_UNLIKELY(op == kUpb_DecodeOp_Enum) &&
!_upb_Decoder_CheckEnum(d, ptr, msg,
subs[field->UPB_PRIVATE(submsg_index)].subenum,
_upb_MiniTableSubs_EnumByField(subs, field),
field, val)) {
return ptr;
}
@ -13017,9 +13044,10 @@ static void _upb_Decoder_CheckUnlinked(upb_Decoder* d, const upb_MiniTable* mt,
int* op) {
// If sub-message is not linked, treat as unknown.
if (field->mode & kUpb_LabelFlags_IsExtension) return;
const upb_MiniTableSub* sub = &mt->subs[field->UPB_PRIVATE(submsg_index)];
const upb_MiniTable* mt_sub =
_upb_MiniTableSubs_MessageByField(mt->subs, field);
if ((d->options & kUpb_DecodeOption_ExperimentalAllowUnlinked) ||
sub->submsg != &_kUpb_MiniTable_Empty) {
mt_sub != &_kUpb_MiniTable_Empty) {
return;
}
#ifndef NDEBUG
@ -14299,7 +14327,8 @@ static const char* fastdecode_tosubmsg(upb_EpsCopyInputStream* e,
upb_Message** dst; \
uint32_t submsg_idx = (data >> 16) & 0xff; \
const upb_MiniTable* tablep = decode_totablep(table); \
const upb_MiniTable* subtablep = tablep->subs[submsg_idx].submsg; \
const upb_MiniTable* subtablep = \
upb_MiniTableSub_Message(tablep->subs[submsg_idx]); \
fastdecode_submsgdata submsg = {decode_totable(subtablep)}; \
fastdecode_arr farr; \
\
@ -14623,7 +14652,8 @@ static void encode_scalar(upb_encstate* e, const void* _field_mem,
case kUpb_FieldType_Group: {
size_t size;
upb_TaggedMessagePtr submsg = *(upb_TaggedMessagePtr*)field_mem;
const upb_MiniTable* subm = subs[f->UPB_PRIVATE(submsg_index)].submsg;
const upb_MiniTable* subm =
upb_MiniTableSub_Message(subs[f->UPB_PRIVATE(submsg_index)]);
if (submsg == 0) {
return;
}
@ -14637,7 +14667,8 @@ static void encode_scalar(upb_encstate* e, const void* _field_mem,
case kUpb_FieldType_Message: {
size_t size;
upb_TaggedMessagePtr submsg = *(upb_TaggedMessagePtr*)field_mem;
const upb_MiniTable* subm = subs[f->UPB_PRIVATE(submsg_index)].submsg;
const upb_MiniTable* subm =
upb_MiniTableSub_Message(subs[f->UPB_PRIVATE(submsg_index)]);
if (submsg == 0) {
return;
}
@ -14726,7 +14757,8 @@ static void encode_array(upb_encstate* e, const upb_Message* msg,
case kUpb_FieldType_Group: {
const upb_TaggedMessagePtr* start = _upb_array_constptr(arr);
const upb_TaggedMessagePtr* ptr = start + arr->size;
const upb_MiniTable* subm = subs[f->UPB_PRIVATE(submsg_index)].submsg;
const upb_MiniTable* subm =
upb_MiniTableSub_Message(subs[f->UPB_PRIVATE(submsg_index)]);
if (--e->depth == 0) encode_err(e, kUpb_EncodeStatus_MaxDepthExceeded);
do {
size_t size;
@ -14741,7 +14773,8 @@ static void encode_array(upb_encstate* e, const upb_Message* msg,
case kUpb_FieldType_Message: {
const upb_TaggedMessagePtr* start = _upb_array_constptr(arr);
const upb_TaggedMessagePtr* ptr = start + arr->size;
const upb_MiniTable* subm = subs[f->UPB_PRIVATE(submsg_index)].submsg;
const upb_MiniTable* subm =
upb_MiniTableSub_Message(subs[f->UPB_PRIVATE(submsg_index)]);
if (--e->depth == 0) encode_err(e, kUpb_EncodeStatus_MaxDepthExceeded);
do {
size_t size;
@ -14780,7 +14813,8 @@ static void encode_map(upb_encstate* e, const upb_Message* msg,
const upb_MiniTableSub* subs,
const upb_MiniTableField* f) {
const upb_Map* map = *UPB_PTR_AT(msg, f->offset, const upb_Map*);
const upb_MiniTable* layout = subs[f->UPB_PRIVATE(submsg_index)].submsg;
const upb_MiniTable* layout =
upb_MiniTableSub_Message(subs[f->UPB_PRIVATE(submsg_index)]);
UPB_ASSERT(layout->field_count == 2);
if (map == NULL) return;

@ -740,8 +740,8 @@ UPB_API_INLINE upb_Arena* upb_Arena_New(void) {
#include <stdint.h>
#ifndef UPB_MINI_TABLE_TYPES_H_
#define UPB_MINI_TABLE_TYPES_H_
#ifndef UPB_MINI_TABLE_TAGGED_PTR_H_
#define UPB_MINI_TABLE_TAGGED_PTR_H_
#include <stdint.h>
@ -757,10 +757,6 @@ typedef void upb_Message;
// Must be last.
#ifdef __cplusplus
extern "C" {
#endif
// When a upb_Message* is stored in a message, array, or map, it is stored in a
// tagged form. If the tag bit is set, the referenced upb_Message is of type
// _kUpb_MiniTable_Empty (a sentinel message type with no fields) instead of
@ -769,8 +765,13 @@ extern "C" {
//
// See the documentation for kUpb_DecodeOption_ExperimentalAllowUnlinked for
// more information.
typedef uintptr_t upb_TaggedMessagePtr;
#ifdef __cplusplus
extern "C" {
#endif
// Internal-only because empty messages cannot be created by the user.
UPB_INLINE upb_TaggedMessagePtr _upb_TaggedMessagePtr_Pack(upb_Message* ptr,
bool empty) {
@ -807,7 +808,7 @@ UPB_INLINE upb_Message* _upb_TaggedMessagePtr_GetEmptyMessage(
#endif
#endif /* UPB_MINI_TABLE_TYPES_H_ */
#endif /* UPB_MINI_TABLE_TAGGED_PTR_H_ */
typedef union {
bool bool_val;
@ -1382,21 +1383,96 @@ UPB_INLINE uint64_t upb_MiniTable_requiredmask(const struct upb_MiniTable* l) {
#endif /* UPB_MINI_TABLE_INTERNAL_MESSAGE_H_ */
#ifndef UPB_MINI_TABLE_SUB_H_
#define UPB_MINI_TABLE_SUB_H_
#ifndef UPB_MINI_TABLE_INTERNAL_SUB_H_
#define UPB_MINI_TABLE_INTERNAL_SUB_H_
// Must be last.
union upb_MiniTableSub {
const struct upb_MiniTable* submsg;
const struct upb_MiniTableEnum* subenum;
const struct upb_MiniTable* UPB_PRIVATE(submsg);
const struct 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;
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;
out.UPB_PRIVATE(submsg) = submsg;
return out;
}
UPB_INLINE const struct upb_MiniTableEnum* UPB_PRIVATE(_upb_MiniTableSub_Enum)(
const union upb_MiniTableSub sub) {
return sub.UPB_PRIVATE(subenum);
}
UPB_INLINE const struct upb_MiniTable* UPB_PRIVATE(_upb_MiniTableSub_Message)(
const union upb_MiniTableSub sub) {
return sub.UPB_PRIVATE(submsg);
}
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* UPB_MINI_TABLE_INTERNAL_SUB_H_ */
// Must be last.
typedef union upb_MiniTableSub upb_MiniTableSub;
#ifdef __cplusplus
extern "C" {
#endif
// Constructors
UPB_API_INLINE upb_MiniTableSub
upb_MiniTableSub_FromEnum(const struct upb_MiniTableEnum* subenum) {
return UPB_PRIVATE(_upb_MiniTableSub_FromEnum)(subenum);
}
UPB_API_INLINE upb_MiniTableSub
upb_MiniTableSub_FromMessage(const struct upb_MiniTable* submsg) {
return UPB_PRIVATE(_upb_MiniTableSub_FromMessage)(submsg);
}
// Getters
UPB_API_INLINE const struct 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_MiniTableSub sub) {
return UPB_PRIVATE(_upb_MiniTableSub_Message)(sub);
}
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* UPB_MINI_TABLE_SUB_H_ */
// Must be last.
#ifdef __cplusplus
extern "C" {
#endif
@ -1416,8 +1492,8 @@ UPB_API_INLINE const upb_MiniTableField* upb_MiniTable_GetFieldByIndex(
UPB_API_INLINE const upb_MiniTable* upb_MiniTable_GetSubMessageTable(
const upb_MiniTable* mini_table, const upb_MiniTableField* field) {
UPB_ASSERT(upb_MiniTableField_CType(field) == kUpb_CType_Message);
const upb_MiniTable* ret =
mini_table->subs[field->UPB_PRIVATE(submsg_index)].submsg;
const upb_MiniTable* ret = upb_MiniTableSub_Message(
mini_table->subs[field->UPB_PRIVATE(submsg_index)]);
UPB_ASSUME(ret);
return ret == &_kUpb_MiniTable_Empty ? NULL : ret;
}
@ -1425,9 +1501,9 @@ UPB_API_INLINE const upb_MiniTable* upb_MiniTable_GetSubMessageTable(
// Returns the MiniTableEnum for this enum field. If the field is unlinked,
// returns NULL.
UPB_API_INLINE const upb_MiniTableEnum* upb_MiniTable_GetSubEnumTable(
const upb_MiniTable* mini_table, const upb_MiniTableField* field) {
UPB_ASSERT(upb_MiniTableField_CType(field) == kUpb_CType_Enum);
return mini_table->subs[field->UPB_PRIVATE(submsg_index)].subenum;
const upb_MiniTable* mini_table, const upb_MiniTableField* f) {
UPB_ASSERT(upb_MiniTableField_CType(f) == kUpb_CType_Enum);
return upb_MiniTableSub_Enum(mini_table->subs[f->UPB_PRIVATE(submsg_index)]);
}
// Returns true if this MiniTable field is linked to a MiniTable for the
@ -1535,12 +1611,12 @@ UPB_INLINE uint32_t UPB_PRIVATE(_upb_MiniTableExtension_Number)(
UPB_INLINE const struct upb_MiniTable* UPB_PRIVATE(
_upb_MiniTableExtension_GetSubMessage)(
const struct upb_MiniTableExtension* e) {
return e->UPB_PRIVATE(sub).submsg;
return e->UPB_PRIVATE(sub).UPB_PRIVATE(submsg);
}
UPB_INLINE void UPB_PRIVATE(_upb_MiniTableExtension_SetSubMessage)(
struct upb_MiniTableExtension* e, const struct upb_MiniTable* m) {
e->UPB_PRIVATE(sub).submsg = m;
e->UPB_PRIVATE(sub).UPB_PRIVATE(submsg) = m;
}
#ifdef __cplusplus
@ -3137,7 +3213,8 @@ UPB_API_INLINE void _upb_Message_SetTaggedMessagePtr(
UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(field) ==
UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte));
UPB_ASSUME(upb_MiniTableField_IsScalar(field));
UPB_ASSERT(mini_table->subs[field->UPB_PRIVATE(submsg_index)].submsg);
UPB_ASSERT(upb_MiniTableSub_Message(
mini_table->subs[field->UPB_PRIVATE(submsg_index)]));
_upb_Message_SetNonExtensionField(msg, field, &sub_message);
}
@ -3156,8 +3233,8 @@ UPB_API_INLINE upb_Message* upb_Message_GetOrCreateMutableMessage(
UPB_ASSUME(upb_MiniTableField_CType(field) == kUpb_CType_Message);
upb_Message* sub_message = *UPB_PTR_AT(msg, field->offset, upb_Message*);
if (!sub_message) {
const upb_MiniTable* sub_mini_table =
mini_table->subs[field->UPB_PRIVATE(submsg_index)].submsg;
const upb_MiniTable* sub_mini_table = upb_MiniTableSub_Message(
mini_table->subs[field->UPB_PRIVATE(submsg_index)]);
UPB_ASSERT(sub_mini_table);
sub_message = _upb_Message_New(sub_mini_table, arena);
*UPB_PTR_AT(msg, field->offset, upb_Message*) = sub_message;
@ -3308,14 +3385,6 @@ UPB_INLINE void _upb_msg_map_set_value(void* msg, const void* val,
#define UPB_MINI_TABLE_DECODE_H_
#ifndef UPB_MINI_TABLE_SUB_H_
#define UPB_MINI_TABLE_SUB_H_
typedef union upb_MiniTableSub upb_MiniTableSub;
#endif /* UPB_MINI_TABLE_INTERNAL_SUB_H_ */
// Export the newer headers, for legacy users. New users should include the
// more specific headers directly.
// IWYU pragma: begin_exports
@ -3475,8 +3544,7 @@ UPB_API upb_MiniTableExtension* _upb_MiniTableExtension_Build(
UPB_API_INLINE upb_MiniTableExtension* upb_MiniTableExtension_Build(
const char* data, size_t len, const upb_MiniTable* extendee,
upb_Arena* arena, upb_Status* status) {
upb_MiniTableSub sub;
sub.submsg = NULL;
upb_MiniTableSub sub = upb_MiniTableSub_FromMessage(NULL);
return _upb_MiniTableExtension_Build(
data, len, extendee, sub, kUpb_MiniTablePlatform_Native, arena, status);
}
@ -3484,8 +3552,7 @@ UPB_API_INLINE upb_MiniTableExtension* upb_MiniTableExtension_Build(
UPB_API_INLINE upb_MiniTableExtension* upb_MiniTableExtension_BuildMessage(
const char* data, size_t len, const upb_MiniTable* extendee,
upb_MiniTable* submsg, upb_Arena* arena, upb_Status* status) {
upb_MiniTableSub sub;
sub.submsg = submsg;
upb_MiniTableSub sub = upb_MiniTableSub_FromMessage(submsg);
return _upb_MiniTableExtension_Build(
data, len, extendee, sub, kUpb_MiniTablePlatform_Native, arena, status);
}
@ -3493,8 +3560,7 @@ UPB_API_INLINE upb_MiniTableExtension* upb_MiniTableExtension_BuildMessage(
UPB_API_INLINE upb_MiniTableExtension* upb_MiniTableExtension_BuildEnum(
const char* data, size_t len, const upb_MiniTable* extendee,
upb_MiniTableEnum* subenum, upb_Arena* arena, upb_Status* status) {
upb_MiniTableSub sub;
sub.subenum = subenum;
upb_MiniTableSub sub = upb_MiniTableSub_FromEnum(subenum);
return _upb_MiniTableExtension_Build(
data, len, extendee, sub, kUpb_MiniTablePlatform_Native, arena, status);
}

@ -13,7 +13,7 @@
#include "upb/port/def.inc"
static const upb_MiniTableSub google_protobuf_FileDescriptorSet_submsgs[1] = {
{.submsg = &google__protobuf__FileDescriptorProto_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__FileDescriptorProto_msg_init},
};
static const upb_MiniTableField google_protobuf_FileDescriptorSet__fields[1] = {
@ -31,13 +31,13 @@ const upb_MiniTable google__protobuf__FileDescriptorSet_msg_init = {
};
static const upb_MiniTableSub google_protobuf_FileDescriptorProto_submsgs[7] = {
{.submsg = &google__protobuf__DescriptorProto_msg_init},
{.submsg = &google__protobuf__EnumDescriptorProto_msg_init},
{.submsg = &google__protobuf__ServiceDescriptorProto_msg_init},
{.submsg = &google__protobuf__FieldDescriptorProto_msg_init},
{.submsg = &google__protobuf__FileOptions_msg_init},
{.submsg = &google__protobuf__SourceCodeInfo_msg_init},
{.subenum = &google_protobuf_Edition_enum_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__DescriptorProto_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__EnumDescriptorProto_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__ServiceDescriptorProto_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__FieldDescriptorProto_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__FileOptions_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__SourceCodeInfo_msg_init},
{.UPB_PRIVATE(subenum) = &google_protobuf_Edition_enum_init},
};
static const upb_MiniTableField google_protobuf_FileDescriptorProto__fields[13] = {
@ -81,14 +81,14 @@ const upb_MiniTable google__protobuf__FileDescriptorProto_msg_init = {
};
static const upb_MiniTableSub google_protobuf_DescriptorProto_submsgs[8] = {
{.submsg = &google__protobuf__FieldDescriptorProto_msg_init},
{.submsg = &google__protobuf__DescriptorProto_msg_init},
{.submsg = &google__protobuf__EnumDescriptorProto_msg_init},
{.submsg = &google__protobuf__DescriptorProto__ExtensionRange_msg_init},
{.submsg = &google__protobuf__FieldDescriptorProto_msg_init},
{.submsg = &google__protobuf__MessageOptions_msg_init},
{.submsg = &google__protobuf__OneofDescriptorProto_msg_init},
{.submsg = &google__protobuf__DescriptorProto__ReservedRange_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__FieldDescriptorProto_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__DescriptorProto_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__EnumDescriptorProto_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__DescriptorProto__ExtensionRange_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__FieldDescriptorProto_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__MessageOptions_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__OneofDescriptorProto_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__DescriptorProto__ReservedRange_msg_init},
};
static const upb_MiniTableField google_protobuf_DescriptorProto__fields[10] = {
@ -129,7 +129,7 @@ const upb_MiniTable google__protobuf__DescriptorProto_msg_init = {
};
static const upb_MiniTableSub google_protobuf_DescriptorProto_ExtensionRange_submsgs[1] = {
{.submsg = &google__protobuf__ExtensionRangeOptions_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__ExtensionRangeOptions_msg_init},
};
static const upb_MiniTableField google_protobuf_DescriptorProto_ExtensionRange__fields[3] = {
@ -168,10 +168,10 @@ const upb_MiniTable google__protobuf__DescriptorProto__ReservedRange_msg_init =
};
static const upb_MiniTableSub google_protobuf_ExtensionRangeOptions_submsgs[4] = {
{.submsg = &google__protobuf__ExtensionRangeOptions__Declaration_msg_init},
{.submsg = &google__protobuf__FeatureSet_msg_init},
{.submsg = &google__protobuf__UninterpretedOption_msg_init},
{.subenum = &google_protobuf_ExtensionRangeOptions_VerificationState_enum_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__ExtensionRangeOptions__Declaration_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__FeatureSet_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__UninterpretedOption_msg_init},
{.UPB_PRIVATE(subenum) = &google_protobuf_ExtensionRangeOptions_VerificationState_enum_init},
};
static const upb_MiniTableField google_protobuf_ExtensionRangeOptions__fields[4] = {
@ -246,9 +246,9 @@ const upb_MiniTable google__protobuf__ExtensionRangeOptions__Declaration_msg_ini
};
static const upb_MiniTableSub google_protobuf_FieldDescriptorProto_submsgs[3] = {
{.submsg = &google__protobuf__FieldOptions_msg_init},
{.subenum = &google_protobuf_FieldDescriptorProto_Label_enum_init},
{.subenum = &google_protobuf_FieldDescriptorProto_Type_enum_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__FieldOptions_msg_init},
{.UPB_PRIVATE(subenum) = &google_protobuf_FieldDescriptorProto_Label_enum_init},
{.UPB_PRIVATE(subenum) = &google_protobuf_FieldDescriptorProto_Type_enum_init},
};
static const upb_MiniTableField google_protobuf_FieldDescriptorProto__fields[11] = {
@ -306,7 +306,7 @@ const upb_MiniTable google__protobuf__FieldDescriptorProto_msg_init = {
};
static const upb_MiniTableSub google_protobuf_OneofDescriptorProto_submsgs[1] = {
{.submsg = &google__protobuf__OneofOptions_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__OneofOptions_msg_init},
};
static const upb_MiniTableField google_protobuf_OneofDescriptorProto__fields[2] = {
@ -327,9 +327,9 @@ const upb_MiniTable google__protobuf__OneofDescriptorProto_msg_init = {
};
static const upb_MiniTableSub google_protobuf_EnumDescriptorProto_submsgs[3] = {
{.submsg = &google__protobuf__EnumValueDescriptorProto_msg_init},
{.submsg = &google__protobuf__EnumOptions_msg_init},
{.submsg = &google__protobuf__EnumDescriptorProto__EnumReservedRange_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__EnumValueDescriptorProto_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__EnumOptions_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__EnumDescriptorProto__EnumReservedRange_msg_init},
};
static const upb_MiniTableField google_protobuf_EnumDescriptorProto__fields[5] = {
@ -374,7 +374,7 @@ const upb_MiniTable google__protobuf__EnumDescriptorProto__EnumReservedRange_msg
};
static const upb_MiniTableSub google_protobuf_EnumValueDescriptorProto_submsgs[1] = {
{.submsg = &google__protobuf__EnumValueOptions_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__EnumValueOptions_msg_init},
};
static const upb_MiniTableField google_protobuf_EnumValueDescriptorProto__fields[3] = {
@ -396,8 +396,8 @@ const upb_MiniTable google__protobuf__EnumValueDescriptorProto_msg_init = {
};
static const upb_MiniTableSub google_protobuf_ServiceDescriptorProto_submsgs[2] = {
{.submsg = &google__protobuf__MethodDescriptorProto_msg_init},
{.submsg = &google__protobuf__ServiceOptions_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__MethodDescriptorProto_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__ServiceOptions_msg_init},
};
static const upb_MiniTableField google_protobuf_ServiceDescriptorProto__fields[3] = {
@ -419,7 +419,7 @@ const upb_MiniTable google__protobuf__ServiceDescriptorProto_msg_init = {
};
static const upb_MiniTableSub google_protobuf_MethodDescriptorProto_submsgs[1] = {
{.submsg = &google__protobuf__MethodOptions_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__MethodOptions_msg_init},
};
static const upb_MiniTableField google_protobuf_MethodDescriptorProto__fields[6] = {
@ -448,9 +448,9 @@ const upb_MiniTable google__protobuf__MethodDescriptorProto_msg_init = {
};
static const upb_MiniTableSub google_protobuf_FileOptions_submsgs[3] = {
{.submsg = &google__protobuf__FeatureSet_msg_init},
{.submsg = &google__protobuf__UninterpretedOption_msg_init},
{.subenum = &google_protobuf_FileOptions_OptimizeMode_enum_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__FeatureSet_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__UninterpretedOption_msg_init},
{.UPB_PRIVATE(subenum) = &google_protobuf_FileOptions_OptimizeMode_enum_init},
};
static const upb_MiniTableField google_protobuf_FileOptions__fields[22] = {
@ -519,8 +519,8 @@ const upb_MiniTable google__protobuf__FileOptions_msg_init = {
};
static const upb_MiniTableSub google_protobuf_MessageOptions_submsgs[2] = {
{.submsg = &google__protobuf__FeatureSet_msg_init},
{.submsg = &google__protobuf__UninterpretedOption_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__FeatureSet_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__UninterpretedOption_msg_init},
};
static const upb_MiniTableField google_protobuf_MessageOptions__fields[7] = {
@ -574,13 +574,13 @@ const upb_MiniTable google__protobuf__MessageOptions_msg_init = {
};
static const upb_MiniTableSub google_protobuf_FieldOptions_submsgs[7] = {
{.submsg = &google__protobuf__FieldOptions__EditionDefault_msg_init},
{.submsg = &google__protobuf__FeatureSet_msg_init},
{.submsg = &google__protobuf__UninterpretedOption_msg_init},
{.subenum = &google_protobuf_FieldOptions_CType_enum_init},
{.subenum = &google_protobuf_FieldOptions_JSType_enum_init},
{.subenum = &google_protobuf_FieldOptions_OptionRetention_enum_init},
{.subenum = &google_protobuf_FieldOptions_OptionTargetType_enum_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__FieldOptions__EditionDefault_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__FeatureSet_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__UninterpretedOption_msg_init},
{.UPB_PRIVATE(subenum) = &google_protobuf_FieldOptions_CType_enum_init},
{.UPB_PRIVATE(subenum) = &google_protobuf_FieldOptions_JSType_enum_init},
{.UPB_PRIVATE(subenum) = &google_protobuf_FieldOptions_OptionRetention_enum_init},
{.UPB_PRIVATE(subenum) = &google_protobuf_FieldOptions_OptionTargetType_enum_init},
};
static const upb_MiniTableField google_protobuf_FieldOptions__fields[13] = {
@ -640,7 +640,7 @@ const upb_MiniTable google__protobuf__FieldOptions_msg_init = {
};
static const upb_MiniTableSub google_protobuf_FieldOptions_EditionDefault_submsgs[1] = {
{.subenum = &google_protobuf_Edition_enum_init},
{.UPB_PRIVATE(subenum) = &google_protobuf_Edition_enum_init},
};
static const upb_MiniTableField google_protobuf_FieldOptions_EditionDefault__fields[2] = {
@ -661,8 +661,8 @@ const upb_MiniTable google__protobuf__FieldOptions__EditionDefault_msg_init = {
};
static const upb_MiniTableSub google_protobuf_OneofOptions_submsgs[2] = {
{.submsg = &google__protobuf__FeatureSet_msg_init},
{.submsg = &google__protobuf__UninterpretedOption_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__FeatureSet_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__UninterpretedOption_msg_init},
};
static const upb_MiniTableField google_protobuf_OneofOptions__fields[2] = {
@ -711,8 +711,8 @@ const upb_MiniTable google__protobuf__OneofOptions_msg_init = {
};
static const upb_MiniTableSub google_protobuf_EnumOptions_submsgs[2] = {
{.submsg = &google__protobuf__FeatureSet_msg_init},
{.submsg = &google__protobuf__UninterpretedOption_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__FeatureSet_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__UninterpretedOption_msg_init},
};
static const upb_MiniTableField google_protobuf_EnumOptions__fields[5] = {
@ -764,8 +764,8 @@ const upb_MiniTable google__protobuf__EnumOptions_msg_init = {
};
static const upb_MiniTableSub google_protobuf_EnumValueOptions_submsgs[2] = {
{.submsg = &google__protobuf__FeatureSet_msg_init},
{.submsg = &google__protobuf__UninterpretedOption_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__FeatureSet_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__UninterpretedOption_msg_init},
};
static const upb_MiniTableField google_protobuf_EnumValueOptions__fields[4] = {
@ -816,8 +816,8 @@ const upb_MiniTable google__protobuf__EnumValueOptions_msg_init = {
};
static const upb_MiniTableSub google_protobuf_ServiceOptions_submsgs[2] = {
{.submsg = &google__protobuf__FeatureSet_msg_init},
{.submsg = &google__protobuf__UninterpretedOption_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__FeatureSet_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__UninterpretedOption_msg_init},
};
static const upb_MiniTableField google_protobuf_ServiceOptions__fields[3] = {
@ -867,9 +867,9 @@ const upb_MiniTable google__protobuf__ServiceOptions_msg_init = {
};
static const upb_MiniTableSub google_protobuf_MethodOptions_submsgs[3] = {
{.submsg = &google__protobuf__FeatureSet_msg_init},
{.submsg = &google__protobuf__UninterpretedOption_msg_init},
{.subenum = &google_protobuf_MethodOptions_IdempotencyLevel_enum_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__FeatureSet_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__UninterpretedOption_msg_init},
{.UPB_PRIVATE(subenum) = &google_protobuf_MethodOptions_IdempotencyLevel_enum_init},
};
static const upb_MiniTableField google_protobuf_MethodOptions__fields[4] = {
@ -920,7 +920,7 @@ const upb_MiniTable google__protobuf__MethodOptions_msg_init = {
};
static const upb_MiniTableSub google_protobuf_UninterpretedOption_submsgs[1] = {
{.submsg = &google__protobuf__UninterpretedOption__NamePart_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__UninterpretedOption__NamePart_msg_init},
};
static const upb_MiniTableField google_protobuf_UninterpretedOption__fields[7] = {
@ -975,12 +975,12 @@ const upb_MiniTable google__protobuf__UninterpretedOption__NamePart_msg_init = {
};
static const upb_MiniTableSub google_protobuf_FeatureSet_submsgs[6] = {
{.subenum = &google_protobuf_FeatureSet_FieldPresence_enum_init},
{.subenum = &google_protobuf_FeatureSet_EnumType_enum_init},
{.subenum = &google_protobuf_FeatureSet_RepeatedFieldEncoding_enum_init},
{.subenum = &google_protobuf_FeatureSet_Utf8Validation_enum_init},
{.subenum = &google_protobuf_FeatureSet_MessageEncoding_enum_init},
{.subenum = &google_protobuf_FeatureSet_JsonFormat_enum_init},
{.UPB_PRIVATE(subenum) = &google_protobuf_FeatureSet_FieldPresence_enum_init},
{.UPB_PRIVATE(subenum) = &google_protobuf_FeatureSet_EnumType_enum_init},
{.UPB_PRIVATE(subenum) = &google_protobuf_FeatureSet_RepeatedFieldEncoding_enum_init},
{.UPB_PRIVATE(subenum) = &google_protobuf_FeatureSet_Utf8Validation_enum_init},
{.UPB_PRIVATE(subenum) = &google_protobuf_FeatureSet_MessageEncoding_enum_init},
{.UPB_PRIVATE(subenum) = &google_protobuf_FeatureSet_JsonFormat_enum_init},
};
static const upb_MiniTableField google_protobuf_FeatureSet__fields[6] = {
@ -999,9 +999,9 @@ const upb_MiniTable google__protobuf__FeatureSet_msg_init = {
};
static const upb_MiniTableSub google_protobuf_FeatureSetDefaults_submsgs[3] = {
{.submsg = &google__protobuf__FeatureSetDefaults__FeatureSetEditionDefault_msg_init},
{.subenum = &google_protobuf_Edition_enum_init},
{.subenum = &google_protobuf_Edition_enum_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__FeatureSetDefaults__FeatureSetEditionDefault_msg_init},
{.UPB_PRIVATE(subenum) = &google_protobuf_Edition_enum_init},
{.UPB_PRIVATE(subenum) = &google_protobuf_Edition_enum_init},
};
static const upb_MiniTableField google_protobuf_FeatureSetDefaults__fields[3] = {
@ -1021,8 +1021,8 @@ const upb_MiniTable google__protobuf__FeatureSetDefaults_msg_init = {
};
static const upb_MiniTableSub google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_submsgs[2] = {
{.submsg = &google__protobuf__FeatureSet_msg_init},
{.subenum = &google_protobuf_Edition_enum_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__FeatureSet_msg_init},
{.UPB_PRIVATE(subenum) = &google_protobuf_Edition_enum_init},
};
static const upb_MiniTableField google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault__fields[2] = {
@ -1043,7 +1043,7 @@ const upb_MiniTable google__protobuf__FeatureSetDefaults__FeatureSetEditionDefau
};
static const upb_MiniTableSub google_protobuf_SourceCodeInfo_submsgs[1] = {
{.submsg = &google__protobuf__SourceCodeInfo__Location_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__SourceCodeInfo__Location_msg_init},
};
static const upb_MiniTableField google_protobuf_SourceCodeInfo__fields[1] = {
@ -1085,7 +1085,7 @@ const upb_MiniTable google__protobuf__SourceCodeInfo__Location_msg_init = {
};
static const upb_MiniTableSub google_protobuf_GeneratedCodeInfo_submsgs[1] = {
{.submsg = &google__protobuf__GeneratedCodeInfo__Annotation_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__GeneratedCodeInfo__Annotation_msg_init},
};
static const upb_MiniTableField google_protobuf_GeneratedCodeInfo__fields[1] = {
@ -1103,7 +1103,7 @@ const upb_MiniTable google__protobuf__GeneratedCodeInfo_msg_init = {
};
static const upb_MiniTableSub google_protobuf_GeneratedCodeInfo_Annotation_submsgs[1] = {
{.subenum = &google_protobuf_GeneratedCodeInfo_Annotation_Semantic_enum_init},
{.UPB_PRIVATE(subenum) = &google_protobuf_GeneratedCodeInfo_Annotation_Semantic_enum_init},
};
static const upb_MiniTableField google_protobuf_GeneratedCodeInfo_Annotation__fields[5] = {

Loading…
Cancel
Save