Skip to content

Commit

Permalink
Open-source extension declaration definition.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 519752053
  • Loading branch information
mkruskal-google authored and copybara-github committed Mar 27, 2023
1 parent 3a871ac commit 145900f
Show file tree
Hide file tree
Showing 8 changed files with 2,006 additions and 521 deletions.
609 changes: 324 additions & 285 deletions php/ext/google/protobuf/php-upb.c

Large diffs are not rendered by default.

215 changes: 200 additions & 15 deletions php/ext/google/protobuf/php-upb.h

Large diffs are not rendered by default.

40 changes: 33 additions & 7 deletions ruby/ext/google/protobuf_c/ruby-upb.c
Original file line number Diff line number Diff line change
Expand Up @@ -876,21 +876,24 @@ const upb_MiniTable google_protobuf_DescriptorProto_ReservedRange_msg_init = {
})
};

static const upb_MiniTableSub google_protobuf_ExtensionRangeOptions_submsgs[1] = {
static const upb_MiniTableSub google_protobuf_ExtensionRangeOptions_submsgs[2] = {
{.submsg = &google_protobuf_ExtensionRangeOptions_Declaration_msg_init},
{.submsg = &google_protobuf_UninterpretedOption_msg_init},
};

static const upb_MiniTableField google_protobuf_ExtensionRangeOptions__fields[1] = {
{999, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)},
static const upb_MiniTableField google_protobuf_ExtensionRangeOptions__fields[2] = {
{2, 0, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)},
{999, UPB_SIZE(4, 8), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)},
};

const upb_MiniTable google_protobuf_ExtensionRangeOptions_msg_init = {
&google_protobuf_ExtensionRangeOptions_submsgs[0],
&google_protobuf_ExtensionRangeOptions__fields[0],
8, 1, kUpb_ExtMode_Extendable, 0, UPB_FASTTABLE_MASK(248), 0,
UPB_SIZE(8, 16), 2, kUpb_ExtMode_Extendable, 0, UPB_FASTTABLE_MASK(248), 0,
UPB_FASTTABLE_INIT({
{0x0000000000000000, &_upb_FastDecoder_DecodeGeneric},
{0x0000000000000000, &_upb_FastDecoder_DecodeGeneric},
{0x000000003f000012, &upb_prm_1bt_max64b},
{0x0000000000000000, &_upb_FastDecoder_DecodeGeneric},
{0x0000000000000000, &_upb_FastDecoder_DecodeGeneric},
{0x0000000000000000, &_upb_FastDecoder_DecodeGeneric},
Expand All @@ -911,15 +914,37 @@ const upb_MiniTable google_protobuf_ExtensionRangeOptions_msg_init = {
{0x0000000000000000, &_upb_FastDecoder_DecodeGeneric},
{0x0000000000000000, &_upb_FastDecoder_DecodeGeneric},
{0x0000000000000000, &_upb_FastDecoder_DecodeGeneric},
{0x000800003f013eba, &upb_prm_2bt_max128b},
{0x0000000000000000, &_upb_FastDecoder_DecodeGeneric},
{0x000000003f003eba, &upb_prm_2bt_max128b},
{0x0000000000000000, &_upb_FastDecoder_DecodeGeneric},
{0x0000000000000000, &_upb_FastDecoder_DecodeGeneric},
{0x0000000000000000, &_upb_FastDecoder_DecodeGeneric},
{0x0000000000000000, &_upb_FastDecoder_DecodeGeneric},
{0x0000000000000000, &_upb_FastDecoder_DecodeGeneric},
{0x0000000000000000, &_upb_FastDecoder_DecodeGeneric},
{0x0000000000000000, &_upb_FastDecoder_DecodeGeneric},
})
};

static const upb_MiniTableField google_protobuf_ExtensionRangeOptions_Declaration__fields[4] = {
{1, 4, 1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
{2, UPB_SIZE(12, 16), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{3, UPB_SIZE(20, 32), 3, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{4, 8, 4, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};

const upb_MiniTable google_protobuf_ExtensionRangeOptions_Declaration_msg_init = {
NULL,
&google_protobuf_ExtensionRangeOptions_Declaration__fields[0],
UPB_SIZE(32, 48), 4, kUpb_ExtMode_NonExtendable, 4, UPB_FASTTABLE_MASK(56), 0,
UPB_FASTTABLE_INIT({
{0x0000000000000000, &_upb_FastDecoder_DecodeGeneric},
{0x0004000001000008, &upb_psv4_1bt},
{0x0010000002000012, &upb_psb_1bt},
{0x002000000300001a, &upb_psb_1bt},
{0x0008000004000020, &upb_psb1_1bt},
{0x0000000000000000, &_upb_FastDecoder_DecodeGeneric},
{0x0000000000000000, &_upb_FastDecoder_DecodeGeneric},
{0x0000000000000000, &_upb_FastDecoder_DecodeGeneric},
})
};
Expand Down Expand Up @@ -1703,13 +1728,14 @@ const upb_MiniTable google_protobuf_GeneratedCodeInfo_Annotation_msg_init = {
})
};

static const upb_MiniTable *messages_layout[27] = {
static const upb_MiniTable *messages_layout[28] = {
&google_protobuf_FileDescriptorSet_msg_init,
&google_protobuf_FileDescriptorProto_msg_init,
&google_protobuf_DescriptorProto_msg_init,
&google_protobuf_DescriptorProto_ExtensionRange_msg_init,
&google_protobuf_DescriptorProto_ReservedRange_msg_init,
&google_protobuf_ExtensionRangeOptions_msg_init,
&google_protobuf_ExtensionRangeOptions_Declaration_msg_init,
&google_protobuf_FieldDescriptorProto_msg_init,
&google_protobuf_OneofDescriptorProto_msg_init,
&google_protobuf_EnumDescriptorProto_msg_init,
Expand Down Expand Up @@ -1830,7 +1856,7 @@ const upb_MiniTableFile google_protobuf_descriptor_proto_upb_file_layout = {
messages_layout,
enums_layout,
NULL,
27,
28,
9,
0,
};
Expand Down
Loading

0 comments on commit 145900f

Please sign in to comment.