diff --git a/build_defs/upb.patch b/build_defs/upb.patch index 0a9cb28f87..c3ed912698 100644 --- a/build_defs/upb.patch +++ b/build_defs/upb.patch @@ -1,11 +1,11 @@ ---- bazel/build_defs.bzl -+++ bazel/build_defs.bzl -@@ -33,6 +33,8 @@ _DEFAULT_CPPOPTS.extend([ - "-Wextra", - # "-Wshorten-64-to-32", # not in GCC (and my Kokoro images doesn't have Clang) - "-Werror", -+ # TODO(b/265232445) This is required due to https://github.com/abseil/abseil-cpp/issues/1201. -+ "-Wno-deprecated", - "-Wno-unused-parameter", - "-Wno-long-long", - ]) +--- upbc/bootstrap_compiler.bzl ++++ upbc/bootstrap_compiler.bzl +@@ -20,7 +20,7 @@ _upbc_base = "//upbc:protoc-gen-upb" + + # begin:github_only + _is_google3 = False +-_extra_proto_path = "-Iexternal/com_google_protobuf/src " ++_extra_proto_path = "-Isrc " + # end:github_only + + def _upbc(stage): diff --git a/conformance/failure_list_php.txt b/conformance/failure_list_php.txt index cf129d161e..4876e10ba4 100644 --- a/conformance/failure_list_php.txt +++ b/conformance/failure_list_php.txt @@ -32,5 +32,3 @@ Required.Proto3.ProtobufInput.ValidDataOneof.MESSAGE.Merge.ProtobufOutput Required.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.PackedInput.JsonOutput Required.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.UnpackedInput.JsonOutput Required.Proto3.ProtobufInput.ValidDataScalar.FLOAT[2].JsonOutput -Recommended.ValueRejectInfNumberValue.JsonOutput -Recommended.ValueRejectNanNumberValue.JsonOutput diff --git a/conformance/failure_list_php_c.txt b/conformance/failure_list_php_c.txt index 197c2b71bd..284448652f 100644 --- a/conformance/failure_list_php_c.txt +++ b/conformance/failure_list_php_c.txt @@ -2,5 +2,3 @@ Recommended.Proto2.JsonInput.FieldNameExtension.Validator Recommended.Proto3.JsonInput.IgnoreUnknownEnumStringValueInMapValue.ProtobufOutput Recommended.Proto3.JsonInput.IgnoreUnknownEnumStringValueInRepeatedField.ProtobufOutput Required.Proto2.JsonInput.StoresDefaultPrimitive.Validator -Recommended.ValueRejectInfNumberValue.JsonOutput -Recommended.ValueRejectNanNumberValue.JsonOutput \ No newline at end of file diff --git a/conformance/failure_list_ruby.txt b/conformance/failure_list_ruby.txt index 8eb63b9a7d..3c744391cf 100644 --- a/conformance/failure_list_ruby.txt +++ b/conformance/failure_list_ruby.txt @@ -58,5 +58,3 @@ Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT32.PackedInput.UnpackedOu Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT32.UnpackedInput.UnpackedOutput.ProtobufOutput Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT64.PackedInput.UnpackedOutput.ProtobufOutput Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT64.UnpackedInput.UnpackedOutput.ProtobufOutput -Recommended.ValueRejectInfNumberValue.JsonOutput -Recommended.ValueRejectNanNumberValue.JsonOutput diff --git a/google3_export_generated_files.sh b/google3_export_generated_files.sh old mode 100644 new mode 100755 index 3e0c81178e..572c4caee3 --- a/google3_export_generated_files.sh +++ b/google3_export_generated_files.sh @@ -27,6 +27,5 @@ update_staleness() { done } -update_staleness ruby test_amalgamation_staleness ruby/ext/google/protobuf_c ruby-upb.* +update_staleness ruby/ext/google/protobuf_c test_amalgamation_staleness ruby/ext/google/protobuf_c ruby-upb.* update_staleness php test_amalgamation_staleness php/ext/google/protobuf php-upb.* -update_staleness src cmake_lists_staleness_test src file_lists.cmake diff --git a/php/ext/google/protobuf/php-upb.c b/php/ext/google/protobuf/php-upb.c index c61dea95a3..c12266c0a5 100644 --- a/php/ext/google/protobuf/php-upb.c +++ b/php/ext/google/protobuf/php-upb.c @@ -86,7 +86,11 @@ #define UPB_ALIGN_UP(size, align) (((size) + (align) - 1) / (align) * (align)) #define UPB_ALIGN_DOWN(size, align) ((size) / (align) * (align)) #define UPB_ALIGN_MALLOC(size) UPB_ALIGN_UP(size, UPB_MALLOC_ALIGN) +#ifdef __clang__ +#define UPB_ALIGN_OF(type) _Alignof(type) +#else #define UPB_ALIGN_OF(type) offsetof (struct { char c; type member; }, member) +#endif // Hints to the compiler about likely/unlikely branches. #if defined (__GNUC__) || defined(__clang__) @@ -219,11 +223,13 @@ #endif /* UPB_FASTTABLE_INIT() allows protos compiled for fasttable to gracefully - * degrade to non-fasttable if we are using UPB_TRY_ENABLE_FASTTABLE. */ -#if !UPB_FASTTABLE && defined(UPB_TRY_ENABLE_FASTTABLE) + * degrade to non-fasttable if the runtime or platform do not support it. */ +#if !UPB_FASTTABLE #define UPB_FASTTABLE_INIT(...) +#define UPB_FASTTABLE_MASK(mask) -1 #else #define UPB_FASTTABLE_INIT(...) __VA_ARGS__ +#define UPB_FASTTABLE_MASK(mask) mask #endif #undef UPB_FASTTABLE_SUPPORTED @@ -279,6 +285,16 @@ void __asan_unpoison_memory_region(void const volatile *addr, size_t size); #define UPB_DEPRECATED #endif +// begin:google_only +// #define UPB_IS_GOOGLE3 +// end:google_only + +#if defined(UPB_IS_GOOGLE3) && !defined(UPB_BOOTSTRAP_STAGE0) +#define UPB_DESC(sym) proto2_##sym +#else +#define UPB_DESC(sym) google_protobuf_##sym +#endif + #include #include @@ -668,6 +684,7 @@ bool _upb_mapsorter_pushmap(_upb_mapsorter* s, upb_FieldType key_type, #include +// Must be last. static const upb_MiniTableSub google_protobuf_FileDescriptorSet_submsgs[1] = { {.submsg = &google_protobuf_FileDescriptorProto_msg_init}, @@ -680,7 +697,11 @@ static const upb_MiniTableField google_protobuf_FileDescriptorSet__fields[1] = { const upb_MiniTable google_protobuf_FileDescriptorSet_msg_init = { &google_protobuf_FileDescriptorSet_submsgs[0], &google_protobuf_FileDescriptorSet__fields[0], - 8, 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_prm_1bt_max192b}, + }) }; static const upb_MiniTableSub google_protobuf_FileDescriptorProto_submsgs[6] = { @@ -711,7 +732,25 @@ static const upb_MiniTableField google_protobuf_FileDescriptorProto__fields[13] const upb_MiniTable google_protobuf_FileDescriptorProto_msg_init = { &google_protobuf_FileDescriptorProto_submsgs[0], &google_protobuf_FileDescriptorProto__fields[0], - UPB_SIZE(72, 144), 13, kUpb_ExtMode_NonExtendable, 13, 255, 0, + UPB_SIZE(72, 144), 13, kUpb_ExtMode_NonExtendable, 13, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psb_1bt}, + {0x0018000002000012, &upb_psb_1bt}, + {0x002800003f00001a, &upb_prb_1bt}, + {0x003000003f000022, &upb_prm_1bt_max128b}, + {0x003800003f01002a, &upb_prm_1bt_max64b}, + {0x004000003f020032, &upb_prm_1bt_max64b}, + {0x004800003f03003a, &upb_prm_1bt_max128b}, + {0x0050000003040042, &upb_psm_1bt_max256b}, + {0x005800000405004a, &upb_psm_1bt_max64b}, + {0x006000003f000050, &upb_prv4_1bt}, + {0x006800003f000058, &upb_prv4_1bt}, + {0x0070000005000062, &upb_psb_1bt}, + {0x008000000600006a, &upb_psb_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTableSub google_protobuf_DescriptorProto_submsgs[8] = { @@ -741,7 +780,25 @@ static const upb_MiniTableField google_protobuf_DescriptorProto__fields[10] = { const upb_MiniTable google_protobuf_DescriptorProto_msg_init = { &google_protobuf_DescriptorProto_submsgs[0], &google_protobuf_DescriptorProto__fields[0], - UPB_SIZE(48, 96), 10, kUpb_ExtMode_NonExtendable, 10, 255, 0, + UPB_SIZE(48, 96), 10, kUpb_ExtMode_NonExtendable, 10, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psb_1bt}, + {0x001800003f000012, &upb_prm_1bt_max128b}, + {0x002000003f01001a, &upb_prm_1bt_max128b}, + {0x002800003f020022, &upb_prm_1bt_max64b}, + {0x003000003f03002a, &upb_prm_1bt_max64b}, + {0x003800003f040032, &upb_prm_1bt_max128b}, + {0x004000000205003a, &upb_psm_1bt_max64b}, + {0x004800003f060042, &upb_prm_1bt_max64b}, + {0x005000003f07004a, &upb_prm_1bt_max64b}, + {0x005800003f000052, &upb_prb_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTableSub google_protobuf_DescriptorProto_ExtensionRange_submsgs[1] = { @@ -757,7 +814,13 @@ static const upb_MiniTableField google_protobuf_DescriptorProto_ExtensionRange__ const upb_MiniTable google_protobuf_DescriptorProto_ExtensionRange_msg_init = { &google_protobuf_DescriptorProto_ExtensionRange_submsgs[0], &google_protobuf_DescriptorProto_ExtensionRange__fields[0], - UPB_SIZE(16, 24), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(16, 24), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0004000001000008, &upb_psv4_1bt}, + {0x0008000002000010, &upb_psv4_1bt}, + {0x001000000300001a, &upb_psm_1bt_max64b}, + }) }; static const upb_MiniTableField google_protobuf_DescriptorProto_ReservedRange__fields[2] = { @@ -768,7 +831,13 @@ static const upb_MiniTableField google_protobuf_DescriptorProto_ReservedRange__f const upb_MiniTable google_protobuf_DescriptorProto_ReservedRange_msg_init = { NULL, &google_protobuf_DescriptorProto_ReservedRange__fields[0], - 16, 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + 16, 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0004000001000008, &upb_psv4_1bt}, + {0x0008000002000010, &upb_psv4_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTableSub google_protobuf_ExtensionRangeOptions_submsgs[1] = { @@ -782,7 +851,41 @@ static const upb_MiniTableField google_protobuf_ExtensionRangeOptions__fields[1] const upb_MiniTable google_protobuf_ExtensionRangeOptions_msg_init = { &google_protobuf_ExtensionRangeOptions_submsgs[0], &google_protobuf_ExtensionRangeOptions__fields[0], - 8, 1, kUpb_ExtMode_Extendable, 0, 255, 0, + 8, 1, kUpb_ExtMode_Extendable, 0, UPB_FASTTABLE_MASK(248), 0, + UPB_FASTTABLE_INIT({ + {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}, + {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}, + {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}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {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}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTableSub google_protobuf_FieldDescriptorProto_submsgs[3] = { @@ -808,7 +911,41 @@ static const upb_MiniTableField google_protobuf_FieldDescriptorProto__fields[11] const upb_MiniTable google_protobuf_FieldDescriptorProto_msg_init = { &google_protobuf_FieldDescriptorProto_submsgs[0], &google_protobuf_FieldDescriptorProto__fields[0], - UPB_SIZE(72, 112), 11, kUpb_ExtMode_NonExtendable, 10, 255, 0, + UPB_SIZE(72, 112), 11, kUpb_ExtMode_NonExtendable, 10, UPB_FASTTABLE_MASK(248), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001800000100000a, &upb_psb_1bt}, + {0x0028000002000012, &upb_psb_1bt}, + {0x0004000003000018, &upb_psv4_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0038000006000032, &upb_psb_1bt}, + {0x004800000700003a, &upb_psb_1bt}, + {0x0058000008020042, &upb_psm_1bt_max64b}, + {0x0010000009000048, &upb_psv4_1bt}, + {0x006000000a000052, &upb_psb_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001400000b000188, &upb_psb1_2bt}, + {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}, + {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_MiniTableSub google_protobuf_OneofDescriptorProto_submsgs[1] = { @@ -823,7 +960,13 @@ static const upb_MiniTableField google_protobuf_OneofDescriptorProto__fields[2] const upb_MiniTable google_protobuf_OneofDescriptorProto_msg_init = { &google_protobuf_OneofDescriptorProto_submsgs[0], &google_protobuf_OneofDescriptorProto__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psb_1bt}, + {0x0018000002000012, &upb_psm_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTableSub google_protobuf_EnumDescriptorProto_submsgs[3] = { @@ -843,7 +986,17 @@ static const upb_MiniTableField google_protobuf_EnumDescriptorProto__fields[5] = const upb_MiniTable google_protobuf_EnumDescriptorProto_msg_init = { &google_protobuf_EnumDescriptorProto_submsgs[0], &google_protobuf_EnumDescriptorProto__fields[0], - UPB_SIZE(32, 56), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0, + UPB_SIZE(32, 56), 5, kUpb_ExtMode_NonExtendable, 5, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psb_1bt}, + {0x001800003f000012, &upb_prm_1bt_max64b}, + {0x002000000201001a, &upb_psm_1bt_max64b}, + {0x002800003f020022, &upb_prm_1bt_max64b}, + {0x003000003f00002a, &upb_prb_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTableField google_protobuf_EnumDescriptorProto_EnumReservedRange__fields[2] = { @@ -854,7 +1007,13 @@ static const upb_MiniTableField google_protobuf_EnumDescriptorProto_EnumReserved const upb_MiniTable google_protobuf_EnumDescriptorProto_EnumReservedRange_msg_init = { NULL, &google_protobuf_EnumDescriptorProto_EnumReservedRange__fields[0], - 16, 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + 16, 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0004000001000008, &upb_psv4_1bt}, + {0x0008000002000010, &upb_psv4_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTableSub google_protobuf_EnumValueDescriptorProto_submsgs[1] = { @@ -870,7 +1029,13 @@ static const upb_MiniTableField google_protobuf_EnumValueDescriptorProto__fields const upb_MiniTable google_protobuf_EnumValueDescriptorProto_msg_init = { &google_protobuf_EnumValueDescriptorProto_submsgs[0], &google_protobuf_EnumValueDescriptorProto__fields[0], - UPB_SIZE(24, 32), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(24, 32), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psb_1bt}, + {0x0004000002000010, &upb_psv4_1bt}, + {0x001800000300001a, &upb_psm_1bt_max64b}, + }) }; static const upb_MiniTableSub google_protobuf_ServiceDescriptorProto_submsgs[2] = { @@ -887,7 +1052,13 @@ static const upb_MiniTableField google_protobuf_ServiceDescriptorProto__fields[3 const upb_MiniTable google_protobuf_ServiceDescriptorProto_msg_init = { &google_protobuf_ServiceDescriptorProto_submsgs[0], &google_protobuf_ServiceDescriptorProto__fields[0], - UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psb_1bt}, + {0x001800003f000012, &upb_prm_1bt_max128b}, + {0x002000000201001a, &upb_psm_1bt_max64b}, + }) }; static const upb_MiniTableSub google_protobuf_MethodDescriptorProto_submsgs[1] = { @@ -906,7 +1077,17 @@ static const upb_MiniTableField google_protobuf_MethodDescriptorProto__fields[6] const upb_MiniTable google_protobuf_MethodDescriptorProto_msg_init = { &google_protobuf_MethodDescriptorProto_submsgs[0], &google_protobuf_MethodDescriptorProto__fields[0], - UPB_SIZE(40, 64), 6, kUpb_ExtMode_NonExtendable, 6, 255, 0, + UPB_SIZE(40, 64), 6, kUpb_ExtMode_NonExtendable, 6, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psb_1bt}, + {0x0018000002000012, &upb_psb_1bt}, + {0x002800000300001a, &upb_psb_1bt}, + {0x0038000004000022, &upb_psm_1bt_max64b}, + {0x0001000005000028, &upb_psb1_1bt}, + {0x0002000006000030, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTableSub google_protobuf_FileOptions_submsgs[2] = { @@ -941,25 +1122,94 @@ static const upb_MiniTableField google_protobuf_FileOptions__fields[21] = { const upb_MiniTable google_protobuf_FileOptions_msg_init = { &google_protobuf_FileOptions_submsgs[0], &google_protobuf_FileOptions__fields[0], - UPB_SIZE(104, 192), 21, kUpb_ExtMode_Extendable, 1, 255, 0, + UPB_SIZE(104, 192), 21, kUpb_ExtMode_Extendable, 1, UPB_FASTTABLE_MASK(248), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001800000100000a, &upb_psb_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0028000002000042, &upb_psb_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0008000004000050, &upb_psb1_1bt}, + {0x003800000500005a, &upb_psb_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0009000006000180, &upb_psb1_2bt}, + {0x000a000007000188, &upb_psb1_2bt}, + {0x000b000008000190, &upb_psb1_2bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000c0000090001a0, &upb_psb1_2bt}, + {0x005800000e0002aa, &upb_psb_2bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000d00000a0001b8, &upb_psb1_2bt}, + {0x00780000100002c2, &upb_psb_2bt}, + {0x00880000110002ca, &upb_psb_2bt}, + {0x00100000120002d0, &upb_psb1_2bt}, + {0x000e00000b0001d8, &upb_psb1_2bt}, + {0x00980000130002e2, &upb_psb_2bt}, + {0x00a80000140002ea, &upb_psb_2bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000f00000c0001f8, &upb_psb1_2bt}, + }) }; static const upb_MiniTableSub google_protobuf_MessageOptions_submsgs[1] = { {.submsg = &google_protobuf_UninterpretedOption_msg_init}, }; -static const upb_MiniTableField google_protobuf_MessageOptions__fields[5] = { +static const upb_MiniTableField google_protobuf_MessageOptions__fields[6] = { {1, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, {2, 2, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, {3, 3, 3, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, {7, 4, 4, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {11, 5, 5, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, {999, 8, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; const upb_MiniTable google_protobuf_MessageOptions_msg_init = { &google_protobuf_MessageOptions_submsgs[0], &google_protobuf_MessageOptions__fields[0], - 16, 5, kUpb_ExtMode_Extendable, 3, 255, 0, + 16, 6, kUpb_ExtMode_Extendable, 3, UPB_FASTTABLE_MASK(248), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0001000001000008, &upb_psb1_1bt}, + {0x0002000002000010, &upb_psb1_1bt}, + {0x0003000003000018, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0004000004000038, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0005000005000058, &upb_psb1_1bt}, + {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}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f003eba, &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}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTableSub google_protobuf_FieldOptions_submsgs[3] = { @@ -968,7 +1218,7 @@ static const upb_MiniTableSub google_protobuf_FieldOptions_submsgs[3] = { {.submsg = &google_protobuf_UninterpretedOption_msg_init}, }; -static const upb_MiniTableField google_protobuf_FieldOptions__fields[8] = { +static const upb_MiniTableField google_protobuf_FieldOptions__fields[9] = { {1, 4, 1, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, {2, 8, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, {3, 9, 3, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, @@ -976,13 +1226,48 @@ static const upb_MiniTableField google_protobuf_FieldOptions__fields[8] = { {6, 12, 5, 1, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, {10, 16, 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, {15, 17, 7, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {16, 18, 8, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, {999, UPB_SIZE(20, 24), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; const upb_MiniTable google_protobuf_FieldOptions_msg_init = { &google_protobuf_FieldOptions_submsgs[0], &google_protobuf_FieldOptions__fields[0], - UPB_SIZE(24, 32), 8, kUpb_ExtMode_Extendable, 3, 255, 0, + UPB_SIZE(24, 32), 9, kUpb_ExtMode_Extendable, 3, UPB_FASTTABLE_MASK(248), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0008000002000010, &upb_psb1_1bt}, + {0x0009000003000018, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000a000004000028, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0010000006000050, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0011000007000078, &upb_psb1_1bt}, + {0x0012000008000180, &upb_psb1_2bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001800003f023eba, &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}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTableSub google_protobuf_OneofOptions_submsgs[1] = { @@ -996,23 +1281,92 @@ static const upb_MiniTableField google_protobuf_OneofOptions__fields[1] = { const upb_MiniTable google_protobuf_OneofOptions_msg_init = { &google_protobuf_OneofOptions_submsgs[0], &google_protobuf_OneofOptions__fields[0], - 8, 1, kUpb_ExtMode_Extendable, 0, 255, 0, + 8, 1, kUpb_ExtMode_Extendable, 0, UPB_FASTTABLE_MASK(248), 0, + UPB_FASTTABLE_INIT({ + {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}, + {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}, + {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}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {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}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTableSub google_protobuf_EnumOptions_submsgs[1] = { {.submsg = &google_protobuf_UninterpretedOption_msg_init}, }; -static const upb_MiniTableField google_protobuf_EnumOptions__fields[3] = { +static const upb_MiniTableField google_protobuf_EnumOptions__fields[4] = { {2, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, {3, 2, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {6, 3, 3, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, {999, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; const upb_MiniTable google_protobuf_EnumOptions_msg_init = { &google_protobuf_EnumOptions_submsgs[0], &google_protobuf_EnumOptions__fields[0], - UPB_SIZE(8, 16), 3, kUpb_ExtMode_Extendable, 0, 255, 0, + UPB_SIZE(8, 16), 4, kUpb_ExtMode_Extendable, 0, UPB_FASTTABLE_MASK(248), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0001000001000010, &upb_psb1_1bt}, + {0x0002000002000018, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0003000003000030, &upb_psb1_1bt}, + {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}, + {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}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f003eba, &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}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTableSub google_protobuf_EnumValueOptions_submsgs[1] = { @@ -1027,7 +1381,41 @@ static const upb_MiniTableField google_protobuf_EnumValueOptions__fields[2] = { const upb_MiniTable google_protobuf_EnumValueOptions_msg_init = { &google_protobuf_EnumValueOptions_submsgs[0], &google_protobuf_EnumValueOptions__fields[0], - UPB_SIZE(8, 16), 2, kUpb_ExtMode_Extendable, 1, 255, 0, + UPB_SIZE(8, 16), 2, kUpb_ExtMode_Extendable, 1, UPB_FASTTABLE_MASK(248), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0001000001000008, &upb_psb1_1bt}, + {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}, + {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}, + {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}, + {0x000800003f003eba, &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}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTableSub google_protobuf_ServiceOptions_submsgs[1] = { @@ -1042,7 +1430,41 @@ static const upb_MiniTableField google_protobuf_ServiceOptions__fields[2] = { const upb_MiniTable google_protobuf_ServiceOptions_msg_init = { &google_protobuf_ServiceOptions_submsgs[0], &google_protobuf_ServiceOptions__fields[0], - UPB_SIZE(8, 16), 2, kUpb_ExtMode_Extendable, 0, 255, 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}, + {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}, + {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}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0001000001000288, &upb_psb1_2bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f003eba, &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}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTableSub google_protobuf_MethodOptions_submsgs[2] = { @@ -1059,7 +1481,41 @@ static const upb_MiniTableField google_protobuf_MethodOptions__fields[3] = { const upb_MiniTable google_protobuf_MethodOptions_msg_init = { &google_protobuf_MethodOptions_submsgs[0], &google_protobuf_MethodOptions__fields[0], - 16, 3, kUpb_ExtMode_Extendable, 0, 255, 0, + 16, 3, kUpb_ExtMode_Extendable, 0, UPB_FASTTABLE_MASK(248), 0, + UPB_FASTTABLE_INIT({ + {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}, + {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}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0001000001000288, &upb_psb1_2bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f013eba, &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}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTableSub google_protobuf_UninterpretedOption_submsgs[1] = { @@ -1079,7 +1535,25 @@ static const upb_MiniTableField google_protobuf_UninterpretedOption__fields[7] = const upb_MiniTable google_protobuf_UninterpretedOption_msg_init = { &google_protobuf_UninterpretedOption_submsgs[0], &google_protobuf_UninterpretedOption__fields[0], - UPB_SIZE(56, 88), 7, kUpb_ExtMode_NonExtendable, 0, 255, 0, + UPB_SIZE(56, 88), 7, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f000012, &upb_prm_1bt_max64b}, + {0x001000000100001a, &upb_psb_1bt}, + {0x0020000002000020, &upb_psv8_1bt}, + {0x0028000003000028, &upb_psv8_1bt}, + {0x0030000004000031, &upb_psf8_1bt}, + {0x003800000500003a, &upb_psb_1bt}, + {0x0048000006000042, &upb_psb_1bt}, + {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_UninterpretedOption_NamePart__fields[2] = { @@ -1090,7 +1564,13 @@ static const upb_MiniTableField google_protobuf_UninterpretedOption_NamePart__fi const upb_MiniTable google_protobuf_UninterpretedOption_NamePart_msg_init = { NULL, &google_protobuf_UninterpretedOption_NamePart__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 2, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 2, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psb_1bt}, + {0x0001000002000010, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTableSub google_protobuf_SourceCodeInfo_submsgs[1] = { @@ -1104,7 +1584,11 @@ static const upb_MiniTableField google_protobuf_SourceCodeInfo__fields[1] = { const upb_MiniTable google_protobuf_SourceCodeInfo_msg_init = { &google_protobuf_SourceCodeInfo_submsgs[0], &google_protobuf_SourceCodeInfo__fields[0], - 8, 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_prm_1bt_max128b}, + }) }; static const upb_MiniTableField google_protobuf_SourceCodeInfo_Location__fields[5] = { @@ -1118,7 +1602,17 @@ static const upb_MiniTableField google_protobuf_SourceCodeInfo_Location__fields[ const upb_MiniTable google_protobuf_SourceCodeInfo_Location_msg_init = { NULL, &google_protobuf_SourceCodeInfo_Location__fields[0], - UPB_SIZE(32, 64), 5, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(32, 64), 5, kUpb_ExtMode_NonExtendable, 4, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_ppv4_1bt}, + {0x001000003f000012, &upb_ppv4_1bt}, + {0x001800000100001a, &upb_psb_1bt}, + {0x0028000002000022, &upb_psb_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x003800003f000032, &upb_prb_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTableSub google_protobuf_GeneratedCodeInfo_submsgs[1] = { @@ -1132,7 +1626,11 @@ static const upb_MiniTableField google_protobuf_GeneratedCodeInfo__fields[1] = { const upb_MiniTable google_protobuf_GeneratedCodeInfo_msg_init = { &google_protobuf_GeneratedCodeInfo_submsgs[0], &google_protobuf_GeneratedCodeInfo__fields[0], - 8, 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_prm_1bt_max64b}, + }) }; static const upb_MiniTableSub google_protobuf_GeneratedCodeInfo_Annotation_submsgs[1] = { @@ -1150,7 +1648,17 @@ static const upb_MiniTableField google_protobuf_GeneratedCodeInfo_Annotation__fi const upb_MiniTable google_protobuf_GeneratedCodeInfo_Annotation_msg_init = { &google_protobuf_GeneratedCodeInfo_Annotation_submsgs[0], &google_protobuf_GeneratedCodeInfo_Annotation__fields[0], - UPB_SIZE(32, 40), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0, + UPB_SIZE(32, 40), 5, kUpb_ExtMode_NonExtendable, 5, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001000003f00000a, &upb_ppv4_1bt}, + {0x0018000001000012, &upb_psb_1bt}, + {0x0004000002000018, &upb_psv4_1bt}, + {0x0008000003000020, &upb_psv4_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[27] = { @@ -1275,7 +1783,7 @@ const upb_MiniTableFile google_protobuf_descriptor_proto_upb_file_layout = { * regenerated. */ -static const char descriptor[7820] = {'\n', ' ', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'd', 'e', 's', 'c', 'r', 'i', 'p', +static const char descriptor[8038] = {'\n', ' ', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'd', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', '.', 'p', 'r', 'o', 't', 'o', '\022', '\017', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '\"', 'M', '\n', '\021', 'F', 'i', 'l', 'e', 'D', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'S', 'e', 't', '\022', '8', '\n', '\004', 'f', 'i', 'l', 'e', '\030', '\001', ' ', '\003', '(', '\013', '2', '$', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', @@ -1465,7 +1973,7 @@ static const char descriptor[7820] = {'\n', ' ', 'g', 'o', 'o', 'g', 'l', 'e', ' 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', '\"', ':', '\n', '\014', 'O', 'p', 't', 'i', 'm', 'i', 'z', 'e', 'M', 'o', 'd', 'e', '\022', '\t', '\n', '\005', 'S', 'P', 'E', 'E', 'D', '\020', '\001', '\022', '\r', '\n', '\t', 'C', 'O', 'D', 'E', '_', 'S', 'I', 'Z', 'E', '\020', '\002', '\022', '\020', '\n', '\014', 'L', 'I', 'T', 'E', '_', 'R', 'U', 'N', 'T', 'I', 'M', 'E', '\020', '\003', '*', '\t', '\010', -'\350', '\007', '\020', '\200', '\200', '\200', '\200', '\002', 'J', '\004', '\010', '&', '\020', '\'', '\"', '\343', '\002', '\n', '\016', 'M', 'e', 's', 's', 'a', 'g', +'\350', '\007', '\020', '\200', '\200', '\200', '\200', '\002', 'J', '\004', '\010', '&', '\020', '\'', '\"', '\273', '\003', '\n', '\016', 'M', 'e', 's', 's', 'a', 'g', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', '<', '\n', '\027', 'm', 'e', 's', 's', 'a', 'g', 'e', '_', 's', 'e', 't', '_', 'w', 'i', 'r', 'e', '_', 'f', 'o', 'r', 'm', 'a', 't', '\030', '\001', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\024', 'm', 'e', 's', 's', 'a', 'g', 'e', 'S', 'e', 't', 'W', 'i', 'r', 'e', 'F', 'o', 'r', 'm', 'a', 't', '\022', 'L', '\n', '\037', 'n', @@ -1474,120 +1982,129 @@ static const char descriptor[7820] = {'\n', ' ', 'g', 'o', 'o', 'g', 'l', 'e', ' 'n', 'd', 'a', 'r', 'd', 'D', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'A', 'c', 'c', 'e', 's', 's', 'o', 'r', '\022', '%', '\n', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\030', '\003', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\022', '\033', '\n', '\t', 'm', 'a', 'p', '_', 'e', 'n', 't', 'r', 'y', -'\030', '\007', ' ', '\001', '(', '\010', 'R', '\010', 'm', 'a', 'p', 'E', 'n', 't', 'r', 'y', '\022', 'X', '\n', '\024', 'u', 'n', 'i', 'n', 't', -'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', '_', 'o', 'p', 't', 'i', 'o', 'n', '\030', '\347', '\007', ' ', '\003', '(', '\013', '2', '$', '.', -'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', -'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', 'R', '\023', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', -'O', 'p', 't', 'i', 'o', 'n', '*', '\t', '\010', '\350', '\007', '\020', '\200', '\200', '\200', '\200', '\002', 'J', '\004', '\010', '\004', '\020', '\005', 'J', '\004', -'\010', '\005', '\020', '\006', 'J', '\004', '\010', '\006', '\020', '\007', 'J', '\004', '\010', '\010', '\020', '\t', 'J', '\004', '\010', '\t', '\020', '\n', '\"', '\222', '\004', -'\n', '\014', 'F', 'i', 'e', 'l', 'd', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', 'A', '\n', '\005', 'c', 't', 'y', 'p', 'e', '\030', '\001', -' ', '\001', '(', '\016', '2', '#', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'F', 'i', -'e', 'l', 'd', 'O', 'p', 't', 'i', 'o', 'n', 's', '.', 'C', 'T', 'y', 'p', 'e', ':', '\006', 'S', 'T', 'R', 'I', 'N', 'G', 'R', -'\005', 'c', 't', 'y', 'p', 'e', '\022', '\026', '\n', '\006', 'p', 'a', 'c', 'k', 'e', 'd', '\030', '\002', ' ', '\001', '(', '\010', 'R', '\006', 'p', -'a', 'c', 'k', 'e', 'd', '\022', 'G', '\n', '\006', 'j', 's', 't', 'y', 'p', 'e', '\030', '\006', ' ', '\001', '(', '\016', '2', '$', '.', 'g', -'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'F', 'i', 'e', 'l', 'd', 'O', 'p', 't', 'i', 'o', -'n', 's', '.', 'J', 'S', 'T', 'y', 'p', 'e', ':', '\t', 'J', 'S', '_', 'N', 'O', 'R', 'M', 'A', 'L', 'R', '\006', 'j', 's', 't', -'y', 'p', 'e', '\022', '\031', '\n', '\004', 'l', 'a', 'z', 'y', '\030', '\005', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', -'\004', 'l', 'a', 'z', 'y', '\022', '.', '\n', '\017', 'u', 'n', 'v', 'e', 'r', 'i', 'f', 'i', 'e', 'd', '_', 'l', 'a', 'z', 'y', '\030', -'\017', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\016', 'u', 'n', 'v', 'e', 'r', 'i', 'f', 'i', 'e', 'd', 'L', -'a', 'z', 'y', '\022', '%', '\n', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\030', '\003', ' ', '\001', '(', '\010', ':', '\005', -'f', 'a', 'l', 's', 'e', 'R', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\022', '\031', '\n', '\004', 'w', 'e', 'a', 'k', -'\030', '\n', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\004', 'w', 'e', 'a', 'k', '\022', 'X', '\n', '\024', 'u', 'n', -'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', '_', 'o', 'p', 't', 'i', 'o', 'n', '\030', '\347', '\007', ' ', '\003', '(', '\013', -'2', '$', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'n', 'i', 'n', 't', 'e', -'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', 'R', '\023', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', -'t', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', '\"', '/', '\n', '\005', 'C', 'T', 'y', 'p', 'e', '\022', '\n', '\n', '\006', 'S', 'T', 'R', -'I', 'N', 'G', '\020', '\000', '\022', '\010', '\n', '\004', 'C', 'O', 'R', 'D', '\020', '\001', '\022', '\020', '\n', '\014', 'S', 'T', 'R', 'I', 'N', 'G', -'_', 'P', 'I', 'E', 'C', 'E', '\020', '\002', '\"', '5', '\n', '\006', 'J', 'S', 'T', 'y', 'p', 'e', '\022', '\r', '\n', '\t', 'J', 'S', '_', -'N', 'O', 'R', 'M', 'A', 'L', '\020', '\000', '\022', '\r', '\n', '\t', 'J', 'S', '_', 'S', 'T', 'R', 'I', 'N', 'G', '\020', '\001', '\022', '\r', -'\n', '\t', 'J', 'S', '_', 'N', 'U', 'M', 'B', 'E', 'R', '\020', '\002', '*', '\t', '\010', '\350', '\007', '\020', '\200', '\200', '\200', '\200', '\002', 'J', -'\004', '\010', '\004', '\020', '\005', '\"', 's', '\n', '\014', 'O', 'n', 'e', 'o', 'f', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', 'X', '\n', '\024', -'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', '_', 'o', 'p', 't', 'i', 'o', 'n', '\030', '\347', '\007', ' ', '\003', -'(', '\013', '2', '$', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'n', 'i', 'n', -'t', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', 'R', '\023', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', -'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', '*', '\t', '\010', '\350', '\007', '\020', '\200', '\200', '\200', '\200', '\002', '\"', '\300', '\001', -'\n', '\013', 'E', 'n', 'u', 'm', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', '\037', '\n', '\013', 'a', 'l', 'l', 'o', 'w', '_', 'a', 'l', -'i', 'a', 's', '\030', '\002', ' ', '\001', '(', '\010', 'R', '\n', 'a', 'l', 'l', 'o', 'w', 'A', 'l', 'i', 'a', 's', '\022', '%', '\n', '\n', -'d', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\030', '\003', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\n', -'d', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\022', 'X', '\n', '\024', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', -'e', 'd', '_', 'o', 'p', 't', 'i', 'o', 'n', '\030', '\347', '\007', ' ', '\003', '(', '\013', '2', '$', '.', 'g', 'o', 'o', 'g', 'l', 'e', -'.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', -'t', 'i', 'o', 'n', 'R', '\023', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', -'*', '\t', '\010', '\350', '\007', '\020', '\200', '\200', '\200', '\200', '\002', 'J', '\004', '\010', '\005', '\020', '\006', '\"', '\236', '\001', '\n', '\020', 'E', 'n', 'u', -'m', 'V', 'a', 'l', 'u', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', '%', '\n', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', -'e', 'd', '\030', '\001', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', -'e', 'd', '\022', 'X', '\n', '\024', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', '_', 'o', 'p', 't', 'i', 'o', +'\030', '\007', ' ', '\001', '(', '\010', 'R', '\010', 'm', 'a', 'p', 'E', 'n', 't', 'r', 'y', '\022', 'V', '\n', '&', 'd', 'e', 'p', 'r', 'e', +'c', 'a', 't', 'e', 'd', '_', 'l', 'e', 'g', 'a', 'c', 'y', '_', 'j', 's', 'o', 'n', '_', 'f', 'i', 'e', 'l', 'd', '_', 'c', +'o', 'n', 'f', 'l', 'i', 'c', 't', 's', '\030', '\013', ' ', '\001', '(', '\010', 'B', '\002', '\030', '\001', 'R', '\"', 'd', 'e', 'p', 'r', 'e', +'c', 'a', 't', 'e', 'd', 'L', 'e', 'g', 'a', 'c', 'y', 'J', 's', 'o', 'n', 'F', 'i', 'e', 'l', 'd', 'C', 'o', 'n', 'f', 'l', +'i', 'c', 't', 's', '\022', 'X', '\n', '\024', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', '_', 'o', 'p', 't', +'i', 'o', 'n', '\030', '\347', '\007', ' ', '\003', '(', '\013', '2', '$', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', +'b', 'u', 'f', '.', 'U', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', 'R', '\023', +'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', '*', '\t', '\010', '\350', '\007', '\020', +'\200', '\200', '\200', '\200', '\002', 'J', '\004', '\010', '\004', '\020', '\005', 'J', '\004', '\010', '\005', '\020', '\006', 'J', '\004', '\010', '\006', '\020', '\007', 'J', '\004', +'\010', '\010', '\020', '\t', 'J', '\004', '\010', '\t', '\020', '\n', '\"', '\274', '\004', '\n', '\014', 'F', 'i', 'e', 'l', 'd', 'O', 'p', 't', 'i', 'o', +'n', 's', '\022', 'A', '\n', '\005', 'c', 't', 'y', 'p', 'e', '\030', '\001', ' ', '\001', '(', '\016', '2', '#', '.', 'g', 'o', 'o', 'g', 'l', +'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'F', 'i', 'e', 'l', 'd', 'O', 'p', 't', 'i', 'o', 'n', 's', '.', 'C', +'T', 'y', 'p', 'e', ':', '\006', 'S', 'T', 'R', 'I', 'N', 'G', 'R', '\005', 'c', 't', 'y', 'p', 'e', '\022', '\026', '\n', '\006', 'p', 'a', +'c', 'k', 'e', 'd', '\030', '\002', ' ', '\001', '(', '\010', 'R', '\006', 'p', 'a', 'c', 'k', 'e', 'd', '\022', 'G', '\n', '\006', 'j', 's', 't', +'y', 'p', 'e', '\030', '\006', ' ', '\001', '(', '\016', '2', '$', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', +'u', 'f', '.', 'F', 'i', 'e', 'l', 'd', 'O', 'p', 't', 'i', 'o', 'n', 's', '.', 'J', 'S', 'T', 'y', 'p', 'e', ':', '\t', 'J', +'S', '_', 'N', 'O', 'R', 'M', 'A', 'L', 'R', '\006', 'j', 's', 't', 'y', 'p', 'e', '\022', '\031', '\n', '\004', 'l', 'a', 'z', 'y', '\030', +'\005', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\004', 'l', 'a', 'z', 'y', '\022', '.', '\n', '\017', 'u', 'n', 'v', +'e', 'r', 'i', 'f', 'i', 'e', 'd', '_', 'l', 'a', 'z', 'y', '\030', '\017', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', +'R', '\016', 'u', 'n', 'v', 'e', 'r', 'i', 'f', 'i', 'e', 'd', 'L', 'a', 'z', 'y', '\022', '%', '\n', '\n', 'd', 'e', 'p', 'r', 'e', +'c', 'a', 't', 'e', 'd', '\030', '\003', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\n', 'd', 'e', 'p', 'r', 'e', +'c', 'a', 't', 'e', 'd', '\022', '\031', '\n', '\004', 'w', 'e', 'a', 'k', '\030', '\n', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', +'e', 'R', '\004', 'w', 'e', 'a', 'k', '\022', '(', '\n', '\014', 'd', 'e', 'b', 'u', 'g', '_', 'r', 'e', 'd', 'a', 'c', 't', '\030', '\020', +' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\013', 'd', 'e', 'b', 'u', 'g', 'R', 'e', 'd', 'a', 'c', 't', '\022', +'X', '\n', '\024', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', '_', 'o', 'p', 't', 'i', 'o', 'n', '\030', '\347', +'\007', ' ', '\003', '(', '\013', '2', '$', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', +'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', 'R', '\023', 'u', 'n', 'i', 'n', 't', +'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', '\"', '/', '\n', '\005', 'C', 'T', 'y', 'p', 'e', '\022', '\n', +'\n', '\006', 'S', 'T', 'R', 'I', 'N', 'G', '\020', '\000', '\022', '\010', '\n', '\004', 'C', 'O', 'R', 'D', '\020', '\001', '\022', '\020', '\n', '\014', 'S', +'T', 'R', 'I', 'N', 'G', '_', 'P', 'I', 'E', 'C', 'E', '\020', '\002', '\"', '5', '\n', '\006', 'J', 'S', 'T', 'y', 'p', 'e', '\022', '\r', +'\n', '\t', 'J', 'S', '_', 'N', 'O', 'R', 'M', 'A', 'L', '\020', '\000', '\022', '\r', '\n', '\t', 'J', 'S', '_', 'S', 'T', 'R', 'I', 'N', +'G', '\020', '\001', '\022', '\r', '\n', '\t', 'J', 'S', '_', 'N', 'U', 'M', 'B', 'E', 'R', '\020', '\002', '*', '\t', '\010', '\350', '\007', '\020', '\200', +'\200', '\200', '\200', '\002', 'J', '\004', '\010', '\004', '\020', '\005', '\"', 's', '\n', '\014', 'O', 'n', 'e', 'o', 'f', 'O', 'p', 't', 'i', 'o', 'n', +'s', '\022', 'X', '\n', '\024', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', '_', 'o', 'p', 't', 'i', 'o', 'n', +'\030', '\347', '\007', ' ', '\003', '(', '\013', '2', '$', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', +'.', 'U', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', 'R', '\023', 'u', 'n', 'i', +'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', '*', '\t', '\010', '\350', '\007', '\020', '\200', '\200', '\200', +'\200', '\002', '\"', '\230', '\002', '\n', '\013', 'E', 'n', 'u', 'm', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', '\037', '\n', '\013', 'a', 'l', 'l', +'o', 'w', '_', 'a', 'l', 'i', 'a', 's', '\030', '\002', ' ', '\001', '(', '\010', 'R', '\n', 'a', 'l', 'l', 'o', 'w', 'A', 'l', 'i', 'a', +'s', '\022', '%', '\n', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\030', '\003', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', +'l', 's', 'e', 'R', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\022', 'V', '\n', '&', 'd', 'e', 'p', 'r', 'e', 'c', +'a', 't', 'e', 'd', '_', 'l', 'e', 'g', 'a', 'c', 'y', '_', 'j', 's', 'o', 'n', '_', 'f', 'i', 'e', 'l', 'd', '_', 'c', 'o', +'n', 'f', 'l', 'i', 'c', 't', 's', '\030', '\006', ' ', '\001', '(', '\010', 'B', '\002', '\030', '\001', 'R', '\"', 'd', 'e', 'p', 'r', 'e', 'c', +'a', 't', 'e', 'd', 'L', 'e', 'g', 'a', 'c', 'y', 'J', 's', 'o', 'n', 'F', 'i', 'e', 'l', 'd', 'C', 'o', 'n', 'f', 'l', 'i', +'c', 't', 's', '\022', 'X', '\n', '\024', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', '_', 'o', 'p', 't', 'i', +'o', 'n', '\030', '\347', '\007', ' ', '\003', '(', '\013', '2', '$', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', +'u', 'f', '.', 'U', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', 'R', '\023', 'u', +'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', '*', '\t', '\010', '\350', '\007', '\020', '\200', +'\200', '\200', '\200', '\002', 'J', '\004', '\010', '\005', '\020', '\006', '\"', '\236', '\001', '\n', '\020', 'E', 'n', 'u', 'm', 'V', 'a', 'l', 'u', 'e', 'O', +'p', 't', 'i', 'o', 'n', 's', '\022', '%', '\n', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\030', '\001', ' ', '\001', '(', +'\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\022', 'X', '\n', '\024', 'u', +'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', '_', 'o', 'p', 't', 'i', 'o', 'n', '\030', '\347', '\007', ' ', '\003', '(', +'\013', '2', '$', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'n', 'i', 'n', 't', +'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', 'R', '\023', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', +'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', '*', '\t', '\010', '\350', '\007', '\020', '\200', '\200', '\200', '\200', '\002', '\"', '\234', '\001', '\n', +'\016', 'S', 'e', 'r', 'v', 'i', 'c', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', '%', '\n', '\n', 'd', 'e', 'p', 'r', 'e', 'c', +'a', 't', 'e', 'd', '\030', '!', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\n', 'd', 'e', 'p', 'r', 'e', 'c', +'a', 't', 'e', 'd', '\022', 'X', '\n', '\024', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', '_', 'o', 'p', 't', +'i', 'o', 'n', '\030', '\347', '\007', ' ', '\003', '(', '\013', '2', '$', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', +'b', 'u', 'f', '.', 'U', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', 'R', '\023', +'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', '*', '\t', '\010', '\350', '\007', '\020', +'\200', '\200', '\200', '\200', '\002', '\"', '\340', '\002', '\n', '\r', 'M', 'e', 't', 'h', 'o', 'd', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', '%', +'\n', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\030', '!', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', +'R', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\022', 'q', '\n', '\021', 'i', 'd', 'e', 'm', 'p', 'o', 't', 'e', 'n', +'c', 'y', '_', 'l', 'e', 'v', 'e', 'l', '\030', '\"', ' ', '\001', '(', '\016', '2', '/', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', +'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'M', 'e', 't', 'h', 'o', 'd', 'O', 'p', 't', 'i', 'o', 'n', 's', '.', 'I', 'd', 'e', +'m', 'p', 'o', 't', 'e', 'n', 'c', 'y', 'L', 'e', 'v', 'e', 'l', ':', '\023', 'I', 'D', 'E', 'M', 'P', 'O', 'T', 'E', 'N', 'C', +'Y', '_', 'U', 'N', 'K', 'N', 'O', 'W', 'N', 'R', '\020', 'i', 'd', 'e', 'm', 'p', 'o', 't', 'e', 'n', 'c', 'y', 'L', 'e', 'v', +'e', 'l', '\022', 'X', '\n', '\024', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', '_', 'o', 'p', 't', 'i', 'o', 'n', '\030', '\347', '\007', ' ', '\003', '(', '\013', '2', '$', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', 'R', '\023', 'u', 'n', -'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', '*', '\t', '\010', '\350', '\007', '\020', '\200', '\200', -'\200', '\200', '\002', '\"', '\234', '\001', '\n', '\016', 'S', 'e', 'r', 'v', 'i', 'c', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', '%', '\n', -'\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\030', '!', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', -'\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\022', 'X', '\n', '\024', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', -'t', 'e', 'd', '_', 'o', 'p', 't', 'i', 'o', 'n', '\030', '\347', '\007', ' ', '\003', '(', '\013', '2', '$', '.', 'g', 'o', 'o', 'g', 'l', -'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', -'p', 't', 'i', 'o', 'n', 'R', '\023', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', -'n', '*', '\t', '\010', '\350', '\007', '\020', '\200', '\200', '\200', '\200', '\002', '\"', '\340', '\002', '\n', '\r', 'M', 'e', 't', 'h', 'o', 'd', 'O', 'p', -'t', 'i', 'o', 'n', 's', '\022', '%', '\n', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\030', '!', ' ', '\001', '(', '\010', -':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\022', 'q', '\n', '\021', 'i', 'd', -'e', 'm', 'p', 'o', 't', 'e', 'n', 'c', 'y', '_', 'l', 'e', 'v', 'e', 'l', '\030', '\"', ' ', '\001', '(', '\016', '2', '/', '.', 'g', -'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'M', 'e', 't', 'h', 'o', 'd', 'O', 'p', 't', 'i', -'o', 'n', 's', '.', 'I', 'd', 'e', 'm', 'p', 'o', 't', 'e', 'n', 'c', 'y', 'L', 'e', 'v', 'e', 'l', ':', '\023', 'I', 'D', 'E', -'M', 'P', 'O', 'T', 'E', 'N', 'C', 'Y', '_', 'U', 'N', 'K', 'N', 'O', 'W', 'N', 'R', '\020', 'i', 'd', 'e', 'm', 'p', 'o', 't', -'e', 'n', 'c', 'y', 'L', 'e', 'v', 'e', 'l', '\022', 'X', '\n', '\024', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', -'d', '_', 'o', 'p', 't', 'i', 'o', 'n', '\030', '\347', '\007', ' ', '\003', '(', '\013', '2', '$', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', -'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', -'i', 'o', 'n', 'R', '\023', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', '\"', -'P', '\n', '\020', 'I', 'd', 'e', 'm', 'p', 'o', 't', 'e', 'n', 'c', 'y', 'L', 'e', 'v', 'e', 'l', '\022', '\027', '\n', '\023', 'I', 'D', -'E', 'M', 'P', 'O', 'T', 'E', 'N', 'C', 'Y', '_', 'U', 'N', 'K', 'N', 'O', 'W', 'N', '\020', '\000', '\022', '\023', '\n', '\017', 'N', 'O', -'_', 'S', 'I', 'D', 'E', '_', 'E', 'F', 'F', 'E', 'C', 'T', 'S', '\020', '\001', '\022', '\016', '\n', '\n', 'I', 'D', 'E', 'M', 'P', 'O', -'T', 'E', 'N', 'T', '\020', '\002', '*', '\t', '\010', '\350', '\007', '\020', '\200', '\200', '\200', '\200', '\002', '\"', '\232', '\003', '\n', '\023', 'U', 'n', 'i', -'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', '\022', 'A', '\n', '\004', 'n', 'a', 'm', 'e', '\030', -'\002', ' ', '\003', '(', '\013', '2', '-', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', -'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', '.', 'N', 'a', 'm', 'e', 'P', 'a', -'r', 't', 'R', '\004', 'n', 'a', 'm', 'e', '\022', ')', '\n', '\020', 'i', 'd', 'e', 'n', 't', 'i', 'f', 'i', 'e', 'r', '_', 'v', 'a', -'l', 'u', 'e', '\030', '\003', ' ', '\001', '(', '\t', 'R', '\017', 'i', 'd', 'e', 'n', 't', 'i', 'f', 'i', 'e', 'r', 'V', 'a', 'l', 'u', -'e', '\022', ',', '\n', '\022', 'p', 'o', 's', 'i', 't', 'i', 'v', 'e', '_', 'i', 'n', 't', '_', 'v', 'a', 'l', 'u', 'e', '\030', '\004', -' ', '\001', '(', '\004', 'R', '\020', 'p', 'o', 's', 'i', 't', 'i', 'v', 'e', 'I', 'n', 't', 'V', 'a', 'l', 'u', 'e', '\022', ',', '\n', -'\022', 'n', 'e', 'g', 'a', 't', 'i', 'v', 'e', '_', 'i', 'n', 't', '_', 'v', 'a', 'l', 'u', 'e', '\030', '\005', ' ', '\001', '(', '\003', -'R', '\020', 'n', 'e', 'g', 'a', 't', 'i', 'v', 'e', 'I', 'n', 't', 'V', 'a', 'l', 'u', 'e', '\022', '!', '\n', '\014', 'd', 'o', 'u', -'b', 'l', 'e', '_', 'v', 'a', 'l', 'u', 'e', '\030', '\006', ' ', '\001', '(', '\001', 'R', '\013', 'd', 'o', 'u', 'b', 'l', 'e', 'V', 'a', -'l', 'u', 'e', '\022', '!', '\n', '\014', 's', 't', 'r', 'i', 'n', 'g', '_', 'v', 'a', 'l', 'u', 'e', '\030', '\007', ' ', '\001', '(', '\014', -'R', '\013', 's', 't', 'r', 'i', 'n', 'g', 'V', 'a', 'l', 'u', 'e', '\022', '\'', '\n', '\017', 'a', 'g', 'g', 'r', 'e', 'g', 'a', 't', -'e', '_', 'v', 'a', 'l', 'u', 'e', '\030', '\010', ' ', '\001', '(', '\t', 'R', '\016', 'a', 'g', 'g', 'r', 'e', 'g', 'a', 't', 'e', 'V', -'a', 'l', 'u', 'e', '\032', 'J', '\n', '\010', 'N', 'a', 'm', 'e', 'P', 'a', 'r', 't', '\022', '\033', '\n', '\t', 'n', 'a', 'm', 'e', '_', -'p', 'a', 'r', 't', '\030', '\001', ' ', '\002', '(', '\t', 'R', '\010', 'n', 'a', 'm', 'e', 'P', 'a', 'r', 't', '\022', '!', '\n', '\014', 'i', -'s', '_', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', '\030', '\002', ' ', '\002', '(', '\010', 'R', '\013', 'i', 's', 'E', 'x', 't', 'e', -'n', 's', 'i', 'o', 'n', '\"', '\247', '\002', '\n', '\016', 'S', 'o', 'u', 'r', 'c', 'e', 'C', 'o', 'd', 'e', 'I', 'n', 'f', 'o', '\022', -'D', '\n', '\010', 'l', 'o', 'c', 'a', 't', 'i', 'o', 'n', '\030', '\001', ' ', '\003', '(', '\013', '2', '(', '.', 'g', 'o', 'o', 'g', 'l', -'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'S', 'o', 'u', 'r', 'c', 'e', 'C', 'o', 'd', 'e', 'I', 'n', 'f', 'o', -'.', 'L', 'o', 'c', 'a', 't', 'i', 'o', 'n', 'R', '\010', 'l', 'o', 'c', 'a', 't', 'i', 'o', 'n', '\032', '\316', '\001', '\n', '\010', 'L', -'o', 'c', 'a', 't', 'i', 'o', 'n', '\022', '\026', '\n', '\004', 'p', 'a', 't', 'h', '\030', '\001', ' ', '\003', '(', '\005', 'B', '\002', '\020', '\001', -'R', '\004', 'p', 'a', 't', 'h', '\022', '\026', '\n', '\004', 's', 'p', 'a', 'n', '\030', '\002', ' ', '\003', '(', '\005', 'B', '\002', '\020', '\001', 'R', -'\004', 's', 'p', 'a', 'n', '\022', ')', '\n', '\020', 'l', 'e', 'a', 'd', 'i', 'n', 'g', '_', 'c', 'o', 'm', 'm', 'e', 'n', 't', 's', -'\030', '\003', ' ', '\001', '(', '\t', 'R', '\017', 'l', 'e', 'a', 'd', 'i', 'n', 'g', 'C', 'o', 'm', 'm', 'e', 'n', 't', 's', '\022', '+', -'\n', '\021', 't', 'r', 'a', 'i', 'l', 'i', 'n', 'g', '_', 'c', 'o', 'm', 'm', 'e', 'n', 't', 's', '\030', '\004', ' ', '\001', '(', '\t', -'R', '\020', 't', 'r', 'a', 'i', 'l', 'i', 'n', 'g', 'C', 'o', 'm', 'm', 'e', 'n', 't', 's', '\022', ':', '\n', '\031', 'l', 'e', 'a', -'d', 'i', 'n', 'g', '_', 'd', 'e', 't', 'a', 'c', 'h', 'e', 'd', '_', 'c', 'o', 'm', 'm', 'e', 'n', 't', 's', '\030', '\006', ' ', -'\003', '(', '\t', 'R', '\027', 'l', 'e', 'a', 'd', 'i', 'n', 'g', 'D', 'e', 't', 'a', 'c', 'h', 'e', 'd', 'C', 'o', 'm', 'm', 'e', -'n', 't', 's', '\"', '\320', '\002', '\n', '\021', 'G', 'e', 'n', 'e', 'r', 'a', 't', 'e', 'd', 'C', 'o', 'd', 'e', 'I', 'n', 'f', 'o', -'\022', 'M', '\n', '\n', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', '\030', '\001', ' ', '\003', '(', '\013', '2', '-', '.', 'g', 'o', -'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'G', 'e', 'n', 'e', 'r', 'a', 't', 'e', 'd', 'C', 'o', -'d', 'e', 'I', 'n', 'f', 'o', '.', 'A', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 'R', '\n', 'a', 'n', 'n', 'o', 't', 'a', -'t', 'i', 'o', 'n', '\032', '\353', '\001', '\n', '\n', 'A', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', '\022', '\026', '\n', '\004', 'p', 'a', -'t', 'h', '\030', '\001', ' ', '\003', '(', '\005', 'B', '\002', '\020', '\001', 'R', '\004', 'p', 'a', 't', 'h', '\022', '\037', '\n', '\013', 's', 'o', 'u', -'r', 'c', 'e', '_', 'f', 'i', 'l', 'e', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\n', 's', 'o', 'u', 'r', 'c', 'e', 'F', 'i', 'l', -'e', '\022', '\024', '\n', '\005', 'b', 'e', 'g', 'i', 'n', '\030', '\003', ' ', '\001', '(', '\005', 'R', '\005', 'b', 'e', 'g', 'i', 'n', '\022', '\020', -'\n', '\003', 'e', 'n', 'd', '\030', '\004', ' ', '\001', '(', '\005', 'R', '\003', 'e', 'n', 'd', '\022', 'R', '\n', '\010', 's', 'e', 'm', 'a', 'n', -'t', 'i', 'c', '\030', '\005', ' ', '\001', '(', '\016', '2', '6', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', -'u', 'f', '.', 'G', 'e', 'n', 'e', 'r', 'a', 't', 'e', 'd', 'C', 'o', 'd', 'e', 'I', 'n', 'f', 'o', '.', 'A', 'n', 'n', 'o', -'t', 'a', 't', 'i', 'o', 'n', '.', 'S', 'e', 'm', 'a', 'n', 't', 'i', 'c', 'R', '\010', 's', 'e', 'm', 'a', 'n', 't', 'i', 'c', -'\"', '(', '\n', '\010', 'S', 'e', 'm', 'a', 'n', 't', 'i', 'c', '\022', '\010', '\n', '\004', 'N', 'O', 'N', 'E', '\020', '\000', '\022', '\007', '\n', -'\003', 'S', 'E', 'T', '\020', '\001', '\022', '\t', '\n', '\005', 'A', 'L', 'I', 'A', 'S', '\020', '\002', 'B', '~', '\n', '\023', 'c', 'o', 'm', '.', -'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', 'B', '\020', 'D', 'e', 's', 'c', 'r', 'i', 'p', 't', -'o', 'r', 'P', 'r', 'o', 't', 'o', 's', 'H', '\001', 'Z', '-', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'g', 'o', 'l', 'a', 'n', 'g', -'.', 'o', 'r', 'g', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 't', 'y', 'p', 'e', 's', '/', 'd', 'e', 's', 'c', 'r', -'i', 'p', 't', 'o', 'r', 'p', 'b', '\370', '\001', '\001', '\242', '\002', '\003', 'G', 'P', 'B', '\252', '\002', '\032', 'G', 'o', 'o', 'g', 'l', 'e', -'.', 'P', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'R', 'e', 'f', 'l', 'e', 'c', 't', 'i', 'o', 'n', +'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', '\"', 'P', '\n', '\020', 'I', 'd', 'e', 'm', +'p', 'o', 't', 'e', 'n', 'c', 'y', 'L', 'e', 'v', 'e', 'l', '\022', '\027', '\n', '\023', 'I', 'D', 'E', 'M', 'P', 'O', 'T', 'E', 'N', +'C', 'Y', '_', 'U', 'N', 'K', 'N', 'O', 'W', 'N', '\020', '\000', '\022', '\023', '\n', '\017', 'N', 'O', '_', 'S', 'I', 'D', 'E', '_', 'E', +'F', 'F', 'E', 'C', 'T', 'S', '\020', '\001', '\022', '\016', '\n', '\n', 'I', 'D', 'E', 'M', 'P', 'O', 'T', 'E', 'N', 'T', '\020', '\002', '*', +'\t', '\010', '\350', '\007', '\020', '\200', '\200', '\200', '\200', '\002', '\"', '\232', '\003', '\n', '\023', 'U', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', +'t', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', '\022', 'A', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\002', ' ', '\003', '(', '\013', '2', '-', +'.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'n', 'i', 'n', 't', 'e', 'r', 'p', +'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', '.', 'N', 'a', 'm', 'e', 'P', 'a', 'r', 't', 'R', '\004', 'n', 'a', 'm', +'e', '\022', ')', '\n', '\020', 'i', 'd', 'e', 'n', 't', 'i', 'f', 'i', 'e', 'r', '_', 'v', 'a', 'l', 'u', 'e', '\030', '\003', ' ', '\001', +'(', '\t', 'R', '\017', 'i', 'd', 'e', 'n', 't', 'i', 'f', 'i', 'e', 'r', 'V', 'a', 'l', 'u', 'e', '\022', ',', '\n', '\022', 'p', 'o', +'s', 'i', 't', 'i', 'v', 'e', '_', 'i', 'n', 't', '_', 'v', 'a', 'l', 'u', 'e', '\030', '\004', ' ', '\001', '(', '\004', 'R', '\020', 'p', +'o', 's', 'i', 't', 'i', 'v', 'e', 'I', 'n', 't', 'V', 'a', 'l', 'u', 'e', '\022', ',', '\n', '\022', 'n', 'e', 'g', 'a', 't', 'i', +'v', 'e', '_', 'i', 'n', 't', '_', 'v', 'a', 'l', 'u', 'e', '\030', '\005', ' ', '\001', '(', '\003', 'R', '\020', 'n', 'e', 'g', 'a', 't', +'i', 'v', 'e', 'I', 'n', 't', 'V', 'a', 'l', 'u', 'e', '\022', '!', '\n', '\014', 'd', 'o', 'u', 'b', 'l', 'e', '_', 'v', 'a', 'l', +'u', 'e', '\030', '\006', ' ', '\001', '(', '\001', 'R', '\013', 'd', 'o', 'u', 'b', 'l', 'e', 'V', 'a', 'l', 'u', 'e', '\022', '!', '\n', '\014', +'s', 't', 'r', 'i', 'n', 'g', '_', 'v', 'a', 'l', 'u', 'e', '\030', '\007', ' ', '\001', '(', '\014', 'R', '\013', 's', 't', 'r', 'i', 'n', +'g', 'V', 'a', 'l', 'u', 'e', '\022', '\'', '\n', '\017', 'a', 'g', 'g', 'r', 'e', 'g', 'a', 't', 'e', '_', 'v', 'a', 'l', 'u', 'e', +'\030', '\010', ' ', '\001', '(', '\t', 'R', '\016', 'a', 'g', 'g', 'r', 'e', 'g', 'a', 't', 'e', 'V', 'a', 'l', 'u', 'e', '\032', 'J', '\n', +'\010', 'N', 'a', 'm', 'e', 'P', 'a', 'r', 't', '\022', '\033', '\n', '\t', 'n', 'a', 'm', 'e', '_', 'p', 'a', 'r', 't', '\030', '\001', ' ', +'\002', '(', '\t', 'R', '\010', 'n', 'a', 'm', 'e', 'P', 'a', 'r', 't', '\022', '!', '\n', '\014', 'i', 's', '_', 'e', 'x', 't', 'e', 'n', +'s', 'i', 'o', 'n', '\030', '\002', ' ', '\002', '(', '\010', 'R', '\013', 'i', 's', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', '\"', '\247', +'\002', '\n', '\016', 'S', 'o', 'u', 'r', 'c', 'e', 'C', 'o', 'd', 'e', 'I', 'n', 'f', 'o', '\022', 'D', '\n', '\010', 'l', 'o', 'c', 'a', +'t', 'i', 'o', 'n', '\030', '\001', ' ', '\003', '(', '\013', '2', '(', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', +'b', 'u', 'f', '.', 'S', 'o', 'u', 'r', 'c', 'e', 'C', 'o', 'd', 'e', 'I', 'n', 'f', 'o', '.', 'L', 'o', 'c', 'a', 't', 'i', +'o', 'n', 'R', '\010', 'l', 'o', 'c', 'a', 't', 'i', 'o', 'n', '\032', '\316', '\001', '\n', '\010', 'L', 'o', 'c', 'a', 't', 'i', 'o', 'n', +'\022', '\026', '\n', '\004', 'p', 'a', 't', 'h', '\030', '\001', ' ', '\003', '(', '\005', 'B', '\002', '\020', '\001', 'R', '\004', 'p', 'a', 't', 'h', '\022', +'\026', '\n', '\004', 's', 'p', 'a', 'n', '\030', '\002', ' ', '\003', '(', '\005', 'B', '\002', '\020', '\001', 'R', '\004', 's', 'p', 'a', 'n', '\022', ')', +'\n', '\020', 'l', 'e', 'a', 'd', 'i', 'n', 'g', '_', 'c', 'o', 'm', 'm', 'e', 'n', 't', 's', '\030', '\003', ' ', '\001', '(', '\t', 'R', +'\017', 'l', 'e', 'a', 'd', 'i', 'n', 'g', 'C', 'o', 'm', 'm', 'e', 'n', 't', 's', '\022', '+', '\n', '\021', 't', 'r', 'a', 'i', 'l', +'i', 'n', 'g', '_', 'c', 'o', 'm', 'm', 'e', 'n', 't', 's', '\030', '\004', ' ', '\001', '(', '\t', 'R', '\020', 't', 'r', 'a', 'i', 'l', +'i', 'n', 'g', 'C', 'o', 'm', 'm', 'e', 'n', 't', 's', '\022', ':', '\n', '\031', 'l', 'e', 'a', 'd', 'i', 'n', 'g', '_', 'd', 'e', +'t', 'a', 'c', 'h', 'e', 'd', '_', 'c', 'o', 'm', 'm', 'e', 'n', 't', 's', '\030', '\006', ' ', '\003', '(', '\t', 'R', '\027', 'l', 'e', +'a', 'd', 'i', 'n', 'g', 'D', 'e', 't', 'a', 'c', 'h', 'e', 'd', 'C', 'o', 'm', 'm', 'e', 'n', 't', 's', '\"', '\320', '\002', '\n', +'\021', 'G', 'e', 'n', 'e', 'r', 'a', 't', 'e', 'd', 'C', 'o', 'd', 'e', 'I', 'n', 'f', 'o', '\022', 'M', '\n', '\n', 'a', 'n', 'n', +'o', 't', 'a', 't', 'i', 'o', 'n', '\030', '\001', ' ', '\003', '(', '\013', '2', '-', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', +'o', 't', 'o', 'b', 'u', 'f', '.', 'G', 'e', 'n', 'e', 'r', 'a', 't', 'e', 'd', 'C', 'o', 'd', 'e', 'I', 'n', 'f', 'o', '.', +'A', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 'R', '\n', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', '\032', '\353', '\001', +'\n', '\n', 'A', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', '\022', '\026', '\n', '\004', 'p', 'a', 't', 'h', '\030', '\001', ' ', '\003', '(', +'\005', 'B', '\002', '\020', '\001', 'R', '\004', 'p', 'a', 't', 'h', '\022', '\037', '\n', '\013', 's', 'o', 'u', 'r', 'c', 'e', '_', 'f', 'i', 'l', +'e', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\n', 's', 'o', 'u', 'r', 'c', 'e', 'F', 'i', 'l', 'e', '\022', '\024', '\n', '\005', 'b', 'e', +'g', 'i', 'n', '\030', '\003', ' ', '\001', '(', '\005', 'R', '\005', 'b', 'e', 'g', 'i', 'n', '\022', '\020', '\n', '\003', 'e', 'n', 'd', '\030', '\004', +' ', '\001', '(', '\005', 'R', '\003', 'e', 'n', 'd', '\022', 'R', '\n', '\010', 's', 'e', 'm', 'a', 'n', 't', 'i', 'c', '\030', '\005', ' ', '\001', +'(', '\016', '2', '6', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'G', 'e', 'n', 'e', +'r', 'a', 't', 'e', 'd', 'C', 'o', 'd', 'e', 'I', 'n', 'f', 'o', '.', 'A', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', '.', +'S', 'e', 'm', 'a', 'n', 't', 'i', 'c', 'R', '\010', 's', 'e', 'm', 'a', 'n', 't', 'i', 'c', '\"', '(', '\n', '\010', 'S', 'e', 'm', +'a', 'n', 't', 'i', 'c', '\022', '\010', '\n', '\004', 'N', 'O', 'N', 'E', '\020', '\000', '\022', '\007', '\n', '\003', 'S', 'E', 'T', '\020', '\001', '\022', +'\t', '\n', '\005', 'A', 'L', 'I', 'A', 'S', '\020', '\002', 'B', '~', '\n', '\023', 'c', 'o', 'm', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', +'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', 'B', '\020', 'D', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'P', 'r', 'o', 't', 'o', +'s', 'H', '\001', 'Z', '-', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'g', 'o', 'l', 'a', 'n', 'g', '.', 'o', 'r', 'g', '/', 'p', 'r', +'o', 't', 'o', 'b', 'u', 'f', '/', 't', 'y', 'p', 'e', 's', '/', 'd', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'p', 'b', +'\370', '\001', '\001', '\242', '\002', '\003', 'G', 'P', 'B', '\252', '\002', '\032', 'G', 'o', 'o', 'g', 'l', 'e', '.', 'P', 'r', 'o', 't', 'o', 'b', +'u', 'f', '.', 'R', 'e', 'f', 'l', 'e', 'c', 't', 'i', 'o', 'n', }; static _upb_DefPool_Init *deps[1] = { @@ -1598,7 +2115,7 @@ _upb_DefPool_Init google_protobuf_descriptor_proto_upbdefinit = { deps, &google_protobuf_descriptor_proto_upb_file_layout, "google/protobuf/descriptor.proto", - UPB_STRINGVIEW_INIT(descriptor, 7820) + UPB_STRINGVIEW_INIT(descriptor, 8038) }; @@ -4391,6 +4908,12 @@ static void jsonenc_value(jsonenc* e, const upb_Message* msg, jsonenc_putstr(e, "null"); break; case 2: + if (upb_JsonEncode_HandleSpecialDoubles(e, val.double_val)) { + jsonenc_err( + e, + "google.protobuf.Value cannot encode double values for " + "infinity or nan, because they would be parsed as a string"); + } upb_JsonEncode_Double(e, val.double_val); break; case 3: @@ -5194,7 +5717,7 @@ upb_GetExtensionAsBytes_Status upb_MiniTable_GetExtensionAsBytes( return kUpb_GetExtensionAsBytes_Ok; } -upb_FindUnknownRet upb_FindUnknownRet_ParseError() { +static upb_FindUnknownRet upb_FindUnknownRet_ParseError(void) { return (upb_FindUnknownRet){.status = kUpb_FindUnknown_ParseError}; } @@ -5216,14 +5739,14 @@ upb_FindUnknownRet upb_MiniTable_FindUnknown(const upb_Message* msg, if (field_number == upb_WireReader_GetFieldNumber(tag)) { ret.status = kUpb_FindUnknown_Ok; ret.ptr = upb_EpsCopyInputStream_GetAliasedPtr(&stream, unknown_begin); - ptr = upb_WireReader_SkipValue(ptr, tag, depth_limit, &stream); + ptr = _upb_WireReader_SkipValue(ptr, tag, depth_limit, &stream); // Because we know that the input is a flat buffer, it is safe to perform // pointer arithmetic on aliased pointers. ret.len = upb_EpsCopyInputStream_GetAliasedPtr(&stream, ptr) - ret.ptr; return ret; } - ptr = upb_WireReader_SkipValue(ptr, tag, depth_limit, &stream); + ptr = _upb_WireReader_SkipValue(ptr, tag, depth_limit, &stream); if (!ptr) return upb_FindUnknownRet_ParseError(); } ret.status = kUpb_FindUnknown_NotPresent; @@ -5242,7 +5765,7 @@ upb_UnknownToMessageRet upb_MiniTable_PromoteUnknownToMessage( // Callers should check that message is not set first before calling // PromotoUnknownToMessage. UPB_ASSERT(mini_table->subs[field->submsg_index].submsg == sub_mini_table); - UPB_ASSERT(upb_MiniTable_GetMessage(msg, field, NULL) == NULL); + UPB_ASSERT(upb_Message_GetMessage(msg, field, NULL) == NULL); upb_UnknownToMessageRet ret; ret.status = kUpb_UnknownToMessage_Ok; do { @@ -5270,7 +5793,7 @@ upb_UnknownToMessageRet upb_MiniTable_PromoteUnknownToMessage( } } while (unknown.status == kUpb_FindUnknown_Ok); if (message) { - upb_MiniTable_SetMessage(msg, mini_table, field, message); + upb_Message_SetMessage(msg, mini_table, field, message); ret.message = message; } return ret; @@ -5360,8 +5883,8 @@ upb_UnknownToMessage_Status upb_MiniTable_PromoteUnknownToMap( /* base_message= */ NULL, decode_options, arena); if (ret.status != kUpb_UnknownToMessage_Ok) return ret.status; // Allocate map on demand before append. - upb_Map* map = - upb_MiniTable_GetMutableMap(msg, map_entry_mini_table, field, arena); + upb_Map* map = upb_Message_GetOrCreateMutableMap(msg, map_entry_mini_table, + field, arena); upb_Message* map_entry_message = ret.message; upb_MapInsertStatus insert_status = upb_Message_InsertMapEntry( map, mini_table, field, map_entry_message, arena); @@ -7203,6 +7726,7 @@ struct upb_DefPool { upb_strtable files; // file_name -> (upb_FileDef*) upb_inttable exts; // (upb_MiniTableExtension*) -> (upb_FieldDef*) upb_ExtensionRegistry* extreg; + upb_MiniTablePlatform platform; void* scratch_data; size_t scratch_size; size_t bytes_loaded; @@ -7232,6 +7756,8 @@ upb_DefPool* upb_DefPool_New(void) { s->extreg = upb_ExtensionRegistry_New(s->arena); if (!s->extreg) goto err; + s->platform = kUpb_MiniTablePlatform_Native; + return s; err: @@ -7285,6 +7811,11 @@ size_t* _upb_DefPool_ScratchSize(const upb_DefPool* s) { return (size_t*)&s->scratch_size; } +void _upb_DefPool_SetPlatform(upb_DefPool* s, upb_MiniTablePlatform platform) { + assert(upb_strtable_count(&s->files) == 0); + s->platform = platform; +} + const upb_MessageDef* upb_DefPool_FindMessageByName(const upb_DefPool* s, const char* sym) { return _upb_DefPool_Unpack(s, sym, strlen(sym), UPB_DEFTYPE_MSG); @@ -7438,9 +7969,9 @@ static void remove_filedef(upb_DefPool* s, upb_FileDef* file) { } static const upb_FileDef* _upb_DefPool_AddFile( - upb_DefPool* s, const google_protobuf_FileDescriptorProto* file_proto, + upb_DefPool* s, const UPB_DESC(FileDescriptorProto) * file_proto, const upb_MiniTableFile* layout, upb_Status* status) { - const upb_StringView name = google_protobuf_FileDescriptorProto_name(file_proto); + const upb_StringView name = UPB_DESC(FileDescriptorProto_name)(file_proto); if (name.size == 0) { upb_Status_SetErrorFormat(status, @@ -7462,6 +7993,7 @@ static const upb_FileDef* _upb_DefPool_AddFile( upb_DefBuilder ctx = { .symtab = s, .layout = layout, + .platform = s->platform, .msg_count = 0, .enum_count = 0, .ext_count = 0, @@ -7492,9 +8024,10 @@ static const upb_FileDef* _upb_DefPool_AddFile( return ctx.file; } -const upb_FileDef* upb_DefPool_AddFile( - upb_DefPool* s, const google_protobuf_FileDescriptorProto* file_proto, - upb_Status* status) { +const upb_FileDef* upb_DefPool_AddFile(upb_DefPool* s, + const UPB_DESC(FileDescriptorProto) * + file_proto, + upb_Status* status) { return _upb_DefPool_AddFile(s, file_proto, NULL, status); } @@ -7503,7 +8036,7 @@ bool _upb_DefPool_LoadDefInitEx(upb_DefPool* s, const _upb_DefPool_Init* init, /* Since this function should never fail (it would indicate a bug in upb) we * print errors to stderr instead of returning error status to the user. */ _upb_DefPool_Init** deps = init->deps; - google_protobuf_FileDescriptorProto* file; + UPB_DESC(FileDescriptorProto) * file; upb_Arena* arena; upb_Status status; @@ -7519,7 +8052,7 @@ bool _upb_DefPool_LoadDefInitEx(upb_DefPool* s, const _upb_DefPool_Init* init, if (!_upb_DefPool_LoadDefInitEx(s, *deps, rebuild_minitable)) goto err; } - file = google_protobuf_FileDescriptorProto_parse_ex( + file = UPB_DESC(FileDescriptorProto_parse_ex)( init->descriptor.data, init->descriptor.size, NULL, kUpb_DecodeOption_AliasString, arena); s->bytes_loaded += init->descriptor.size; @@ -7658,7 +8191,7 @@ bool _upb_DescState_Grow(upb_DescState* d, upb_Arena* a) { // Must be last. struct upb_EnumDef { - const google_protobuf_EnumOptions* opts; + const UPB_DESC(EnumOptions) * opts; const upb_MiniTableEnum* layout; // Only for proto2. const upb_FileDef* file; const upb_MessageDef* containing_type; // Could be merged with "file". @@ -7706,7 +8239,7 @@ bool _upb_EnumDef_Insert(upb_EnumDef* e, upb_EnumValueDef* v, upb_Arena* a) { return true; } -const google_protobuf_EnumOptions* upb_EnumDef_Options(const upb_EnumDef* e) { +const UPB_DESC(EnumOptions) * upb_EnumDef_Options(const upb_EnumDef* e) { return e->opts; } @@ -7854,10 +8387,10 @@ static upb_StringView* _upb_EnumReservedNames_New( } static void create_enumdef(upb_DefBuilder* ctx, const char* prefix, - const google_protobuf_EnumDescriptorProto* enum_proto, + const UPB_DESC(EnumDescriptorProto) * enum_proto, upb_EnumDef* e) { - const google_protobuf_EnumValueDescriptorProto* const* values; - const google_protobuf_EnumDescriptorProto_EnumReservedRange* const* res_ranges; + const UPB_DESC(EnumValueDescriptorProto)* const* values; + const UPB_DESC(EnumDescriptorProto_EnumReservedRange)* const* res_ranges; const upb_StringView* res_names; upb_StringView name; size_t n_value, n_res_range, n_res_name; @@ -7865,14 +8398,14 @@ static void create_enumdef(upb_DefBuilder* ctx, const char* prefix, // Must happen before _upb_DefBuilder_Add() e->file = _upb_DefBuilder_File(ctx); - name = google_protobuf_EnumDescriptorProto_name(enum_proto); + name = UPB_DESC(EnumDescriptorProto_name)(enum_proto); _upb_DefBuilder_CheckIdentNotFull(ctx, name); e->full_name = _upb_DefBuilder_MakeFullName(ctx, prefix, name); _upb_DefBuilder_Add(ctx, e->full_name, _upb_DefType_Pack(e, UPB_DEFTYPE_ENUM)); - values = google_protobuf_EnumDescriptorProto_value(enum_proto, &n_value); + values = UPB_DESC(EnumDescriptorProto_value)(enum_proto, &n_value); bool ok = upb_strtable_init(&e->ntoi, n_value, ctx->arena); if (!ok) _upb_DefBuilder_OomErr(ctx); @@ -7891,11 +8424,12 @@ static void create_enumdef(upb_DefBuilder* ctx, const char* prefix, } res_ranges = - google_protobuf_EnumDescriptorProto_reserved_range(enum_proto, &n_res_range); + UPB_DESC(EnumDescriptorProto_reserved_range)(enum_proto, &n_res_range); e->res_range_count = n_res_range; e->res_ranges = _upb_EnumReservedRanges_New(ctx, n_res_range, res_ranges, e); - res_names = google_protobuf_EnumDescriptorProto_reserved_name(enum_proto, &n_res_name); + res_names = + UPB_DESC(EnumDescriptorProto_reserved_name)(enum_proto, &n_res_name); e->res_name_count = n_res_name; e->res_names = _upb_EnumReservedNames_New(ctx, n_res_name, res_names); @@ -7915,9 +8449,10 @@ static void create_enumdef(upb_DefBuilder* ctx, const char* prefix, } } -upb_EnumDef* _upb_EnumDefs_New(upb_DefBuilder* ctx, int n, - const google_protobuf_EnumDescriptorProto* const* protos, - const upb_MessageDef* containing_type) { +upb_EnumDef* _upb_EnumDefs_New( + upb_DefBuilder* ctx, int n, + const UPB_DESC(EnumDescriptorProto) * const* protos, + const upb_MessageDef* containing_type) { _upb_DefType_CheckPadding(sizeof(upb_EnumDef)); // If a containing type is defined then get the full name from that. @@ -7957,16 +8492,16 @@ int32_t upb_EnumReservedRange_End(const upb_EnumReservedRange* r) { upb_EnumReservedRange* _upb_EnumReservedRanges_New( upb_DefBuilder* ctx, int n, - const google_protobuf_EnumDescriptorProto_EnumReservedRange* const* protos, + const UPB_DESC(EnumDescriptorProto_EnumReservedRange) * const* protos, const upb_EnumDef* e) { upb_EnumReservedRange* r = _upb_DefBuilder_Alloc(ctx, sizeof(upb_EnumReservedRange) * n); for (int i = 0; i < n; i++) { const int32_t start = - google_protobuf_EnumDescriptorProto_EnumReservedRange_start(protos[i]); + UPB_DESC(EnumDescriptorProto_EnumReservedRange_start)(protos[i]); const int32_t end = - google_protobuf_EnumDescriptorProto_EnumReservedRange_end(protos[i]); + UPB_DESC(EnumDescriptorProto_EnumReservedRange_end)(protos[i]); // A full validation would also check that each range is disjoint, and that // none of the fields overlap with the extension ranges, but we are just @@ -7990,7 +8525,7 @@ upb_EnumReservedRange* _upb_EnumReservedRanges_New( // Must be last. struct upb_EnumValueDef { - const google_protobuf_EnumValueOptions* opts; + const UPB_DESC(EnumValueOptions) * opts; const upb_EnumDef* parent; const char* full_name; int32_t number; @@ -8021,8 +8556,8 @@ const upb_EnumValueDef** _upb_EnumValueDefs_Sorted(const upb_EnumValueDef* v, return (const upb_EnumValueDef**)out; } -const google_protobuf_EnumValueOptions* upb_EnumValueDef_Options( - const upb_EnumValueDef* v) { +const UPB_DESC(EnumValueOptions) * + upb_EnumValueDef_Options(const upb_EnumValueDef* v) { return v->opts; } @@ -8050,13 +8585,14 @@ uint32_t upb_EnumValueDef_Index(const upb_EnumValueDef* v) { } static void create_enumvaldef(upb_DefBuilder* ctx, const char* prefix, - const google_protobuf_EnumValueDescriptorProto* val_proto, + const UPB_DESC(EnumValueDescriptorProto) * + val_proto, upb_EnumDef* e, upb_EnumValueDef* v) { - upb_StringView name = google_protobuf_EnumValueDescriptorProto_name(val_proto); + upb_StringView name = UPB_DESC(EnumValueDescriptorProto_name)(val_proto); v->parent = e; // Must happen prior to _upb_DefBuilder_Add() v->full_name = _upb_DefBuilder_MakeFullName(ctx, prefix, name); - v->number = google_protobuf_EnumValueDescriptorProto_number(val_proto); + v->number = UPB_DESC(EnumValueDescriptorProto_number)(val_proto); _upb_DefBuilder_Add(ctx, v->full_name, _upb_DefType_Pack(v, UPB_DEFTYPE_ENUMVAL)); @@ -8070,7 +8606,7 @@ static void create_enumvaldef(upb_DefBuilder* ctx, const char* prefix, // Allocate and initialize an array of |n| enum value defs owned by |e|. upb_EnumValueDef* _upb_EnumValueDefs_New( upb_DefBuilder* ctx, const char* prefix, int n, - const google_protobuf_EnumValueDescriptorProto* const* protos, upb_EnumDef* e, + const UPB_DESC(EnumValueDescriptorProto) * const* protos, upb_EnumDef* e, bool* is_sorted) { _upb_DefType_CheckPadding(sizeof(upb_EnumValueDef)); @@ -8101,7 +8637,7 @@ upb_EnumValueDef* _upb_EnumValueDefs_New( // Must be last. struct upb_ExtensionRange { - const google_protobuf_ExtensionRangeOptions* opts; + const UPB_DESC(ExtensionRangeOptions) * opts; int32_t start; int32_t end; }; @@ -8110,8 +8646,8 @@ upb_ExtensionRange* _upb_ExtensionRange_At(const upb_ExtensionRange* r, int i) { return (upb_ExtensionRange*)&r[i]; } -const google_protobuf_ExtensionRangeOptions* upb_ExtensionRange_Options( - const upb_ExtensionRange* r) { +const UPB_DESC(ExtensionRangeOptions) * + upb_ExtensionRange_Options(const upb_ExtensionRange* r) { return r->opts; } @@ -8127,19 +8663,19 @@ int32_t upb_ExtensionRange_End(const upb_ExtensionRange* r) { return r->end; } upb_ExtensionRange* _upb_ExtensionRanges_New( upb_DefBuilder* ctx, int n, - const google_protobuf_DescriptorProto_ExtensionRange* const* protos, + const UPB_DESC(DescriptorProto_ExtensionRange) * const* protos, const upb_MessageDef* m) { upb_ExtensionRange* r = _upb_DefBuilder_Alloc(ctx, sizeof(upb_ExtensionRange) * n); for (int i = 0; i < n; i++) { const int32_t start = - google_protobuf_DescriptorProto_ExtensionRange_start(protos[i]); - const int32_t end = google_protobuf_DescriptorProto_ExtensionRange_end(protos[i]); - const int32_t max = - google_protobuf_MessageOptions_message_set_wire_format(upb_MessageDef_Options(m)) - ? INT32_MAX - : kUpb_MaxFieldNumber + 1; + UPB_DESC(DescriptorProto_ExtensionRange_start)(protos[i]); + const int32_t end = UPB_DESC(DescriptorProto_ExtensionRange_end)(protos[i]); + const int32_t max = UPB_DESC(MessageOptions_message_set_wire_format)( + upb_MessageDef_Options(m)) + ? INT32_MAX + : kUpb_MaxFieldNumber + 1; // A full validation would also check that each range is disjoint, and that // none of the fields overlap with the extension ranges, but we are just @@ -8173,7 +8709,7 @@ typedef struct { } str_t; struct upb_FieldDef { - const google_protobuf_FieldOptions* opts; + const UPB_DESC(FieldOptions) * opts; const upb_FileDef* file; const upb_MessageDef* msgdef; const char* full_name; @@ -8194,7 +8730,7 @@ struct upb_FieldDef { union { const upb_MessageDef* msgdef; const upb_EnumDef* enumdef; - const google_protobuf_FieldDescriptorProto* unresolved; + const UPB_DESC(FieldDescriptorProto) * unresolved; } sub; uint32_t number_; uint16_t index_; @@ -8215,7 +8751,7 @@ upb_FieldDef* _upb_FieldDef_At(const upb_FieldDef* f, int i) { return (upb_FieldDef*)&f[i]; } -const google_protobuf_FieldOptions* upb_FieldDef_Options(const upb_FieldDef* f) { +const UPB_DESC(FieldOptions) * upb_FieldDef_Options(const upb_FieldDef* f) { return f->opts; } @@ -8670,22 +9206,23 @@ static void set_default_default(upb_DefBuilder* ctx, upb_FieldDef* f) { } static void _upb_FieldDef_Create(upb_DefBuilder* ctx, const char* prefix, - const google_protobuf_FieldDescriptorProto* field_proto, + const UPB_DESC(FieldDescriptorProto) * + field_proto, upb_MessageDef* m, upb_FieldDef* f) { // Must happen before _upb_DefBuilder_Add() f->file = _upb_DefBuilder_File(ctx); - if (!google_protobuf_FieldDescriptorProto_has_name(field_proto)) { + if (!UPB_DESC(FieldDescriptorProto_has_name)(field_proto)) { _upb_DefBuilder_Errf(ctx, "field has no name"); } - const upb_StringView name = google_protobuf_FieldDescriptorProto_name(field_proto); + const upb_StringView name = UPB_DESC(FieldDescriptorProto_name)(field_proto); _upb_DefBuilder_CheckIdentNotFull(ctx, name); - f->has_json_name_ = google_protobuf_FieldDescriptorProto_has_json_name(field_proto); + f->has_json_name_ = UPB_DESC(FieldDescriptorProto_has_json_name)(field_proto); if (f->has_json_name_) { const upb_StringView sv = - google_protobuf_FieldDescriptorProto_json_name(field_proto); + UPB_DESC(FieldDescriptorProto_json_name)(field_proto); f->json_name = upb_strdup2(sv.data, sv.size, ctx->arena); } else { f->json_name = make_json_name(name.data, name.size, ctx->arena); @@ -8693,18 +9230,18 @@ static void _upb_FieldDef_Create(upb_DefBuilder* ctx, const char* prefix, if (!f->json_name) _upb_DefBuilder_OomErr(ctx); f->full_name = _upb_DefBuilder_MakeFullName(ctx, prefix, name); - f->label_ = (int)google_protobuf_FieldDescriptorProto_label(field_proto); - f->number_ = google_protobuf_FieldDescriptorProto_number(field_proto); + f->label_ = (int)UPB_DESC(FieldDescriptorProto_label)(field_proto); + f->number_ = UPB_DESC(FieldDescriptorProto_number)(field_proto); f->proto3_optional_ = - google_protobuf_FieldDescriptorProto_proto3_optional(field_proto); + UPB_DESC(FieldDescriptorProto_proto3_optional)(field_proto); f->msgdef = m; f->scope.oneof = NULL; - const bool has_type = google_protobuf_FieldDescriptorProto_has_type(field_proto); + const bool has_type = UPB_DESC(FieldDescriptorProto_has_type)(field_proto); const bool has_type_name = - google_protobuf_FieldDescriptorProto_has_type_name(field_proto); + UPB_DESC(FieldDescriptorProto_has_type_name)(field_proto); - f->type_ = (int)google_protobuf_FieldDescriptorProto_type(field_proto); + f->type_ = (int)UPB_DESC(FieldDescriptorProto_type)(field_proto); if (has_type) { switch (f->type_) { @@ -8749,8 +9286,9 @@ static void _upb_FieldDef_Create(upb_DefBuilder* ctx, const char* prefix, f->full_name); } - if (google_protobuf_FieldDescriptorProto_has_oneof_index(field_proto)) { - uint32_t oneof_index = google_protobuf_FieldDescriptorProto_oneof_index(field_proto); + if (UPB_DESC(FieldDescriptorProto_has_oneof_index)(field_proto)) { + uint32_t oneof_index = + UPB_DESC(FieldDescriptorProto_oneof_index)(field_proto); if (upb_FieldDef_Label(f) != kUpb_Label_Optional) { _upb_DefBuilder_Errf(ctx, "fields in oneof must have OPTIONAL label (%s)", @@ -8775,8 +9313,8 @@ static void _upb_FieldDef_Create(upb_DefBuilder* ctx, const char* prefix, UPB_DEF_SET_OPTIONS(f->opts, FieldDescriptorProto, FieldOptions, field_proto); - if (google_protobuf_FieldOptions_has_packed(f->opts)) { - f->is_packed_ = google_protobuf_FieldOptions_packed(f->opts); + if (UPB_DESC(FieldOptions_has_packed)(f->opts)) { + f->is_packed_ = UPB_DESC(FieldOptions_packed)(f->opts); } else { // Repeated fields default to packed for proto3 only. f->is_packed_ = upb_FieldDef_IsPrimitive(f) && @@ -8785,14 +9323,14 @@ static void _upb_FieldDef_Create(upb_DefBuilder* ctx, const char* prefix, } } -static void _upb_FieldDef_CreateExt( - upb_DefBuilder* ctx, const char* prefix, - const google_protobuf_FieldDescriptorProto* field_proto, upb_MessageDef* m, - upb_FieldDef* f) { +static void _upb_FieldDef_CreateExt(upb_DefBuilder* ctx, const char* prefix, + const UPB_DESC(FieldDescriptorProto) * + field_proto, + upb_MessageDef* m, upb_FieldDef* f) { _upb_FieldDef_Create(ctx, prefix, field_proto, m, f); f->is_extension_ = true; - if (google_protobuf_FieldDescriptorProto_has_oneof_index(field_proto)) { + if (UPB_DESC(FieldDescriptorProto_has_oneof_index)(field_proto)) { _upb_DefBuilder_Errf(ctx, "oneof_index provided for extension field (%s)", f->full_name); } @@ -8806,14 +9344,14 @@ static void _upb_FieldDef_CreateExt( } } -static void _upb_FieldDef_CreateNotExt( - upb_DefBuilder* ctx, const char* prefix, - const google_protobuf_FieldDescriptorProto* field_proto, upb_MessageDef* m, - upb_FieldDef* f) { +static void _upb_FieldDef_CreateNotExt(upb_DefBuilder* ctx, const char* prefix, + const UPB_DESC(FieldDescriptorProto) * + field_proto, + upb_MessageDef* m, upb_FieldDef* f) { _upb_FieldDef_Create(ctx, prefix, field_proto, m, f); f->is_extension_ = false; - if (!google_protobuf_FieldDescriptorProto_has_oneof_index(field_proto)) { + if (!UPB_DESC(FieldDescriptorProto_has_oneof_index)(field_proto)) { if (f->proto3_optional_) { _upb_DefBuilder_Errf( ctx, @@ -8840,7 +9378,7 @@ static void _upb_FieldDef_CreateNotExt( upb_FieldDef* _upb_FieldDefs_New( upb_DefBuilder* ctx, int n, - const google_protobuf_FieldDescriptorProto* const* protos, const char* prefix, + const UPB_DESC(FieldDescriptorProto) * const* protos, const char* prefix, upb_MessageDef* m, bool* is_sorted) { _upb_DefType_CheckPadding(sizeof(upb_FieldDef)); upb_FieldDef* defs = @@ -8875,11 +9413,9 @@ upb_FieldDef* _upb_FieldDefs_New( static void resolve_subdef(upb_DefBuilder* ctx, const char* prefix, upb_FieldDef* f) { - const google_protobuf_FieldDescriptorProto* field_proto = f->sub.unresolved; - upb_StringView name = - google_protobuf_FieldDescriptorProto_type_name(field_proto); - bool has_name = - google_protobuf_FieldDescriptorProto_has_type_name(field_proto); + const UPB_DESC(FieldDescriptorProto)* field_proto = f->sub.unresolved; + upb_StringView name = UPB_DESC(FieldDescriptorProto_type_name)(field_proto); + bool has_name = UPB_DESC(FieldDescriptorProto_has_type_name)(field_proto); switch ((int)f->type_) { case UPB_FIELD_TYPE_UNSPECIFIED: { // Type was not specified and must be inferred. @@ -8964,13 +9500,14 @@ bool upb_FieldDef_MiniDescriptorEncode(const upb_FieldDef* f, upb_Arena* a, static void resolve_extension(upb_DefBuilder* ctx, const char* prefix, upb_FieldDef* f, - const google_protobuf_FieldDescriptorProto* field_proto) { - if (!google_protobuf_FieldDescriptorProto_has_extendee(field_proto)) { + const UPB_DESC(FieldDescriptorProto) * + field_proto) { + if (!UPB_DESC(FieldDescriptorProto_has_extendee)(field_proto)) { _upb_DefBuilder_Errf(ctx, "extension for field '%s' had no extendee", f->full_name); } - upb_StringView name = google_protobuf_FieldDescriptorProto_extendee(field_proto); + upb_StringView name = UPB_DESC(FieldDescriptorProto_extendee)(field_proto); const upb_MessageDef* m = _upb_DefBuilder_Resolve(ctx, f->full_name, prefix, name, UPB_DEFTYPE_MSG); f->msgdef = m; @@ -9010,12 +9547,13 @@ static void resolve_extension(upb_DefBuilder* ctx, const char* prefix, } static void resolve_default(upb_DefBuilder* ctx, upb_FieldDef* f, - const google_protobuf_FieldDescriptorProto* field_proto) { + const UPB_DESC(FieldDescriptorProto) * + field_proto) { // Have to delay resolving of the default value until now because of the enum // case, since enum defaults are specified with a label. - if (google_protobuf_FieldDescriptorProto_has_default_value(field_proto)) { + if (UPB_DESC(FieldDescriptorProto_has_default_value)(field_proto)) { upb_StringView defaultval = - google_protobuf_FieldDescriptorProto_default_value(field_proto); + UPB_DESC(FieldDescriptorProto_default_value)(field_proto); if (upb_FileDef_Syntax(f->file) == kUpb_Syntax_Proto3) { _upb_DefBuilder_Errf(ctx, @@ -9040,7 +9578,7 @@ static void resolve_default(upb_DefBuilder* ctx, upb_FieldDef* f, void _upb_FieldDef_Resolve(upb_DefBuilder* ctx, const char* prefix, upb_FieldDef* f) { // We have to stash this away since resolve_subdef() may overwrite it. - const google_protobuf_FieldDescriptorProto* field_proto = f->sub.unresolved; + const UPB_DESC(FieldDescriptorProto)* field_proto = f->sub.unresolved; resolve_subdef(ctx, prefix, f); resolve_default(ctx, f, field_proto); @@ -9054,7 +9592,7 @@ void _upb_FieldDef_Resolve(upb_DefBuilder* ctx, const char* prefix, // Must be last. struct upb_FileDef { - const google_protobuf_FileOptions* opts; + const UPB_DESC(FileOptions) * opts; const char* name; const char* package; @@ -9079,7 +9617,7 @@ struct upb_FileDef { upb_Syntax syntax; }; -const google_protobuf_FileOptions* upb_FileDef_Options(const upb_FileDef* f) { +const UPB_DESC(FileOptions) * upb_FileDef_Options(const upb_FileDef* f) { return f->opts; } @@ -9181,13 +9719,13 @@ static bool streql_view(upb_StringView view, const char* b) { return view.size == strlen(b) && memcmp(view.data, b, view.size) == 0; } -static int count_exts_in_msg(const google_protobuf_DescriptorProto* msg_proto) { +static int count_exts_in_msg(const UPB_DESC(DescriptorProto) * msg_proto) { size_t n; - google_protobuf_DescriptorProto_extension(msg_proto, &n); + UPB_DESC(DescriptorProto_extension)(msg_proto, &n); int ext_count = n; - const google_protobuf_DescriptorProto* const* nested_msgs = - google_protobuf_DescriptorProto_nested_type(msg_proto, &n); + const UPB_DESC(DescriptorProto)* const* nested_msgs = + UPB_DESC(DescriptorProto_nested_type)(msg_proto, &n); for (size_t i = 0; i < n; i++) { ext_count += count_exts_in_msg(nested_msgs[i]); } @@ -9197,14 +9735,14 @@ static int count_exts_in_msg(const google_protobuf_DescriptorProto* msg_proto) { // Allocate and initialize one file def, and add it to the context object. void _upb_FileDef_Create(upb_DefBuilder* ctx, - const google_protobuf_FileDescriptorProto* file_proto) { + const UPB_DESC(FileDescriptorProto) * file_proto) { upb_FileDef* file = _upb_DefBuilder_Alloc(ctx, sizeof(upb_FileDef)); ctx->file = file; - const google_protobuf_DescriptorProto* const* msgs; - const google_protobuf_EnumDescriptorProto* const* enums; - const google_protobuf_FieldDescriptorProto* const* exts; - const google_protobuf_ServiceDescriptorProto* const* services; + const UPB_DESC(DescriptorProto)* const* msgs; + const UPB_DESC(EnumDescriptorProto)* const* enums; + const UPB_DESC(FieldDescriptorProto)* const* exts; + const UPB_DESC(ServiceDescriptorProto)* const* services; const upb_StringView* strs; const int32_t* public_deps; const int32_t* weak_deps; @@ -9213,9 +9751,9 @@ void _upb_FileDef_Create(upb_DefBuilder* ctx, file->symtab = ctx->symtab; // Count all extensions in the file, to build a flat array of layouts. - google_protobuf_FileDescriptorProto_extension(file_proto, &n); + UPB_DESC(FileDescriptorProto_extension)(file_proto, &n); int ext_count = n; - msgs = google_protobuf_FileDescriptorProto_message_type(file_proto, &n); + msgs = UPB_DESC(FileDescriptorProto_message_type)(file_proto, &n); for (int i = 0; i < n; i++) { ext_count += count_exts_in_msg(msgs[i]); } @@ -9240,13 +9778,13 @@ void _upb_FileDef_Create(upb_DefBuilder* ctx, } } - if (!google_protobuf_FileDescriptorProto_has_name(file_proto)) { + if (!UPB_DESC(FileDescriptorProto_has_name)(file_proto)) { _upb_DefBuilder_Errf(ctx, "File has no name"); } - file->name = strviewdup(ctx, google_protobuf_FileDescriptorProto_name(file_proto)); + file->name = strviewdup(ctx, UPB_DESC(FileDescriptorProto_name)(file_proto)); - upb_StringView package = google_protobuf_FileDescriptorProto_package(file_proto); + upb_StringView package = UPB_DESC(FileDescriptorProto_package)(file_proto); if (package.size) { _upb_DefBuilder_CheckIdentFull(ctx, package); file->package = strviewdup(ctx, package); @@ -9254,8 +9792,8 @@ void _upb_FileDef_Create(upb_DefBuilder* ctx, file->package = NULL; } - if (google_protobuf_FileDescriptorProto_has_syntax(file_proto)) { - upb_StringView syntax = google_protobuf_FileDescriptorProto_syntax(file_proto); + if (UPB_DESC(FileDescriptorProto_has_syntax)(file_proto)) { + upb_StringView syntax = UPB_DESC(FileDescriptorProto_syntax)(file_proto); if (streql_view(syntax, "proto2")) { file->syntax = kUpb_Syntax_Proto2; @@ -9273,7 +9811,7 @@ void _upb_FileDef_Create(upb_DefBuilder* ctx, UPB_DEF_SET_OPTIONS(file->opts, FileDescriptorProto, FileOptions, file_proto); // Verify dependencies. - strs = google_protobuf_FileDescriptorProto_dependency(file_proto, &n); + strs = UPB_DESC(FileDescriptorProto_dependency)(file_proto, &n); file->dep_count = n; file->deps = _upb_DefBuilder_Alloc(ctx, sizeof(*file->deps) * n); @@ -9289,7 +9827,7 @@ void _upb_FileDef_Create(upb_DefBuilder* ctx, } } - public_deps = google_protobuf_FileDescriptorProto_public_dependency(file_proto, &n); + public_deps = UPB_DESC(FileDescriptorProto_public_dependency)(file_proto, &n); file->public_dep_count = n; file->public_deps = _upb_DefBuilder_Alloc(ctx, sizeof(*file->public_deps) * n); @@ -9302,7 +9840,7 @@ void _upb_FileDef_Create(upb_DefBuilder* ctx, mutable_public_deps[i] = public_deps[i]; } - weak_deps = google_protobuf_FileDescriptorProto_weak_dependency(file_proto, &n); + weak_deps = UPB_DESC(FileDescriptorProto_weak_dependency)(file_proto, &n); file->weak_dep_count = n; file->weak_deps = _upb_DefBuilder_Alloc(ctx, sizeof(*file->weak_deps) * n); int32_t* mutable_weak_deps = (int32_t*)file->weak_deps; @@ -9315,23 +9853,23 @@ void _upb_FileDef_Create(upb_DefBuilder* ctx, } // Create enums. - enums = google_protobuf_FileDescriptorProto_enum_type(file_proto, &n); + enums = UPB_DESC(FileDescriptorProto_enum_type)(file_proto, &n); file->top_lvl_enum_count = n; file->top_lvl_enums = _upb_EnumDefs_New(ctx, n, enums, NULL); // Create extensions. - exts = google_protobuf_FileDescriptorProto_extension(file_proto, &n); + exts = UPB_DESC(FileDescriptorProto_extension)(file_proto, &n); file->top_lvl_ext_count = n; file->top_lvl_exts = _upb_FieldDefs_New(ctx, n, exts, file->package, NULL, NULL); // Create messages. - msgs = google_protobuf_FileDescriptorProto_message_type(file_proto, &n); + msgs = UPB_DESC(FileDescriptorProto_message_type)(file_proto, &n); file->top_lvl_msg_count = n; file->top_lvl_msgs = _upb_MessageDefs_New(ctx, n, msgs, NULL); // Create services. - services = google_protobuf_FileDescriptorProto_service(file_proto, &n); + services = UPB_DESC(FileDescriptorProto_service)(file_proto, &n); file->service_count = n; file->services = _upb_ServiceDefs_New(ctx, n, services); @@ -9559,7 +10097,7 @@ bool upb_Message_DiscardUnknown(upb_Message* msg, const upb_MessageDef* m, // Must be last. struct upb_MessageDef { - const google_protobuf_MessageOptions* opts; + const UPB_DESC(MessageOptions) * opts; const upb_MiniTable* layout; const upb_FileDef* file; const upb_MessageDef* containing_type; @@ -9656,7 +10194,8 @@ bool _upb_MessageDef_IsValidExtensionNumber(const upb_MessageDef* m, int n) { return false; } -const google_protobuf_MessageOptions* upb_MessageDef_Options(const upb_MessageDef* m) { +const UPB_DESC(MessageOptions) * + upb_MessageDef_Options(const upb_MessageDef* m) { return m->opts; } @@ -9770,6 +10309,10 @@ int upb_MessageDef_OneofCount(const upb_MessageDef* m) { return m->oneof_count; } +int upb_MessageDef_RealOneofCount(const upb_MessageDef* m) { + return m->real_oneof_count; +} + int upb_MessageDef_NestedMessageCount(const upb_MessageDef* m) { return m->nested_msg_count; } @@ -9849,11 +10392,11 @@ const upb_OneofDef* upb_MessageDef_FindOneofByName(const upb_MessageDef* m, } bool upb_MessageDef_IsMapEntry(const upb_MessageDef* m) { - return google_protobuf_MessageOptions_map_entry(m->opts); + return UPB_DESC(MessageOptions_map_entry)(m->opts); } bool upb_MessageDef_IsMessageSet(const upb_MessageDef* m) { - return google_protobuf_MessageOptions_message_set_wire_format(m->opts); + return UPB_DESC(MessageOptions_message_set_wire_format)(m->opts); } static upb_MiniTable* _upb_MessageDef_MakeMiniTable(upb_DefBuilder* ctx, @@ -9865,8 +10408,8 @@ static upb_MiniTable* _upb_MessageDef_MakeMiniTable(upb_DefBuilder* ctx, void** scratch_data = _upb_DefPool_ScratchData(ctx->symtab); size_t* scratch_size = _upb_DefPool_ScratchSize(ctx->symtab); upb_MiniTable* ret = upb_MiniTable_BuildWithBuf( - desc.data, desc.size, kUpb_MiniTablePlatform_Native, ctx->arena, - scratch_data, scratch_size, ctx->status); + desc.data, desc.size, ctx->platform, ctx->arena, scratch_data, + scratch_size, ctx->status); if (!ret) _upb_DefBuilder_FailJmp(ctx); return ret; @@ -9902,7 +10445,7 @@ void _upb_MessageDef_Resolve(upb_DefBuilder* ctx, upb_MessageDef* m) { if (upb_FieldDef_Type(ext) == kUpb_FieldType_Message && upb_FieldDef_Label(ext) == kUpb_Label_Optional && upb_FieldDef_MessageSubDef(ext) == m && - google_protobuf_MessageOptions_message_set_wire_format( + UPB_DESC(MessageOptions_message_set_wire_format)( upb_MessageDef_Options(upb_FieldDef_ContainingType(ext)))) { m->in_message_set = true; } @@ -10071,7 +10614,7 @@ bool upb_MessageDef_MiniDescriptorEncode(const upb_MessageDef* m, upb_Arena* a, if (upb_MessageDef_IsMapEntry(m)) { if (!_upb_MessageDef_EncodeMap(&s, m, a)) return false; - } else if (google_protobuf_MessageOptions_message_set_wire_format(m->opts)) { + } else if (UPB_DESC(MessageOptions_message_set_wire_format)(m->opts)) { if (!_upb_MessageDef_EncodeMessageSet(&s, m, a)) return false; } else { if (!_upb_MessageDef_EncodeMessage(&s, m, a)) return false; @@ -10097,13 +10640,13 @@ static upb_StringView* _upb_ReservedNames_New(upb_DefBuilder* ctx, int n, } static void create_msgdef(upb_DefBuilder* ctx, const char* prefix, - const google_protobuf_DescriptorProto* msg_proto, + const UPB_DESC(DescriptorProto) * msg_proto, const upb_MessageDef* containing_type, upb_MessageDef* m) { - const google_protobuf_OneofDescriptorProto* const* oneofs; - const google_protobuf_FieldDescriptorProto* const* fields; - const google_protobuf_DescriptorProto_ExtensionRange* const* ext_ranges; - const google_protobuf_DescriptorProto_ReservedRange* const* res_ranges; + const UPB_DESC(OneofDescriptorProto)* const* oneofs; + const UPB_DESC(FieldDescriptorProto)* const* fields; + const UPB_DESC(DescriptorProto_ExtensionRange)* const* ext_ranges; + const UPB_DESC(DescriptorProto_ReservedRange)* const* res_ranges; const upb_StringView* res_names; size_t n_oneof, n_field, n_enum, n_ext, n_msg; size_t n_ext_range, n_res_range, n_res_name; @@ -10115,17 +10658,19 @@ static void create_msgdef(upb_DefBuilder* ctx, const char* prefix, m->containing_type = containing_type; m->is_sorted = true; - name = google_protobuf_DescriptorProto_name(msg_proto); + name = UPB_DESC(DescriptorProto_name)(msg_proto); _upb_DefBuilder_CheckIdentNotFull(ctx, name); m->full_name = _upb_DefBuilder_MakeFullName(ctx, prefix, name); _upb_DefBuilder_Add(ctx, m->full_name, _upb_DefType_Pack(m, UPB_DEFTYPE_MSG)); - oneofs = google_protobuf_DescriptorProto_oneof_decl(msg_proto, &n_oneof); - fields = google_protobuf_DescriptorProto_field(msg_proto, &n_field); - ext_ranges = google_protobuf_DescriptorProto_extension_range(msg_proto, &n_ext_range); - res_ranges = google_protobuf_DescriptorProto_reserved_range(msg_proto, &n_res_range); - res_names = google_protobuf_DescriptorProto_reserved_name(msg_proto, &n_res_name); + oneofs = UPB_DESC(DescriptorProto_oneof_decl)(msg_proto, &n_oneof); + fields = UPB_DESC(DescriptorProto_field)(msg_proto, &n_field); + ext_ranges = + UPB_DESC(DescriptorProto_extension_range)(msg_proto, &n_ext_range); + res_ranges = + UPB_DESC(DescriptorProto_reserved_range)(msg_proto, &n_res_range); + res_names = UPB_DESC(DescriptorProto_reserved_name)(msg_proto, &n_res_name); bool ok = upb_inttable_init(&m->itof, ctx->arena); if (!ok) _upb_DefBuilder_OomErr(ctx); @@ -10154,7 +10699,7 @@ static void create_msgdef(upb_DefBuilder* ctx, const char* prefix, _upb_FieldDefs_New(ctx, n_field, fields, m->full_name, m, &m->is_sorted); // Message Sets may not contain fields. - if (UPB_UNLIKELY(google_protobuf_MessageOptions_message_set_wire_format(m->opts))) { + if (UPB_UNLIKELY(UPB_DESC(MessageOptions_message_set_wire_format)(m->opts))) { if (UPB_UNLIKELY(n_field > 0)) { _upb_DefBuilder_Errf(ctx, "invalid message set (%s)", m->full_name); } @@ -10176,25 +10721,25 @@ static void create_msgdef(upb_DefBuilder* ctx, const char* prefix, assign_msg_wellknowntype(m); upb_inttable_compact(&m->itof, ctx->arena); - const google_protobuf_EnumDescriptorProto* const* enums = - google_protobuf_DescriptorProto_enum_type(msg_proto, &n_enum); + const UPB_DESC(EnumDescriptorProto)* const* enums = + UPB_DESC(DescriptorProto_enum_type)(msg_proto, &n_enum); m->nested_enum_count = n_enum; m->nested_enums = _upb_EnumDefs_New(ctx, n_enum, enums, m); - const google_protobuf_FieldDescriptorProto* const* exts = - google_protobuf_DescriptorProto_extension(msg_proto, &n_ext); + const UPB_DESC(FieldDescriptorProto)* const* exts = + UPB_DESC(DescriptorProto_extension)(msg_proto, &n_ext); m->nested_ext_count = n_ext; m->nested_exts = _upb_FieldDefs_New(ctx, n_ext, exts, m->full_name, m, NULL); - const google_protobuf_DescriptorProto* const* msgs = - google_protobuf_DescriptorProto_nested_type(msg_proto, &n_msg); + const UPB_DESC(DescriptorProto)* const* msgs = + UPB_DESC(DescriptorProto_nested_type)(msg_proto, &n_msg); m->nested_msg_count = n_msg; m->nested_msgs = _upb_MessageDefs_New(ctx, n_msg, msgs, m); } // Allocate and initialize an array of |n| message defs. upb_MessageDef* _upb_MessageDefs_New( - upb_DefBuilder* ctx, int n, const google_protobuf_DescriptorProto* const* protos, + upb_DefBuilder* ctx, int n, const UPB_DESC(DescriptorProto) * const* protos, const upb_MessageDef* containing_type) { _upb_DefType_CheckPadding(sizeof(upb_MessageDef)); @@ -10230,14 +10775,15 @@ int32_t upb_MessageReservedRange_End(const upb_MessageReservedRange* r) { upb_MessageReservedRange* _upb_MessageReservedRanges_New( upb_DefBuilder* ctx, int n, - const google_protobuf_DescriptorProto_ReservedRange* const* protos, + const UPB_DESC(DescriptorProto_ReservedRange) * const* protos, const upb_MessageDef* m) { upb_MessageReservedRange* r = _upb_DefBuilder_Alloc(ctx, sizeof(upb_MessageReservedRange) * n); for (int i = 0; i < n; i++) { - const int32_t start = google_protobuf_DescriptorProto_ReservedRange_start(protos[i]); - const int32_t end = google_protobuf_DescriptorProto_ReservedRange_end(protos[i]); + const int32_t start = + UPB_DESC(DescriptorProto_ReservedRange_start)(protos[i]); + const int32_t end = UPB_DESC(DescriptorProto_ReservedRange_end)(protos[i]); const int32_t max = kUpb_MaxFieldNumber + 1; // A full validation would also check that each range is disjoint, and that @@ -10260,7 +10806,7 @@ upb_MessageReservedRange* _upb_MessageReservedRanges_New( // Must be last. struct upb_MethodDef { - const google_protobuf_MethodOptions* opts; + const UPB_DESC(MethodOptions) * opts; upb_ServiceDef* service; const char* full_name; const upb_MessageDef* input_type; @@ -10278,7 +10824,7 @@ const upb_ServiceDef* upb_MethodDef_Service(const upb_MethodDef* m) { return m->service; } -const google_protobuf_MethodOptions* upb_MethodDef_Options(const upb_MethodDef* m) { +const UPB_DESC(MethodOptions) * upb_MethodDef_Options(const upb_MethodDef* m) { return m->opts; } @@ -10313,23 +10859,25 @@ bool upb_MethodDef_ServerStreaming(const upb_MethodDef* m) { } static void create_method(upb_DefBuilder* ctx, - const google_protobuf_MethodDescriptorProto* method_proto, + const UPB_DESC(MethodDescriptorProto) * method_proto, upb_ServiceDef* s, upb_MethodDef* m) { - upb_StringView name = google_protobuf_MethodDescriptorProto_name(method_proto); + upb_StringView name = UPB_DESC(MethodDescriptorProto_name)(method_proto); m->service = s; m->full_name = _upb_DefBuilder_MakeFullName(ctx, upb_ServiceDef_FullName(s), name); m->client_streaming = - google_protobuf_MethodDescriptorProto_client_streaming(method_proto); + UPB_DESC(MethodDescriptorProto_client_streaming)(method_proto); m->server_streaming = - google_protobuf_MethodDescriptorProto_server_streaming(method_proto); + UPB_DESC(MethodDescriptorProto_server_streaming)(method_proto); m->input_type = _upb_DefBuilder_Resolve( ctx, m->full_name, m->full_name, - google_protobuf_MethodDescriptorProto_input_type(method_proto), UPB_DEFTYPE_MSG); + UPB_DESC(MethodDescriptorProto_input_type)(method_proto), + UPB_DEFTYPE_MSG); m->output_type = _upb_DefBuilder_Resolve( ctx, m->full_name, m->full_name, - google_protobuf_MethodDescriptorProto_output_type(method_proto), UPB_DEFTYPE_MSG); + UPB_DESC(MethodDescriptorProto_output_type)(method_proto), + UPB_DEFTYPE_MSG); UPB_DEF_SET_OPTIONS(m->opts, MethodDescriptorProto, MethodOptions, method_proto); @@ -10338,7 +10886,7 @@ static void create_method(upb_DefBuilder* ctx, // Allocate and initialize an array of |n| method defs belonging to |s|. upb_MethodDef* _upb_MethodDefs_New( upb_DefBuilder* ctx, int n, - const google_protobuf_MethodDescriptorProto* const* protos, upb_ServiceDef* s) { + const UPB_DESC(MethodDescriptorProto) * const* protos, upb_ServiceDef* s) { upb_MethodDef* m = _upb_DefBuilder_Alloc(ctx, sizeof(upb_MethodDef) * n); for (int i = 0; i < n; i++) { create_method(ctx, protos[i], s, &m[i]); @@ -10355,7 +10903,7 @@ upb_MethodDef* _upb_MethodDefs_New( // Must be last. struct upb_OneofDef { - const google_protobuf_OneofOptions* opts; + const UPB_DESC(OneofOptions) * opts; const upb_MessageDef* parent; const char* full_name; int field_count; @@ -10372,7 +10920,7 @@ upb_OneofDef* _upb_OneofDef_At(const upb_OneofDef* o, int i) { return (upb_OneofDef*)&o[i]; } -const google_protobuf_OneofOptions* upb_OneofDef_Options(const upb_OneofDef* o) { +const UPB_DESC(OneofOptions) * upb_OneofDef_Options(const upb_OneofDef* o) { return o->opts; } @@ -10478,10 +11026,10 @@ size_t _upb_OneofDefs_Finalize(upb_DefBuilder* ctx, upb_MessageDef* m) { } static void create_oneofdef(upb_DefBuilder* ctx, upb_MessageDef* m, - const google_protobuf_OneofDescriptorProto* oneof_proto, + const UPB_DESC(OneofDescriptorProto) * oneof_proto, const upb_OneofDef* _o) { upb_OneofDef* o = (upb_OneofDef*)_o; - upb_StringView name = google_protobuf_OneofDescriptorProto_name(oneof_proto); + upb_StringView name = UPB_DESC(OneofDescriptorProto_name)(oneof_proto); o->parent = m; o->full_name = @@ -10509,7 +11057,7 @@ static void create_oneofdef(upb_DefBuilder* ctx, upb_MessageDef* m, // Allocate and initialize an array of |n| oneof defs. upb_OneofDef* _upb_OneofDefs_New( upb_DefBuilder* ctx, int n, - const google_protobuf_OneofDescriptorProto* const* protos, upb_MessageDef* m) { + const UPB_DESC(OneofDescriptorProto) * const* protos, upb_MessageDef* m) { _upb_DefType_CheckPadding(sizeof(upb_OneofDef)); upb_OneofDef* o = _upb_DefBuilder_Alloc(ctx, sizeof(upb_OneofDef) * n); @@ -10523,7 +11071,7 @@ upb_OneofDef* _upb_OneofDefs_New( // Must be last. struct upb_ServiceDef { - const google_protobuf_ServiceOptions* opts; + const UPB_DESC(ServiceOptions) * opts; const upb_FileDef* file; const char* full_name; upb_MethodDef* methods; @@ -10535,7 +11083,8 @@ upb_ServiceDef* _upb_ServiceDef_At(const upb_ServiceDef* s, int index) { return (upb_ServiceDef*)&s[index]; } -const google_protobuf_ServiceOptions* upb_ServiceDef_Options(const upb_ServiceDef* s) { +const UPB_DESC(ServiceOptions) * + upb_ServiceDef_Options(const upb_ServiceDef* s) { return s->opts; } @@ -10578,7 +11127,7 @@ const upb_MethodDef* upb_ServiceDef_FindMethodByName(const upb_ServiceDef* s, } static void create_service(upb_DefBuilder* ctx, - const google_protobuf_ServiceDescriptorProto* svc_proto, + const UPB_DESC(ServiceDescriptorProto) * svc_proto, upb_ServiceDef* s) { upb_StringView name; size_t n; @@ -10586,15 +11135,15 @@ static void create_service(upb_DefBuilder* ctx, // Must happen before _upb_DefBuilder_Add() s->file = _upb_DefBuilder_File(ctx); - name = google_protobuf_ServiceDescriptorProto_name(svc_proto); + name = UPB_DESC(ServiceDescriptorProto_name)(svc_proto); _upb_DefBuilder_CheckIdentNotFull(ctx, name); const char* package = _upb_FileDef_RawPackage(s->file); s->full_name = _upb_DefBuilder_MakeFullName(ctx, package, name); _upb_DefBuilder_Add(ctx, s->full_name, _upb_DefType_Pack(s, UPB_DEFTYPE_SERVICE)); - const google_protobuf_MethodDescriptorProto* const* methods = - google_protobuf_ServiceDescriptorProto_method(svc_proto, &n); + const UPB_DESC(MethodDescriptorProto)* const* methods = + UPB_DESC(ServiceDescriptorProto_method)(svc_proto, &n); s->method_count = n; s->methods = _upb_MethodDefs_New(ctx, n, methods, s); @@ -10604,7 +11153,7 @@ static void create_service(upb_DefBuilder* ctx, upb_ServiceDef* _upb_ServiceDefs_New( upb_DefBuilder* ctx, int n, - const google_protobuf_ServiceDescriptorProto* const* protos) { + const UPB_DESC(ServiceDescriptorProto) * const* protos) { _upb_DefType_CheckPadding(sizeof(upb_ServiceDef)); upb_ServiceDef* s = _upb_DefBuilder_Alloc(ctx, sizeof(upb_ServiceDef) * n); @@ -10667,12 +11216,14 @@ static const char* _upb_Decoder_DecodeMessage(upb_Decoder* d, const char* ptr, UPB_NORETURN static void* _upb_Decoder_ErrorJmp(upb_Decoder* d, upb_DecodeStatus status) { assert(status != kUpb_DecodeStatus_Ok); - UPB_LONGJMP(d->err, status); + d->status = status; + UPB_LONGJMP(d->err, 1); } const char* _upb_FastDecoder_ErrorJmp(upb_Decoder* d, int status) { assert(status != kUpb_DecodeStatus_Ok); - UPB_LONGJMP(d->err, status); + d->status = status; + UPB_LONGJMP(d->err, 1); return NULL; } @@ -10950,27 +11501,21 @@ static const char* _upb_Decoder_DecodeFixedPacked( // Note: if/when the decoder supports multi-buffer input, we will need to // handle buffer seams here. if (_upb_IsLittleEndian()) { - memcpy(mem, ptr, val->size); - ptr += val->size; + ptr = upb_EpsCopyInputStream_Copy(&d->input, ptr, mem, val->size); } else { - const char* end = ptr + val->size; + int delta = upb_EpsCopyInputStream_PushLimit(&d->input, ptr, val->size); char* dst = mem; - while (ptr < end) { + while (!_upb_Decoder_IsDone(d, &ptr)) { if (lg2 == 2) { - uint32_t val; - memcpy(&val, ptr, sizeof(val)); - val = _upb_BigEndian_Swap32(val); - memcpy(dst, &val, sizeof(val)); + ptr = upb_WireReader_ReadFixed32(ptr, dst); + dst += 4; } else { UPB_ASSERT(lg2 == 3); - uint64_t val; - memcpy(&val, ptr, sizeof(val)); - val = _upb_BigEndian_Swap64(val); - memcpy(dst, &val, sizeof(val)); + ptr = upb_WireReader_ReadFixed64(ptr, dst); + dst += 8; } - ptr += 1 << lg2; - dst += 1 << lg2; } + upb_EpsCopyInputStream_PopLimit(&d->input, ptr, delta); } return ptr; @@ -11607,21 +12152,17 @@ static const char* _upb_Decoder_DecodeWireValue(upb_Decoder* d, const char* ptr, _upb_Decoder_Munge(field->descriptortype, val); return ptr; case kUpb_WireType_32Bit: - memcpy(&val->uint32_val, ptr, 4); - val->uint32_val = _upb_BigEndian_Swap32(val->uint32_val); *op = kUpb_DecodeOp_Scalar4Byte; if (((1 << field->descriptortype) & kFixed32OkMask) == 0) { *op = kUpb_DecodeOp_UnknownField; } - return ptr + 4; + return upb_WireReader_ReadFixed32(ptr, &val->uint32_val); case kUpb_WireType_64Bit: - memcpy(&val->uint64_val, ptr, 8); - val->uint64_val = _upb_BigEndian_Swap64(val->uint64_val); *op = kUpb_DecodeOp_Scalar8Byte; if (((1 << field->descriptortype) & kFixed64OkMask) == 0) { *op = kUpb_DecodeOp_UnknownField; } - return ptr + 8; + return upb_WireReader_ReadFixed64(ptr, &val->uint64_val); case kUpb_WireType_Delimited: ptr = upb_Decoder_DecodeSize(d, ptr, &val->size); *op = _upb_Decoder_GetDelimitedOp(mt, field); @@ -11853,16 +12394,18 @@ upb_DecodeStatus upb_Decode(const char* buf, size_t size, void* msg, state.arena.last_size = arena->last_size; state.arena.cleanup_metadata = arena->cleanup_metadata; state.arena.parent = arena; + state.status = kUpb_DecodeStatus_Ok; - upb_DecodeStatus status = UPB_SETJMP(state.err); - if (UPB_LIKELY(status == kUpb_DecodeStatus_Ok)) { - status = _upb_Decoder_DecodeTop(&state, buf, msg, l); + if (UPB_SETJMP(state.err) == 0) { + state.status = _upb_Decoder_DecodeTop(&state, buf, msg, l); + } else { + UPB_ASSERT(state.status != kUpb_DecodeStatus_Ok); } arena->head.ptr = state.arena.head.ptr; arena->head.end = state.arena.head.end; arena->cleanup_metadata = state.arena.cleanup_metadata; - return status; + return state.status; } #undef OP_FIXPCK_LG2 @@ -12882,6 +13425,7 @@ static uint64_t encode_zz64(int64_t n) { } typedef struct { + upb_EncodeStatus status; jmp_buf err; upb_Arena* arena; char *buf, *ptr, *limit; @@ -12899,7 +13443,9 @@ static size_t upb_roundup_pow2(size_t bytes) { } UPB_NORETURN static void encode_err(upb_encstate* e, upb_EncodeStatus s) { - UPB_LONGJMP(e->err, s); + UPB_ASSERT(s != kUpb_EncodeStatus_Ok); + e->status = s; + UPB_LONGJMP(e->err, 1); } UPB_NOINLINE @@ -13389,6 +13935,7 @@ upb_EncodeStatus upb_Encode(const void* msg, const upb_MiniTable* l, upb_encstate e; unsigned depth = (unsigned)options >> 16; + e.status = kUpb_EncodeStatus_Ok; e.arena = arena; e.buf = NULL; e.limit = NULL; @@ -13397,13 +13944,11 @@ upb_EncodeStatus upb_Encode(const void* msg, const upb_MiniTable* l, e.options = options; _upb_mapsorter_init(&e.sorter); - upb_EncodeStatus status = UPB_SETJMP(e.err); - // Unfortunately we must continue to perform hackery here because there are // code paths which blindly copy the returned pointer without bothering to // check for errors until much later (b/235839510). So we still set *buf to // NULL on error and we still set it to non-NULL on a successful empty result. - if (status == kUpb_EncodeStatus_Ok) { + if (UPB_SETJMP(e.err) == 0) { encode_message(&e, msg, l, size); *size = e.limit - e.ptr; if (*size == 0) { @@ -13414,12 +13959,13 @@ upb_EncodeStatus upb_Encode(const void* msg, const upb_MiniTable* l, *buf = e.ptr; } } else { + UPB_ASSERT(e.status != kUpb_EncodeStatus_Ok); *buf = NULL; *size = 0; } _upb_mapsorter_destroy(&e.sorter); - return status; + return e.status; } @@ -13443,9 +13989,9 @@ _upb_WireReader_ReadLongVarint(const char* ptr, uint64_t val) { return ret; } -const char* upb_WireReader_SkipGroup(const char* ptr, uint32_t tag, - int depth_limit, - upb_EpsCopyInputStream* stream) { +const char* _upb_WireReader_SkipGroup(const char* ptr, uint32_t tag, + int depth_limit, + upb_EpsCopyInputStream* stream) { if (--depth_limit == 0) return NULL; uint32_t end_group_tag = (tag & ~7ULL) | kUpb_WireType_EndGroup; while (!upb_EpsCopyInputStream_IsDone(stream, &ptr)) { @@ -13453,7 +13999,7 @@ const char* upb_WireReader_SkipGroup(const char* ptr, uint32_t tag, ptr = upb_WireReader_ReadTag(ptr, &tag); if (!ptr) return NULL; if (tag == end_group_tag) return ptr; - ptr = upb_WireReader_SkipValue(ptr, tag, depth_limit, stream); + ptr = _upb_WireReader_SkipValue(ptr, tag, depth_limit, stream); if (!ptr) return NULL; } return ptr; @@ -13490,6 +14036,7 @@ const char* upb_WireReader_SkipGroup(const char* ptr, uint32_t tag, #undef UPB_PTRADD #undef UPB_MUSTTAIL #undef UPB_FASTTABLE_SUPPORTED +#undef UPB_FASTTABLE_MASK #undef UPB_FASTTABLE #undef UPB_FASTTABLE_INIT #undef UPB_POISON_MEMORY_REGION @@ -13498,3 +14045,6 @@ const char* upb_WireReader_SkipGroup(const char* ptr, uint32_t tag, #undef UPB_TREAT_PROTO2_ENUMS_LIKE_PROTO3 #undef UPB_DEPRECATED #undef UPB_GNUC_MIN +#undef UPB_DESCRIPTOR_UPB_H_FILENAME +#undef UPB_DESC +#undef UPB_IS_GOOGLE3 diff --git a/php/ext/google/protobuf/php-upb.h b/php/ext/google/protobuf/php-upb.h index 313cceee28..868d15d817 100644 --- a/php/ext/google/protobuf/php-upb.h +++ b/php/ext/google/protobuf/php-upb.h @@ -85,7 +85,11 @@ #define UPB_ALIGN_UP(size, align) (((size) + (align) - 1) / (align) * (align)) #define UPB_ALIGN_DOWN(size, align) ((size) / (align) * (align)) #define UPB_ALIGN_MALLOC(size) UPB_ALIGN_UP(size, UPB_MALLOC_ALIGN) +#ifdef __clang__ +#define UPB_ALIGN_OF(type) _Alignof(type) +#else #define UPB_ALIGN_OF(type) offsetof (struct { char c; type member; }, member) +#endif // Hints to the compiler about likely/unlikely branches. #if defined (__GNUC__) || defined(__clang__) @@ -218,11 +222,13 @@ #endif /* UPB_FASTTABLE_INIT() allows protos compiled for fasttable to gracefully - * degrade to non-fasttable if we are using UPB_TRY_ENABLE_FASTTABLE. */ -#if !UPB_FASTTABLE && defined(UPB_TRY_ENABLE_FASTTABLE) + * degrade to non-fasttable if the runtime or platform do not support it. */ +#if !UPB_FASTTABLE #define UPB_FASTTABLE_INIT(...) +#define UPB_FASTTABLE_MASK(mask) -1 #else #define UPB_FASTTABLE_INIT(...) __VA_ARGS__ +#define UPB_FASTTABLE_MASK(mask) mask #endif #undef UPB_FASTTABLE_SUPPORTED @@ -278,6 +284,16 @@ void __asan_unpoison_memory_region(void const volatile *addr, size_t size); #define UPB_DEPRECATED #endif +// begin:google_only +// #define UPB_IS_GOOGLE3 +// end:google_only + +#if defined(UPB_IS_GOOGLE3) && !defined(UPB_BOOTSTRAP_STAGE0) +#define UPB_DESC(sym) proto2_##sym +#else +#define UPB_DESC(sym) google_protobuf_##sym +#endif + #ifndef UPB_BASE_STATUS_H_ #define UPB_BASE_STATUS_H_ @@ -2257,8 +2273,10 @@ UPB_API_INLINE const upb_MiniTableEnum* upb_MiniTable_GetSubEnumTable( #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Warray-bounds" #pragma GCC diagnostic ignored "-Wstringop-overflow" +#if __GNUC__ >= 11 #pragma GCC diagnostic ignored "-Wstringop-overread" #endif +#endif #ifdef __cplusplus extern "C" { @@ -2496,7 +2514,7 @@ UPB_INLINE void _upb_Message_ClearNonExtensionField( field); } -UPB_INLINE upb_Map* _upb_MiniTable_GetOrCreateMutableMap( +UPB_INLINE upb_Map* _upb_Message_GetOrCreateMutableMap( upb_Message* msg, const upb_MiniTableField* field, size_t key_size, size_t val_size, upb_Arena* arena) { _upb_MiniTableField_CheckIsMap(field); @@ -2607,7 +2625,7 @@ UPB_API_INLINE bool upb_Message_SetUInt32(upb_Message* msg, return _upb_Message_SetField(msg, field, &value, a); } -UPB_API_INLINE void upb_MiniTable_SetEnumProto2( +UPB_API_INLINE void upb_Message_SetEnumProto2( upb_Message* msg, const upb_MiniTable* msg_mini_table, const upb_MiniTableField* field, int32_t value) { UPB_ASSERT(field->descriptortype == kUpb_FieldType_Enum); @@ -2726,7 +2744,7 @@ UPB_API_INLINE bool upb_Message_SetString(upb_Message* msg, return _upb_Message_SetField(msg, field, &value, a); } -UPB_API_INLINE const upb_Message* upb_MiniTable_GetMessage( +UPB_API_INLINE const upb_Message* upb_Message_GetMessage( const upb_Message* msg, const upb_MiniTableField* field, upb_Message* default_val) { UPB_ASSERT(field->descriptortype == kUpb_FieldType_Message || @@ -2739,10 +2757,10 @@ UPB_API_INLINE const upb_Message* upb_MiniTable_GetMessage( return ret; } -UPB_API_INLINE void upb_MiniTable_SetMessage(upb_Message* msg, - const upb_MiniTable* mini_table, - const upb_MiniTableField* field, - upb_Message* sub_message) { +UPB_API_INLINE void upb_Message_SetMessage(upb_Message* msg, + const upb_MiniTable* mini_table, + const upb_MiniTableField* field, + upb_Message* sub_message) { UPB_ASSERT(field->descriptortype == kUpb_FieldType_Message || field->descriptortype == kUpb_FieldType_Group); UPB_ASSUME(!upb_IsRepeatedOrMap(field)); @@ -2752,7 +2770,7 @@ UPB_API_INLINE void upb_MiniTable_SetMessage(upb_Message* msg, _upb_Message_SetNonExtensionField(msg, field, &sub_message); } -UPB_API_INLINE upb_Message* upb_MiniTable_GetMutableMessage( +UPB_API_INLINE upb_Message* upb_Message_GetOrCreateMutableMessage( upb_Message* msg, const upb_MiniTable* mini_table, const upb_MiniTableField* field, upb_Arena* arena) { UPB_ASSERT(field->descriptortype == kUpb_FieldType_Message || @@ -2832,8 +2850,7 @@ UPB_API_INLINE const upb_Map* upb_Message_GetMap( return ret; } -// TODO: rename to GetOrCreateMutableMap -UPB_API_INLINE upb_Map* upb_MiniTable_GetMutableMap( +UPB_API_INLINE upb_Map* upb_Message_GetOrCreateMutableMap( upb_Message* msg, const upb_MiniTable* map_entry_mini_table, const upb_MiniTableField* field, upb_Arena* arena) { UPB_ASSERT(field->descriptortype == kUpb_FieldType_Message || @@ -2842,7 +2859,7 @@ UPB_API_INLINE upb_Map* upb_MiniTable_GetMutableMap( &map_entry_mini_table->fields[0]; const upb_MiniTableField* map_entry_value_field = &map_entry_mini_table->fields[1]; - return _upb_MiniTable_GetOrCreateMutableMap( + return _upb_Message_GetOrCreateMutableMap( msg, field, _upb_Map_CTypeSize(upb_MiniTableField_CType(map_entry_key_field)), _upb_Map_CTypeSize(upb_MiniTableField_CType(map_entry_value_field)), @@ -2922,7 +2939,7 @@ typedef struct { // Promotes unknown data inside message to a upb_Message parsing the unknown. // // The unknown data is removed from message after field value is set -// using upb_MiniTable_SetMessage. +// using upb_Message_SetMessage. upb_UnknownToMessageRet upb_MiniTable_PromoteUnknownToMessage( upb_Message* msg, const upb_MiniTable* mini_table, const upb_MiniTableField* field, const upb_MiniTable* sub_mini_table, @@ -3209,6 +3226,7 @@ upb_EncodeStatus upb_Encode(const void* msg, const upb_MiniTable* l, #endif /* UPB_WIRE_ENCODE_H_ */ +// Must be last. #ifdef __cplusplus extern "C" { @@ -3269,12 +3287,6 @@ extern const upb_MiniTable google_protobuf_SourceCodeInfo_Location_msg_init; extern const upb_MiniTable google_protobuf_GeneratedCodeInfo_msg_init; extern const upb_MiniTable google_protobuf_GeneratedCodeInfo_Annotation_msg_init; -typedef enum { - google_protobuf_FieldDescriptorProto_LABEL_OPTIONAL = 1, - google_protobuf_FieldDescriptorProto_LABEL_REQUIRED = 2, - google_protobuf_FieldDescriptorProto_LABEL_REPEATED = 3 -} google_protobuf_FieldDescriptorProto_Label; - typedef enum { google_protobuf_FieldDescriptorProto_TYPE_DOUBLE = 1, google_protobuf_FieldDescriptorProto_TYPE_FLOAT = 2, @@ -3296,6 +3308,18 @@ typedef enum { google_protobuf_FieldDescriptorProto_TYPE_SINT64 = 18 } google_protobuf_FieldDescriptorProto_Type; +typedef enum { + google_protobuf_FieldDescriptorProto_LABEL_OPTIONAL = 1, + google_protobuf_FieldDescriptorProto_LABEL_REQUIRED = 2, + google_protobuf_FieldDescriptorProto_LABEL_REPEATED = 3 +} google_protobuf_FieldDescriptorProto_Label; + +typedef enum { + google_protobuf_FileOptions_SPEED = 1, + google_protobuf_FileOptions_CODE_SIZE = 2, + google_protobuf_FileOptions_LITE_RUNTIME = 3 +} google_protobuf_FileOptions_OptimizeMode; + typedef enum { google_protobuf_FieldOptions_STRING = 0, google_protobuf_FieldOptions_CORD = 1, @@ -3309,10 +3333,10 @@ typedef enum { } google_protobuf_FieldOptions_JSType; typedef enum { - google_protobuf_FileOptions_SPEED = 1, - google_protobuf_FileOptions_CODE_SIZE = 2, - google_protobuf_FileOptions_LITE_RUNTIME = 3 -} google_protobuf_FileOptions_OptimizeMode; + google_protobuf_MethodOptions_IDEMPOTENCY_UNKNOWN = 0, + google_protobuf_MethodOptions_NO_SIDE_EFFECTS = 1, + google_protobuf_MethodOptions_IDEMPOTENT = 2 +} google_protobuf_MethodOptions_IdempotencyLevel; typedef enum { google_protobuf_GeneratedCodeInfo_Annotation_NONE = 0, @@ -3320,20 +3344,14 @@ typedef enum { google_protobuf_GeneratedCodeInfo_Annotation_ALIAS = 2 } google_protobuf_GeneratedCodeInfo_Annotation_Semantic; -typedef enum { - google_protobuf_MethodOptions_IDEMPOTENCY_UNKNOWN = 0, - google_protobuf_MethodOptions_NO_SIDE_EFFECTS = 1, - google_protobuf_MethodOptions_IDEMPOTENT = 2 -} google_protobuf_MethodOptions_IdempotencyLevel; - -extern const upb_MiniTableEnum google_protobuf_FieldDescriptorProto_Label_enum_init; extern const upb_MiniTableEnum google_protobuf_FieldDescriptorProto_Type_enum_init; +extern const upb_MiniTableEnum google_protobuf_FieldDescriptorProto_Label_enum_init; +extern const upb_MiniTableEnum google_protobuf_FileOptions_OptimizeMode_enum_init; extern const upb_MiniTableEnum google_protobuf_FieldOptions_CType_enum_init; extern const upb_MiniTableEnum google_protobuf_FieldOptions_JSType_enum_init; -extern const upb_MiniTableEnum google_protobuf_FileOptions_OptimizeMode_enum_init; -extern const upb_MiniTableEnum google_protobuf_GeneratedCodeInfo_Annotation_Semantic_enum_init; extern const upb_MiniTableEnum google_protobuf_MethodOptions_IdempotencyLevel_enum_init; +extern const upb_MiniTableEnum google_protobuf_GeneratedCodeInfo_Annotation_Semantic_enum_init; /* google.protobuf.FileDescriptorSet */ @@ -3687,10 +3705,12 @@ UPB_INLINE bool google_protobuf_FileDescriptorProto_has_edition(const google_pro UPB_INLINE void google_protobuf_FileDescriptorProto_set_name(google_protobuf_FileDescriptorProto *msg, upb_StringView value) { const upb_MiniTableField field = {1, UPB_SIZE(40, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FileDescriptorProto_set_package(google_protobuf_FileDescriptorProto *msg, upb_StringView value) { +} +UPB_INLINE void google_protobuf_FileDescriptorProto_set_package(google_protobuf_FileDescriptorProto *msg, upb_StringView value) { const upb_MiniTableField field = {2, UPB_SIZE(48, 24), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE upb_StringView* google_protobuf_FileDescriptorProto_mutable_dependency(google_protobuf_FileDescriptorProto* msg, size_t* size) { +} +UPB_INLINE upb_StringView* google_protobuf_FileDescriptorProto_mutable_dependency(google_protobuf_FileDescriptorProto* msg, size_t* size) { upb_MiniTableField field = {3, UPB_SIZE(4, 40), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { @@ -3821,7 +3841,8 @@ UPB_INLINE struct google_protobuf_FieldDescriptorProto* google_protobuf_FileDesc UPB_INLINE void google_protobuf_FileDescriptorProto_set_options(google_protobuf_FileDescriptorProto *msg, google_protobuf_FileOptions* value) { const upb_MiniTableField field = {8, UPB_SIZE(24, 80), 3, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE struct google_protobuf_FileOptions* google_protobuf_FileDescriptorProto_mutable_options(google_protobuf_FileDescriptorProto* msg, upb_Arena* arena) { +} +UPB_INLINE struct google_protobuf_FileOptions* google_protobuf_FileDescriptorProto_mutable_options(google_protobuf_FileDescriptorProto* msg, upb_Arena* arena) { struct google_protobuf_FileOptions* sub = (struct google_protobuf_FileOptions*)google_protobuf_FileDescriptorProto_options(msg); if (sub == NULL) { sub = (struct google_protobuf_FileOptions*)_upb_Message_New(&google_protobuf_FileOptions_msg_init, arena); @@ -3832,7 +3853,8 @@ UPB_INLINE void google_protobuf_FileDescriptorProto_set_options(google_protobuf_ UPB_INLINE void google_protobuf_FileDescriptorProto_set_source_code_info(google_protobuf_FileDescriptorProto *msg, google_protobuf_SourceCodeInfo* value) { const upb_MiniTableField field = {9, UPB_SIZE(28, 88), 4, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE struct google_protobuf_SourceCodeInfo* google_protobuf_FileDescriptorProto_mutable_source_code_info(google_protobuf_FileDescriptorProto* msg, upb_Arena* arena) { +} +UPB_INLINE struct google_protobuf_SourceCodeInfo* google_protobuf_FileDescriptorProto_mutable_source_code_info(google_protobuf_FileDescriptorProto* msg, upb_Arena* arena) { struct google_protobuf_SourceCodeInfo* sub = (struct google_protobuf_SourceCodeInfo*)google_protobuf_FileDescriptorProto_source_code_info(msg); if (sub == NULL) { sub = (struct google_protobuf_SourceCodeInfo*)_upb_Message_New(&google_protobuf_SourceCodeInfo_msg_init, arena); @@ -3891,10 +3913,12 @@ UPB_INLINE bool google_protobuf_FileDescriptorProto_add_weak_dependency(google_p UPB_INLINE void google_protobuf_FileDescriptorProto_set_syntax(google_protobuf_FileDescriptorProto *msg, upb_StringView value) { const upb_MiniTableField field = {12, UPB_SIZE(56, 112), 5, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FileDescriptorProto_set_edition(google_protobuf_FileDescriptorProto *msg, upb_StringView value) { +} +UPB_INLINE void google_protobuf_FileDescriptorProto_set_edition(google_protobuf_FileDescriptorProto *msg, upb_StringView value) { const upb_MiniTableField field = {13, UPB_SIZE(64, 128), 6, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); } + /* google.protobuf.DescriptorProto */ UPB_INLINE google_protobuf_DescriptorProto* google_protobuf_DescriptorProto_new(upb_Arena* arena) { @@ -4124,7 +4148,8 @@ UPB_INLINE bool google_protobuf_DescriptorProto_has_reserved_name(const google_p UPB_INLINE void google_protobuf_DescriptorProto_set_name(google_protobuf_DescriptorProto *msg, upb_StringView value) { const upb_MiniTableField field = {1, UPB_SIZE(40, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProto_mutable_field(google_protobuf_DescriptorProto* msg, size_t* size) { +} +UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProto_mutable_field(google_protobuf_DescriptorProto* msg, size_t* size) { upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { @@ -4257,7 +4282,8 @@ UPB_INLINE struct google_protobuf_FieldDescriptorProto* google_protobuf_Descript UPB_INLINE void google_protobuf_DescriptorProto_set_options(google_protobuf_DescriptorProto *msg, google_protobuf_MessageOptions* value) { const upb_MiniTableField field = {7, UPB_SIZE(24, 64), 2, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE struct google_protobuf_MessageOptions* google_protobuf_DescriptorProto_mutable_options(google_protobuf_DescriptorProto* msg, upb_Arena* arena) { +} +UPB_INLINE struct google_protobuf_MessageOptions* google_protobuf_DescriptorProto_mutable_options(google_protobuf_DescriptorProto* msg, upb_Arena* arena) { struct google_protobuf_MessageOptions* sub = (struct google_protobuf_MessageOptions*)google_protobuf_DescriptorProto_options(msg); if (sub == NULL) { sub = (struct google_protobuf_MessageOptions*)_upb_Message_New(&google_protobuf_MessageOptions_msg_init, arena); @@ -4426,13 +4452,16 @@ UPB_INLINE bool google_protobuf_DescriptorProto_ExtensionRange_has_options(const UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_set_start(google_protobuf_DescriptorProto_ExtensionRange *msg, int32_t value) { const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_set_end(google_protobuf_DescriptorProto_ExtensionRange *msg, int32_t value) { +} +UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_set_end(google_protobuf_DescriptorProto_ExtensionRange *msg, int32_t value) { const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_set_options(google_protobuf_DescriptorProto_ExtensionRange *msg, google_protobuf_ExtensionRangeOptions* value) { +} +UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_set_options(google_protobuf_DescriptorProto_ExtensionRange *msg, google_protobuf_ExtensionRangeOptions* value) { const upb_MiniTableField field = {3, UPB_SIZE(12, 16), 3, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE struct google_protobuf_ExtensionRangeOptions* google_protobuf_DescriptorProto_ExtensionRange_mutable_options(google_protobuf_DescriptorProto_ExtensionRange* msg, upb_Arena* arena) { +} +UPB_INLINE struct google_protobuf_ExtensionRangeOptions* google_protobuf_DescriptorProto_ExtensionRange_mutable_options(google_protobuf_DescriptorProto_ExtensionRange* msg, upb_Arena* arena) { struct google_protobuf_ExtensionRangeOptions* sub = (struct google_protobuf_ExtensionRangeOptions*)google_protobuf_DescriptorProto_ExtensionRange_options(msg); if (sub == NULL) { sub = (struct google_protobuf_ExtensionRangeOptions*)_upb_Message_New(&google_protobuf_ExtensionRangeOptions_msg_init, arena); @@ -4510,10 +4539,12 @@ UPB_INLINE bool google_protobuf_DescriptorProto_ReservedRange_has_end(const goog UPB_INLINE void google_protobuf_DescriptorProto_ReservedRange_set_start(google_protobuf_DescriptorProto_ReservedRange *msg, int32_t value) { const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_DescriptorProto_ReservedRange_set_end(google_protobuf_DescriptorProto_ReservedRange *msg, int32_t value) { +} +UPB_INLINE void google_protobuf_DescriptorProto_ReservedRange_set_end(google_protobuf_DescriptorProto_ReservedRange *msg, int32_t value) { const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); } + /* google.protobuf.ExtensionRangeOptions */ UPB_INLINE google_protobuf_ExtensionRangeOptions* google_protobuf_ExtensionRangeOptions_new(upb_Arena* arena) { @@ -4801,28 +4832,36 @@ UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_proto3_optional(const g UPB_INLINE void google_protobuf_FieldDescriptorProto_set_name(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) { const upb_MiniTableField field = {1, UPB_SIZE(28, 24), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FieldDescriptorProto_set_extendee(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) { +} +UPB_INLINE void google_protobuf_FieldDescriptorProto_set_extendee(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) { const upb_MiniTableField field = {2, UPB_SIZE(36, 40), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FieldDescriptorProto_set_number(google_protobuf_FieldDescriptorProto *msg, int32_t value) { +} +UPB_INLINE void google_protobuf_FieldDescriptorProto_set_number(google_protobuf_FieldDescriptorProto *msg, int32_t value) { const upb_MiniTableField field = {3, 4, 3, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FieldDescriptorProto_set_label(google_protobuf_FieldDescriptorProto *msg, int32_t value) { +} +UPB_INLINE void google_protobuf_FieldDescriptorProto_set_label(google_protobuf_FieldDescriptorProto *msg, int32_t value) { const upb_MiniTableField field = {4, 8, 4, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FieldDescriptorProto_set_type(google_protobuf_FieldDescriptorProto *msg, int32_t value) { +} +UPB_INLINE void google_protobuf_FieldDescriptorProto_set_type(google_protobuf_FieldDescriptorProto *msg, int32_t value) { const upb_MiniTableField field = {5, 12, 5, 1, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FieldDescriptorProto_set_type_name(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) { +} +UPB_INLINE void google_protobuf_FieldDescriptorProto_set_type_name(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) { const upb_MiniTableField field = {6, UPB_SIZE(44, 56), 6, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FieldDescriptorProto_set_default_value(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) { +} +UPB_INLINE void google_protobuf_FieldDescriptorProto_set_default_value(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) { const upb_MiniTableField field = {7, UPB_SIZE(52, 72), 7, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FieldDescriptorProto_set_options(google_protobuf_FieldDescriptorProto *msg, google_protobuf_FieldOptions* value) { +} +UPB_INLINE void google_protobuf_FieldDescriptorProto_set_options(google_protobuf_FieldDescriptorProto *msg, google_protobuf_FieldOptions* value) { const upb_MiniTableField field = {8, UPB_SIZE(16, 88), 8, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE struct google_protobuf_FieldOptions* google_protobuf_FieldDescriptorProto_mutable_options(google_protobuf_FieldDescriptorProto* msg, upb_Arena* arena) { +} +UPB_INLINE struct google_protobuf_FieldOptions* google_protobuf_FieldDescriptorProto_mutable_options(google_protobuf_FieldDescriptorProto* msg, upb_Arena* arena) { struct google_protobuf_FieldOptions* sub = (struct google_protobuf_FieldOptions*)google_protobuf_FieldDescriptorProto_options(msg); if (sub == NULL) { sub = (struct google_protobuf_FieldOptions*)_upb_Message_New(&google_protobuf_FieldOptions_msg_init, arena); @@ -4833,13 +4872,16 @@ UPB_INLINE void google_protobuf_FieldDescriptorProto_set_name(google_protobuf_Fi UPB_INLINE void google_protobuf_FieldDescriptorProto_set_oneof_index(google_protobuf_FieldDescriptorProto *msg, int32_t value) { const upb_MiniTableField field = {9, UPB_SIZE(20, 16), 9, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FieldDescriptorProto_set_json_name(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) { +} +UPB_INLINE void google_protobuf_FieldDescriptorProto_set_json_name(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) { const upb_MiniTableField field = {10, UPB_SIZE(60, 96), 10, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FieldDescriptorProto_set_proto3_optional(google_protobuf_FieldDescriptorProto *msg, bool value) { +} +UPB_INLINE void google_protobuf_FieldDescriptorProto_set_proto3_optional(google_protobuf_FieldDescriptorProto *msg, bool value) { const upb_MiniTableField field = {17, UPB_SIZE(24, 20), 11, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); } + /* google.protobuf.OneofDescriptorProto */ UPB_INLINE google_protobuf_OneofDescriptorProto* google_protobuf_OneofDescriptorProto_new(upb_Arena* arena) { @@ -4909,10 +4951,12 @@ UPB_INLINE bool google_protobuf_OneofDescriptorProto_has_options(const google_pr UPB_INLINE void google_protobuf_OneofDescriptorProto_set_name(google_protobuf_OneofDescriptorProto *msg, upb_StringView value) { const upb_MiniTableField field = {1, 8, 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_OneofDescriptorProto_set_options(google_protobuf_OneofDescriptorProto *msg, google_protobuf_OneofOptions* value) { +} +UPB_INLINE void google_protobuf_OneofDescriptorProto_set_options(google_protobuf_OneofDescriptorProto *msg, google_protobuf_OneofOptions* value) { const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 2, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE struct google_protobuf_OneofOptions* google_protobuf_OneofDescriptorProto_mutable_options(google_protobuf_OneofDescriptorProto* msg, upb_Arena* arena) { +} +UPB_INLINE struct google_protobuf_OneofOptions* google_protobuf_OneofDescriptorProto_mutable_options(google_protobuf_OneofDescriptorProto* msg, upb_Arena* arena) { struct google_protobuf_OneofOptions* sub = (struct google_protobuf_OneofOptions*)google_protobuf_OneofDescriptorProto_options(msg); if (sub == NULL) { sub = (struct google_protobuf_OneofOptions*)_upb_Message_New(&google_protobuf_OneofOptions_msg_init, arena); @@ -5050,7 +5094,8 @@ UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_reserved_name(const goog UPB_INLINE void google_protobuf_EnumDescriptorProto_set_name(google_protobuf_EnumDescriptorProto *msg, upb_StringView value) { const upb_MiniTableField field = {1, UPB_SIZE(20, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE google_protobuf_EnumValueDescriptorProto** google_protobuf_EnumDescriptorProto_mutable_value(google_protobuf_EnumDescriptorProto* msg, size_t* size) { +} +UPB_INLINE google_protobuf_EnumValueDescriptorProto** google_protobuf_EnumDescriptorProto_mutable_value(google_protobuf_EnumDescriptorProto* msg, size_t* size) { upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { @@ -5079,7 +5124,8 @@ UPB_INLINE struct google_protobuf_EnumValueDescriptorProto* google_protobuf_Enum UPB_INLINE void google_protobuf_EnumDescriptorProto_set_options(google_protobuf_EnumDescriptorProto *msg, google_protobuf_EnumOptions* value) { const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE struct google_protobuf_EnumOptions* google_protobuf_EnumDescriptorProto_mutable_options(google_protobuf_EnumDescriptorProto* msg, upb_Arena* arena) { +} +UPB_INLINE struct google_protobuf_EnumOptions* google_protobuf_EnumDescriptorProto_mutable_options(google_protobuf_EnumDescriptorProto* msg, upb_Arena* arena) { struct google_protobuf_EnumOptions* sub = (struct google_protobuf_EnumOptions*)google_protobuf_EnumDescriptorProto_options(msg); if (sub == NULL) { sub = (struct google_protobuf_EnumOptions*)_upb_Message_New(&google_protobuf_EnumOptions_msg_init, arena); @@ -5207,10 +5253,12 @@ UPB_INLINE bool google_protobuf_EnumDescriptorProto_EnumReservedRange_has_end(co UPB_INLINE void google_protobuf_EnumDescriptorProto_EnumReservedRange_set_start(google_protobuf_EnumDescriptorProto_EnumReservedRange *msg, int32_t value) { const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_EnumDescriptorProto_EnumReservedRange_set_end(google_protobuf_EnumDescriptorProto_EnumReservedRange *msg, int32_t value) { +} +UPB_INLINE void google_protobuf_EnumDescriptorProto_EnumReservedRange_set_end(google_protobuf_EnumDescriptorProto_EnumReservedRange *msg, int32_t value) { const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); } + /* google.protobuf.EnumValueDescriptorProto */ UPB_INLINE google_protobuf_EnumValueDescriptorProto* google_protobuf_EnumValueDescriptorProto_new(upb_Arena* arena) { @@ -5295,13 +5343,16 @@ UPB_INLINE bool google_protobuf_EnumValueDescriptorProto_has_options(const googl UPB_INLINE void google_protobuf_EnumValueDescriptorProto_set_name(google_protobuf_EnumValueDescriptorProto *msg, upb_StringView value) { const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_EnumValueDescriptorProto_set_number(google_protobuf_EnumValueDescriptorProto *msg, int32_t value) { +} +UPB_INLINE void google_protobuf_EnumValueDescriptorProto_set_number(google_protobuf_EnumValueDescriptorProto *msg, int32_t value) { const upb_MiniTableField field = {2, 4, 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_EnumValueDescriptorProto_set_options(google_protobuf_EnumValueDescriptorProto *msg, google_protobuf_EnumValueOptions* value) { +} +UPB_INLINE void google_protobuf_EnumValueDescriptorProto_set_options(google_protobuf_EnumValueDescriptorProto *msg, google_protobuf_EnumValueOptions* value) { const upb_MiniTableField field = {3, UPB_SIZE(8, 24), 3, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE struct google_protobuf_EnumValueOptions* google_protobuf_EnumValueDescriptorProto_mutable_options(google_protobuf_EnumValueDescriptorProto* msg, upb_Arena* arena) { +} +UPB_INLINE struct google_protobuf_EnumValueOptions* google_protobuf_EnumValueDescriptorProto_mutable_options(google_protobuf_EnumValueDescriptorProto* msg, upb_Arena* arena) { struct google_protobuf_EnumValueOptions* sub = (struct google_protobuf_EnumValueOptions*)google_protobuf_EnumValueDescriptorProto_options(msg); if (sub == NULL) { sub = (struct google_protobuf_EnumValueOptions*)_upb_Message_New(&google_protobuf_EnumValueOptions_msg_init, arena); @@ -5399,7 +5450,8 @@ UPB_INLINE bool google_protobuf_ServiceDescriptorProto_has_options(const google_ UPB_INLINE void google_protobuf_ServiceDescriptorProto_set_name(google_protobuf_ServiceDescriptorProto *msg, upb_StringView value) { const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE google_protobuf_MethodDescriptorProto** google_protobuf_ServiceDescriptorProto_mutable_method(google_protobuf_ServiceDescriptorProto* msg, size_t* size) { +} +UPB_INLINE google_protobuf_MethodDescriptorProto** google_protobuf_ServiceDescriptorProto_mutable_method(google_protobuf_ServiceDescriptorProto* msg, size_t* size) { upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { @@ -5428,7 +5480,8 @@ UPB_INLINE struct google_protobuf_MethodDescriptorProto* google_protobuf_Service UPB_INLINE void google_protobuf_ServiceDescriptorProto_set_options(google_protobuf_ServiceDescriptorProto *msg, google_protobuf_ServiceOptions* value) { const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE struct google_protobuf_ServiceOptions* google_protobuf_ServiceDescriptorProto_mutable_options(google_protobuf_ServiceDescriptorProto* msg, upb_Arena* arena) { +} +UPB_INLINE struct google_protobuf_ServiceOptions* google_protobuf_ServiceDescriptorProto_mutable_options(google_protobuf_ServiceDescriptorProto* msg, upb_Arena* arena) { struct google_protobuf_ServiceOptions* sub = (struct google_protobuf_ServiceOptions*)google_protobuf_ServiceDescriptorProto_options(msg); if (sub == NULL) { sub = (struct google_protobuf_ServiceOptions*)_upb_Message_New(&google_protobuf_ServiceOptions_msg_init, arena); @@ -5566,16 +5619,20 @@ UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_server_streaming(const UPB_INLINE void google_protobuf_MethodDescriptorProto_set_name(google_protobuf_MethodDescriptorProto *msg, upb_StringView value) { const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_MethodDescriptorProto_set_input_type(google_protobuf_MethodDescriptorProto *msg, upb_StringView value) { +} +UPB_INLINE void google_protobuf_MethodDescriptorProto_set_input_type(google_protobuf_MethodDescriptorProto *msg, upb_StringView value) { const upb_MiniTableField field = {2, UPB_SIZE(20, 24), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_MethodDescriptorProto_set_output_type(google_protobuf_MethodDescriptorProto *msg, upb_StringView value) { +} +UPB_INLINE void google_protobuf_MethodDescriptorProto_set_output_type(google_protobuf_MethodDescriptorProto *msg, upb_StringView value) { const upb_MiniTableField field = {3, UPB_SIZE(28, 40), 3, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_MethodDescriptorProto_set_options(google_protobuf_MethodDescriptorProto *msg, google_protobuf_MethodOptions* value) { +} +UPB_INLINE void google_protobuf_MethodDescriptorProto_set_options(google_protobuf_MethodDescriptorProto *msg, google_protobuf_MethodOptions* value) { const upb_MiniTableField field = {4, UPB_SIZE(4, 56), 4, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE struct google_protobuf_MethodOptions* google_protobuf_MethodDescriptorProto_mutable_options(google_protobuf_MethodDescriptorProto* msg, upb_Arena* arena) { +} +UPB_INLINE struct google_protobuf_MethodOptions* google_protobuf_MethodDescriptorProto_mutable_options(google_protobuf_MethodDescriptorProto* msg, upb_Arena* arena) { struct google_protobuf_MethodOptions* sub = (struct google_protobuf_MethodOptions*)google_protobuf_MethodDescriptorProto_options(msg); if (sub == NULL) { sub = (struct google_protobuf_MethodOptions*)_upb_Message_New(&google_protobuf_MethodOptions_msg_init, arena); @@ -5586,10 +5643,12 @@ UPB_INLINE void google_protobuf_MethodDescriptorProto_set_name(google_protobuf_M UPB_INLINE void google_protobuf_MethodDescriptorProto_set_client_streaming(google_protobuf_MethodDescriptorProto *msg, bool value) { const upb_MiniTableField field = {5, UPB_SIZE(8, 1), 5, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_MethodDescriptorProto_set_server_streaming(google_protobuf_MethodDescriptorProto *msg, bool value) { +} +UPB_INLINE void google_protobuf_MethodDescriptorProto_set_server_streaming(google_protobuf_MethodDescriptorProto *msg, bool value) { const upb_MiniTableField field = {6, UPB_SIZE(9, 2), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); } + /* google.protobuf.FileOptions */ UPB_INLINE google_protobuf_FileOptions* google_protobuf_FileOptions_new(upb_Arena* arena) { @@ -5949,64 +6008,84 @@ UPB_INLINE bool google_protobuf_FileOptions_has_uninterpreted_option(const googl UPB_INLINE void google_protobuf_FileOptions_set_java_package(google_protobuf_FileOptions *msg, upb_StringView value) { const upb_MiniTableField field = {1, 24, 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FileOptions_set_java_outer_classname(google_protobuf_FileOptions *msg, upb_StringView value) { +} +UPB_INLINE void google_protobuf_FileOptions_set_java_outer_classname(google_protobuf_FileOptions *msg, upb_StringView value) { const upb_MiniTableField field = {8, UPB_SIZE(32, 40), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FileOptions_set_optimize_for(google_protobuf_FileOptions *msg, int32_t value) { +} +UPB_INLINE void google_protobuf_FileOptions_set_optimize_for(google_protobuf_FileOptions *msg, int32_t value) { const upb_MiniTableField field = {9, 4, 3, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FileOptions_set_java_multiple_files(google_protobuf_FileOptions *msg, bool value) { +} +UPB_INLINE void google_protobuf_FileOptions_set_java_multiple_files(google_protobuf_FileOptions *msg, bool value) { const upb_MiniTableField field = {10, 8, 4, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FileOptions_set_go_package(google_protobuf_FileOptions *msg, upb_StringView value) { +} +UPB_INLINE void google_protobuf_FileOptions_set_go_package(google_protobuf_FileOptions *msg, upb_StringView value) { const upb_MiniTableField field = {11, UPB_SIZE(40, 56), 5, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FileOptions_set_cc_generic_services(google_protobuf_FileOptions *msg, bool value) { +} +UPB_INLINE void google_protobuf_FileOptions_set_cc_generic_services(google_protobuf_FileOptions *msg, bool value) { const upb_MiniTableField field = {16, 9, 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FileOptions_set_java_generic_services(google_protobuf_FileOptions *msg, bool value) { +} +UPB_INLINE void google_protobuf_FileOptions_set_java_generic_services(google_protobuf_FileOptions *msg, bool value) { const upb_MiniTableField field = {17, 10, 7, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FileOptions_set_py_generic_services(google_protobuf_FileOptions *msg, bool value) { +} +UPB_INLINE void google_protobuf_FileOptions_set_py_generic_services(google_protobuf_FileOptions *msg, bool value) { const upb_MiniTableField field = {18, 11, 8, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FileOptions_set_java_generate_equals_and_hash(google_protobuf_FileOptions *msg, bool value) { +} +UPB_INLINE void google_protobuf_FileOptions_set_java_generate_equals_and_hash(google_protobuf_FileOptions *msg, bool value) { const upb_MiniTableField field = {20, 12, 9, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FileOptions_set_deprecated(google_protobuf_FileOptions *msg, bool value) { +} +UPB_INLINE void google_protobuf_FileOptions_set_deprecated(google_protobuf_FileOptions *msg, bool value) { const upb_MiniTableField field = {23, 13, 10, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FileOptions_set_java_string_check_utf8(google_protobuf_FileOptions *msg, bool value) { +} +UPB_INLINE void google_protobuf_FileOptions_set_java_string_check_utf8(google_protobuf_FileOptions *msg, bool value) { const upb_MiniTableField field = {27, 14, 11, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FileOptions_set_cc_enable_arenas(google_protobuf_FileOptions *msg, bool value) { +} +UPB_INLINE void google_protobuf_FileOptions_set_cc_enable_arenas(google_protobuf_FileOptions *msg, bool value) { const upb_MiniTableField field = {31, 15, 12, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FileOptions_set_objc_class_prefix(google_protobuf_FileOptions *msg, upb_StringView value) { +} +UPB_INLINE void google_protobuf_FileOptions_set_objc_class_prefix(google_protobuf_FileOptions *msg, upb_StringView value) { const upb_MiniTableField field = {36, UPB_SIZE(48, 72), 13, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FileOptions_set_csharp_namespace(google_protobuf_FileOptions *msg, upb_StringView value) { +} +UPB_INLINE void google_protobuf_FileOptions_set_csharp_namespace(google_protobuf_FileOptions *msg, upb_StringView value) { const upb_MiniTableField field = {37, UPB_SIZE(56, 88), 14, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FileOptions_set_swift_prefix(google_protobuf_FileOptions *msg, upb_StringView value) { +} +UPB_INLINE void google_protobuf_FileOptions_set_swift_prefix(google_protobuf_FileOptions *msg, upb_StringView value) { const upb_MiniTableField field = {39, UPB_SIZE(64, 104), 15, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FileOptions_set_php_class_prefix(google_protobuf_FileOptions *msg, upb_StringView value) { +} +UPB_INLINE void google_protobuf_FileOptions_set_php_class_prefix(google_protobuf_FileOptions *msg, upb_StringView value) { const upb_MiniTableField field = {40, UPB_SIZE(72, 120), 16, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FileOptions_set_php_namespace(google_protobuf_FileOptions *msg, upb_StringView value) { +} +UPB_INLINE void google_protobuf_FileOptions_set_php_namespace(google_protobuf_FileOptions *msg, upb_StringView value) { const upb_MiniTableField field = {41, UPB_SIZE(80, 136), 17, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FileOptions_set_php_generic_services(google_protobuf_FileOptions *msg, bool value) { +} +UPB_INLINE void google_protobuf_FileOptions_set_php_generic_services(google_protobuf_FileOptions *msg, bool value) { const upb_MiniTableField field = {42, 16, 18, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FileOptions_set_php_metadata_namespace(google_protobuf_FileOptions *msg, upb_StringView value) { +} +UPB_INLINE void google_protobuf_FileOptions_set_php_metadata_namespace(google_protobuf_FileOptions *msg, upb_StringView value) { const upb_MiniTableField field = {44, UPB_SIZE(88, 152), 19, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FileOptions_set_ruby_package(google_protobuf_FileOptions *msg, upb_StringView value) { +} +UPB_INLINE void google_protobuf_FileOptions_set_ruby_package(google_protobuf_FileOptions *msg, upb_StringView value) { const upb_MiniTableField field = {45, UPB_SIZE(96, 168), 20, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FileOptions_mutable_uninterpreted_option(google_protobuf_FileOptions* msg, size_t* size) { +} +UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FileOptions_mutable_uninterpreted_option(google_protobuf_FileOptions* msg, size_t* size) { upb_MiniTableField field = {999, UPB_SIZE(20, 184), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { @@ -6128,6 +6207,21 @@ UPB_INLINE bool google_protobuf_MessageOptions_has_map_entry(const google_protob const upb_MiniTableField field = {7, 4, 4, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; return _upb_Message_HasNonExtensionField(msg, &field); } +UPB_INLINE void google_protobuf_MessageOptions_clear_deprecated_legacy_json_field_conflicts(google_protobuf_MessageOptions* msg) { + const upb_MiniTableField field = {11, 5, 5, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE bool google_protobuf_MessageOptions_deprecated_legacy_json_field_conflicts(const google_protobuf_MessageOptions* msg) { + bool default_val = false; + bool ret; + const upb_MiniTableField field = {11, 5, 5, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_MessageOptions_has_deprecated_legacy_json_field_conflicts(const google_protobuf_MessageOptions* msg) { + const upb_MiniTableField field = {11, 5, 5, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} UPB_INLINE void google_protobuf_MessageOptions_clear_uninterpreted_option(google_protobuf_MessageOptions* msg) { const upb_MiniTableField field = {999, 8, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; _upb_Message_ClearNonExtensionField(msg, &field); @@ -6152,16 +6246,24 @@ UPB_INLINE bool google_protobuf_MessageOptions_has_uninterpreted_option(const go UPB_INLINE void google_protobuf_MessageOptions_set_message_set_wire_format(google_protobuf_MessageOptions *msg, bool value) { const upb_MiniTableField field = {1, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_MessageOptions_set_no_standard_descriptor_accessor(google_protobuf_MessageOptions *msg, bool value) { +} +UPB_INLINE void google_protobuf_MessageOptions_set_no_standard_descriptor_accessor(google_protobuf_MessageOptions *msg, bool value) { const upb_MiniTableField field = {2, 2, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_MessageOptions_set_deprecated(google_protobuf_MessageOptions *msg, bool value) { +} +UPB_INLINE void google_protobuf_MessageOptions_set_deprecated(google_protobuf_MessageOptions *msg, bool value) { const upb_MiniTableField field = {3, 3, 3, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_MessageOptions_set_map_entry(google_protobuf_MessageOptions *msg, bool value) { +} +UPB_INLINE void google_protobuf_MessageOptions_set_map_entry(google_protobuf_MessageOptions *msg, bool value) { const upb_MiniTableField field = {7, 4, 4, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MessageOptions_mutable_uninterpreted_option(google_protobuf_MessageOptions* msg, size_t* size) { +} +UPB_INLINE void google_protobuf_MessageOptions_set_deprecated_legacy_json_field_conflicts(google_protobuf_MessageOptions *msg, bool value) { + const upb_MiniTableField field = {11, 5, 5, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MessageOptions_mutable_uninterpreted_option(google_protobuf_MessageOptions* msg, size_t* size) { upb_MiniTableField field = {999, 8, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { @@ -6328,6 +6430,21 @@ UPB_INLINE bool google_protobuf_FieldOptions_has_unverified_lazy(const google_pr const upb_MiniTableField field = {15, 17, 7, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; return _upb_Message_HasNonExtensionField(msg, &field); } +UPB_INLINE void google_protobuf_FieldOptions_clear_debug_redact(google_protobuf_FieldOptions* msg) { + const upb_MiniTableField field = {16, 18, 8, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE bool google_protobuf_FieldOptions_debug_redact(const google_protobuf_FieldOptions* msg) { + bool default_val = false; + bool ret; + const upb_MiniTableField field = {16, 18, 8, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FieldOptions_has_debug_redact(const google_protobuf_FieldOptions* msg) { + const upb_MiniTableField field = {16, 18, 8, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} UPB_INLINE void google_protobuf_FieldOptions_clear_uninterpreted_option(google_protobuf_FieldOptions* msg) { const upb_MiniTableField field = {999, UPB_SIZE(20, 24), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; _upb_Message_ClearNonExtensionField(msg, &field); @@ -6352,25 +6469,36 @@ UPB_INLINE bool google_protobuf_FieldOptions_has_uninterpreted_option(const goog UPB_INLINE void google_protobuf_FieldOptions_set_ctype(google_protobuf_FieldOptions *msg, int32_t value) { const upb_MiniTableField field = {1, 4, 1, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FieldOptions_set_packed(google_protobuf_FieldOptions *msg, bool value) { +} +UPB_INLINE void google_protobuf_FieldOptions_set_packed(google_protobuf_FieldOptions *msg, bool value) { const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FieldOptions_set_deprecated(google_protobuf_FieldOptions *msg, bool value) { +} +UPB_INLINE void google_protobuf_FieldOptions_set_deprecated(google_protobuf_FieldOptions *msg, bool value) { const upb_MiniTableField field = {3, 9, 3, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FieldOptions_set_lazy(google_protobuf_FieldOptions *msg, bool value) { +} +UPB_INLINE void google_protobuf_FieldOptions_set_lazy(google_protobuf_FieldOptions *msg, bool value) { const upb_MiniTableField field = {5, 10, 4, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FieldOptions_set_jstype(google_protobuf_FieldOptions *msg, int32_t value) { +} +UPB_INLINE void google_protobuf_FieldOptions_set_jstype(google_protobuf_FieldOptions *msg, int32_t value) { const upb_MiniTableField field = {6, 12, 5, 1, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FieldOptions_set_weak(google_protobuf_FieldOptions *msg, bool value) { +} +UPB_INLINE void google_protobuf_FieldOptions_set_weak(google_protobuf_FieldOptions *msg, bool value) { const upb_MiniTableField field = {10, 16, 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FieldOptions_set_unverified_lazy(google_protobuf_FieldOptions *msg, bool value) { +} +UPB_INLINE void google_protobuf_FieldOptions_set_unverified_lazy(google_protobuf_FieldOptions *msg, bool value) { const upb_MiniTableField field = {15, 17, 7, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FieldOptions_mutable_uninterpreted_option(google_protobuf_FieldOptions* msg, size_t* size) { +} +UPB_INLINE void google_protobuf_FieldOptions_set_debug_redact(google_protobuf_FieldOptions *msg, bool value) { + const upb_MiniTableField field = {16, 18, 8, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FieldOptions_mutable_uninterpreted_option(google_protobuf_FieldOptions* msg, size_t* size) { upb_MiniTableField field = {999, UPB_SIZE(20, 24), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { @@ -6545,6 +6673,21 @@ UPB_INLINE bool google_protobuf_EnumOptions_has_deprecated(const google_protobuf const upb_MiniTableField field = {3, 2, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; return _upb_Message_HasNonExtensionField(msg, &field); } +UPB_INLINE void google_protobuf_EnumOptions_clear_deprecated_legacy_json_field_conflicts(google_protobuf_EnumOptions* msg) { + const upb_MiniTableField field = {6, 3, 3, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE bool google_protobuf_EnumOptions_deprecated_legacy_json_field_conflicts(const google_protobuf_EnumOptions* msg) { + bool default_val = false; + bool ret; + const upb_MiniTableField field = {6, 3, 3, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_EnumOptions_has_deprecated_legacy_json_field_conflicts(const google_protobuf_EnumOptions* msg) { + const upb_MiniTableField field = {6, 3, 3, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} UPB_INLINE void google_protobuf_EnumOptions_clear_uninterpreted_option(google_protobuf_EnumOptions* msg) { const upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; _upb_Message_ClearNonExtensionField(msg, &field); @@ -6569,10 +6712,16 @@ UPB_INLINE bool google_protobuf_EnumOptions_has_uninterpreted_option(const googl UPB_INLINE void google_protobuf_EnumOptions_set_allow_alias(google_protobuf_EnumOptions *msg, bool value) { const upb_MiniTableField field = {2, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_EnumOptions_set_deprecated(google_protobuf_EnumOptions *msg, bool value) { +} +UPB_INLINE void google_protobuf_EnumOptions_set_deprecated(google_protobuf_EnumOptions *msg, bool value) { const upb_MiniTableField field = {3, 2, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumOptions_mutable_uninterpreted_option(google_protobuf_EnumOptions* msg, size_t* size) { +} +UPB_INLINE void google_protobuf_EnumOptions_set_deprecated_legacy_json_field_conflicts(google_protobuf_EnumOptions *msg, bool value) { + const upb_MiniTableField field = {6, 3, 3, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumOptions_mutable_uninterpreted_option(google_protobuf_EnumOptions* msg, size_t* size) { upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { @@ -6673,7 +6822,8 @@ UPB_INLINE bool google_protobuf_EnumValueOptions_has_uninterpreted_option(const UPB_INLINE void google_protobuf_EnumValueOptions_set_deprecated(google_protobuf_EnumValueOptions *msg, bool value) { const upb_MiniTableField field = {1, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumValueOptions_mutable_uninterpreted_option(google_protobuf_EnumValueOptions* msg, size_t* size) { +} +UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumValueOptions_mutable_uninterpreted_option(google_protobuf_EnumValueOptions* msg, size_t* size) { upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { @@ -6774,7 +6924,8 @@ UPB_INLINE bool google_protobuf_ServiceOptions_has_uninterpreted_option(const go UPB_INLINE void google_protobuf_ServiceOptions_set_deprecated(google_protobuf_ServiceOptions *msg, bool value) { const upb_MiniTableField field = {33, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ServiceOptions_mutable_uninterpreted_option(google_protobuf_ServiceOptions* msg, size_t* size) { +} +UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ServiceOptions_mutable_uninterpreted_option(google_protobuf_ServiceOptions* msg, size_t* size) { upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { @@ -6890,10 +7041,12 @@ UPB_INLINE bool google_protobuf_MethodOptions_has_uninterpreted_option(const goo UPB_INLINE void google_protobuf_MethodOptions_set_deprecated(google_protobuf_MethodOptions *msg, bool value) { const upb_MiniTableField field = {33, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_MethodOptions_set_idempotency_level(google_protobuf_MethodOptions *msg, int32_t value) { +} +UPB_INLINE void google_protobuf_MethodOptions_set_idempotency_level(google_protobuf_MethodOptions *msg, int32_t value) { const upb_MiniTableField field = {34, 4, 2, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MethodOptions_mutable_uninterpreted_option(google_protobuf_MethodOptions* msg, size_t* size) { +} +UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MethodOptions_mutable_uninterpreted_option(google_protobuf_MethodOptions* msg, size_t* size) { upb_MiniTableField field = {999, 8, 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { @@ -7095,22 +7248,28 @@ UPB_INLINE struct google_protobuf_UninterpretedOption_NamePart* google_protobuf_ UPB_INLINE void google_protobuf_UninterpretedOption_set_identifier_value(google_protobuf_UninterpretedOption *msg, upb_StringView value) { const upb_MiniTableField field = {3, UPB_SIZE(8, 16), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_UninterpretedOption_set_positive_int_value(google_protobuf_UninterpretedOption *msg, uint64_t value) { +} +UPB_INLINE void google_protobuf_UninterpretedOption_set_positive_int_value(google_protobuf_UninterpretedOption *msg, uint64_t value) { const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 2, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_UninterpretedOption_set_negative_int_value(google_protobuf_UninterpretedOption *msg, int64_t value) { +} +UPB_INLINE void google_protobuf_UninterpretedOption_set_negative_int_value(google_protobuf_UninterpretedOption *msg, int64_t value) { const upb_MiniTableField field = {5, UPB_SIZE(24, 40), 3, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_UninterpretedOption_set_double_value(google_protobuf_UninterpretedOption *msg, double value) { +} +UPB_INLINE void google_protobuf_UninterpretedOption_set_double_value(google_protobuf_UninterpretedOption *msg, double value) { const upb_MiniTableField field = {6, UPB_SIZE(32, 48), 4, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_UninterpretedOption_set_string_value(google_protobuf_UninterpretedOption *msg, upb_StringView value) { +} +UPB_INLINE void google_protobuf_UninterpretedOption_set_string_value(google_protobuf_UninterpretedOption *msg, upb_StringView value) { const upb_MiniTableField field = {7, UPB_SIZE(40, 56), 5, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_UninterpretedOption_set_aggregate_value(google_protobuf_UninterpretedOption *msg, upb_StringView value) { +} +UPB_INLINE void google_protobuf_UninterpretedOption_set_aggregate_value(google_protobuf_UninterpretedOption *msg, upb_StringView value) { const upb_MiniTableField field = {8, UPB_SIZE(48, 72), 6, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); } + /* google.protobuf.UninterpretedOption.NamePart */ UPB_INLINE google_protobuf_UninterpretedOption_NamePart* google_protobuf_UninterpretedOption_NamePart_new(upb_Arena* arena) { @@ -7180,10 +7339,12 @@ UPB_INLINE bool google_protobuf_UninterpretedOption_NamePart_has_is_extension(co UPB_INLINE void google_protobuf_UninterpretedOption_NamePart_set_name_part(google_protobuf_UninterpretedOption_NamePart *msg, upb_StringView value) { const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_UninterpretedOption_NamePart_set_is_extension(google_protobuf_UninterpretedOption_NamePart *msg, bool value) { +} +UPB_INLINE void google_protobuf_UninterpretedOption_NamePart_set_is_extension(google_protobuf_UninterpretedOption_NamePart *msg, bool value) { const upb_MiniTableField field = {2, 1, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); } + /* google.protobuf.SourceCodeInfo */ UPB_INLINE google_protobuf_SourceCodeInfo* google_protobuf_SourceCodeInfo_new(upb_Arena* arena) { @@ -7444,10 +7605,12 @@ UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_add_span(google_protobuf UPB_INLINE void google_protobuf_SourceCodeInfo_Location_set_leading_comments(google_protobuf_SourceCodeInfo_Location *msg, upb_StringView value) { const upb_MiniTableField field = {3, UPB_SIZE(16, 24), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_SourceCodeInfo_Location_set_trailing_comments(google_protobuf_SourceCodeInfo_Location *msg, upb_StringView value) { +} +UPB_INLINE void google_protobuf_SourceCodeInfo_Location_set_trailing_comments(google_protobuf_SourceCodeInfo_Location *msg, upb_StringView value) { const upb_MiniTableField field = {4, UPB_SIZE(24, 40), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE upb_StringView* google_protobuf_SourceCodeInfo_Location_mutable_leading_detached_comments(google_protobuf_SourceCodeInfo_Location* msg, size_t* size) { +} +UPB_INLINE upb_StringView* google_protobuf_SourceCodeInfo_Location_mutable_leading_detached_comments(google_protobuf_SourceCodeInfo_Location* msg, size_t* size) { upb_MiniTableField field = {6, UPB_SIZE(12, 56), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { @@ -7698,16 +7861,20 @@ UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_add_path(google_pro UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_source_file(google_protobuf_GeneratedCodeInfo_Annotation *msg, upb_StringView value) { const upb_MiniTableField field = {2, UPB_SIZE(20, 24), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_begin(google_protobuf_GeneratedCodeInfo_Annotation *msg, int32_t value) { +} +UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_begin(google_protobuf_GeneratedCodeInfo_Annotation *msg, int32_t value) { const upb_MiniTableField field = {3, UPB_SIZE(8, 4), 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_end(google_protobuf_GeneratedCodeInfo_Annotation *msg, int32_t value) { +} +UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_end(google_protobuf_GeneratedCodeInfo_Annotation *msg, int32_t value) { const upb_MiniTableField field = {4, UPB_SIZE(12, 8), 3, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_semantic(google_protobuf_GeneratedCodeInfo_Annotation *msg, int32_t value) { +} +UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_semantic(google_protobuf_GeneratedCodeInfo_Annotation *msg, int32_t value) { const upb_MiniTableField field = {5, UPB_SIZE(16, 12), 4, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); } + extern const upb_MiniTableFile google_protobuf_descriptor_proto_upb_file_layout; /* Max size 32 is google.protobuf.FileOptions */ @@ -7738,6 +7905,16 @@ extern const upb_MiniTableFile google_protobuf_descriptor_proto_upb_file_layout; #ifndef UPB_REFLECTION_COMMON_H_ #define UPB_REFLECTION_COMMON_H_ +// begin:google_only +// #ifndef UPB_BOOTSTRAP_STAGE0 +// #include "net/proto2/proto/descriptor.upb.h" +// #else +// #include "google/protobuf/descriptor.upb.h" +// #endif +// end:google_only + +// begin:github_only +// end:github_only typedef enum { kUpb_Syntax_Proto2 = 2, kUpb_Syntax_Proto3 = 3 } upb_Syntax; @@ -7864,9 +8041,10 @@ const upb_ServiceDef* upb_DefPool_FindServiceByNameWithSize( const upb_FileDef* upb_DefPool_FindFileContainingSymbol(const upb_DefPool* s, const char* name); -const upb_FileDef* upb_DefPool_AddFile( - upb_DefPool* s, const google_protobuf_FileDescriptorProto* file_proto, - upb_Status* status); +const upb_FileDef* upb_DefPool_AddFile(upb_DefPool* s, + const UPB_DESC(FileDescriptorProto) * + file_proto, + upb_Status* status); const upb_ExtensionRegistry* upb_DefPool_ExtensionRegistry( const upb_DefPool* s); @@ -7913,7 +8091,7 @@ bool upb_EnumDef_MiniDescriptorEncode(const upb_EnumDef* e, upb_Arena* a, upb_StringView* out); const char* upb_EnumDef_Name(const upb_EnumDef* e); -const google_protobuf_EnumOptions* upb_EnumDef_Options(const upb_EnumDef* e); +const UPB_DESC(EnumOptions) * upb_EnumDef_Options(const upb_EnumDef* e); upb_StringView upb_EnumDef_ReservedName(const upb_EnumDef* e, int i); int upb_EnumDef_ReservedNameCount(const upb_EnumDef* e); @@ -7950,8 +8128,8 @@ bool upb_EnumValueDef_HasOptions(const upb_EnumValueDef* v); uint32_t upb_EnumValueDef_Index(const upb_EnumValueDef* v); const char* upb_EnumValueDef_Name(const upb_EnumValueDef* v); int32_t upb_EnumValueDef_Number(const upb_EnumValueDef* v); -const google_protobuf_EnumValueOptions* upb_EnumValueDef_Options( - const upb_EnumValueDef* v); +const UPB_DESC(EnumValueOptions) * + upb_EnumValueDef_Options(const upb_EnumValueDef* v); #ifdef __cplusplus } /* extern "C" */ @@ -7976,8 +8154,8 @@ int32_t upb_ExtensionRange_Start(const upb_ExtensionRange* r); int32_t upb_ExtensionRange_End(const upb_ExtensionRange* r); bool upb_ExtensionRange_HasOptions(const upb_ExtensionRange* r); -const google_protobuf_ExtensionRangeOptions* upb_ExtensionRange_Options( - const upb_ExtensionRange* r); +const UPB_DESC(ExtensionRangeOptions) * + upb_ExtensionRange_Options(const upb_ExtensionRange* r); #ifdef __cplusplus } /* extern "C" */ @@ -8036,7 +8214,7 @@ bool upb_FieldDef_MiniDescriptorEncode(const upb_FieldDef* f, upb_Arena* a, const upb_MiniTableField* upb_FieldDef_MiniTable(const upb_FieldDef* f); const char* upb_FieldDef_Name(const upb_FieldDef* f); uint32_t upb_FieldDef_Number(const upb_FieldDef* f); -const google_protobuf_FieldOptions* upb_FieldDef_Options(const upb_FieldDef* f); +const UPB_DESC(FieldOptions) * upb_FieldDef_Options(const upb_FieldDef* f); const upb_OneofDef* upb_FieldDef_RealContainingOneof(const upb_FieldDef* f); upb_FieldType upb_FieldDef_Type(const upb_FieldDef* f); @@ -8063,7 +8241,7 @@ const upb_FileDef* upb_FileDef_Dependency(const upb_FileDef* f, int i); int upb_FileDef_DependencyCount(const upb_FileDef* f); bool upb_FileDef_HasOptions(const upb_FileDef* f); const char* upb_FileDef_Name(const upb_FileDef* f); -const google_protobuf_FileOptions* upb_FileDef_Options(const upb_FileDef* f); +const UPB_DESC(FileOptions) * upb_FileDef_Options(const upb_FileDef* f); const char* upb_FileDef_Package(const upb_FileDef* f); const upb_DefPool* upb_FileDef_Pool(const upb_FileDef* f); @@ -8216,8 +8394,10 @@ int upb_MessageDef_NestedMessageCount(const upb_MessageDef* m); const upb_OneofDef* upb_MessageDef_Oneof(const upb_MessageDef* m, int i); int upb_MessageDef_OneofCount(const upb_MessageDef* m); +int upb_MessageDef_RealOneofCount(const upb_MessageDef* m); -const google_protobuf_MessageOptions* upb_MessageDef_Options(const upb_MessageDef* m); +const UPB_DESC(MessageOptions) * + upb_MessageDef_Options(const upb_MessageDef* m); upb_StringView upb_MessageDef_ReservedName(const upb_MessageDef* m, int i); int upb_MessageDef_ReservedNameCount(const upb_MessageDef* m); @@ -8254,7 +8434,7 @@ bool upb_MethodDef_HasOptions(const upb_MethodDef* m); int upb_MethodDef_Index(const upb_MethodDef* m); const upb_MessageDef* upb_MethodDef_InputType(const upb_MethodDef* m); const char* upb_MethodDef_Name(const upb_MethodDef* m); -const google_protobuf_MethodOptions* upb_MethodDef_Options(const upb_MethodDef* m); +const UPB_DESC(MethodOptions) * upb_MethodDef_Options(const upb_MethodDef* m); const upb_MessageDef* upb_MethodDef_OutputType(const upb_MethodDef* m); bool upb_MethodDef_ServerStreaming(const upb_MethodDef* m); const upb_ServiceDef* upb_MethodDef_Service(const upb_MethodDef* m); @@ -8294,7 +8474,7 @@ const upb_FieldDef* upb_OneofDef_LookupNumber(const upb_OneofDef* o, uint32_t num); const char* upb_OneofDef_Name(const upb_OneofDef* o); int upb_OneofDef_numfields(const upb_OneofDef* o); -const google_protobuf_OneofOptions* upb_OneofDef_Options(const upb_OneofDef* o); +const UPB_DESC(OneofOptions) * upb_OneofDef_Options(const upb_OneofDef* o); #ifdef __cplusplus } /* extern "C" */ @@ -8324,7 +8504,8 @@ int upb_ServiceDef_Index(const upb_ServiceDef* s); const upb_MethodDef* upb_ServiceDef_Method(const upb_ServiceDef* s, int i); int upb_ServiceDef_MethodCount(const upb_ServiceDef* s); const char* upb_ServiceDef_Name(const upb_ServiceDef* s); -const google_protobuf_ServiceOptions* upb_ServiceDef_Options(const upb_ServiceDef* s); +const UPB_DESC(ServiceOptions) * + upb_ServiceDef_Options(const upb_ServiceDef* s); #ifdef __cplusplus } /* extern "C" */ @@ -8350,6 +8531,90 @@ const google_protobuf_ServiceOptions* upb_ServiceDef_Options(const upb_ServiceDe #define UPB_REFLECTION_DEF_POOL_INTERNAL_H_ +#ifndef UPB_MINI_TABLE_DECODE_H_ +#define UPB_MINI_TABLE_DECODE_H_ + + +// Must be last. + +typedef enum { + kUpb_MiniTablePlatform_32Bit, + kUpb_MiniTablePlatform_64Bit, + kUpb_MiniTablePlatform_Native = + UPB_SIZE(kUpb_MiniTablePlatform_32Bit, kUpb_MiniTablePlatform_64Bit), +} upb_MiniTablePlatform; + +#ifdef __cplusplus +extern "C" { +#endif + +// Builds a mini table from the data encoded in the buffer [data, len]. If any +// errors occur, returns NULL and sets a status message. In the success case, +// the caller must call upb_MiniTable_SetSub*() for all message or proto2 enum +// fields to link the table to the appropriate sub-tables. +upb_MiniTable* _upb_MiniTable_Build(const char* data, size_t len, + upb_MiniTablePlatform platform, + upb_Arena* arena, upb_Status* status); + +UPB_API_INLINE upb_MiniTable* upb_MiniTable_Build(const char* data, size_t len, + upb_Arena* arena, + upb_Status* status) { + return _upb_MiniTable_Build(data, len, kUpb_MiniTablePlatform_Native, arena, + status); +} + +// Links a sub-message field to a MiniTable for that sub-message. If a +// sub-message field is not linked, it will be treated as an unknown field +// during parsing, and setting the field will not be allowed. It is possible +// to link the message field later, at which point it will no longer be treated +// as unknown. However there is no synchronization for this operation, which +// means parallel mutation requires external synchronization. +UPB_API void upb_MiniTable_SetSubMessage(upb_MiniTable* table, + upb_MiniTableField* field, + const upb_MiniTable* sub); + +// Links an enum field to a MiniTable for that enum. All enum fields must +// be linked prior to parsing. +UPB_API void upb_MiniTable_SetSubEnum(upb_MiniTable* table, + upb_MiniTableField* field, + const upb_MiniTableEnum* sub); + +const char* _upb_MiniTableExtension_Build(const char* data, size_t len, + upb_MiniTableExtension* ext, + const upb_MiniTable* extendee, + upb_MiniTableSub sub, + upb_MiniTablePlatform platform, + upb_Status* status); + +UPB_API_INLINE const char* upb_MiniTableExtension_Build( + const char* data, size_t len, upb_MiniTableExtension* ext, + const upb_MiniTable* extendee, upb_MiniTableSub sub, upb_Status* status) { + return _upb_MiniTableExtension_Build(data, len, ext, extendee, sub, + kUpb_MiniTablePlatform_Native, status); +} + +UPB_API upb_MiniTableEnum* upb_MiniTableEnum_Build(const char* data, size_t len, + upb_Arena* arena, + upb_Status* status); + +// Like upb_MiniTable_Build(), but the user provides a buffer of layout data so +// it can be reused from call to call, avoiding repeated realloc()/free(). +// +// The caller owns `*buf` both before and after the call, and must free() it +// when it is no longer in use. The function will realloc() `*buf` as +// necessary, updating `*size` accordingly. +upb_MiniTable* upb_MiniTable_BuildWithBuf(const char* data, size_t len, + upb_MiniTablePlatform platform, + upb_Arena* arena, void** buf, + size_t* buf_size, upb_Status* status); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + +#endif /* UPB_MINI_TABLE_DECODE_H_ */ + // Must be last. #ifdef __cplusplus @@ -8369,6 +8634,7 @@ bool _upb_DefPool_LookupSym(const upb_DefPool* s, const char* sym, size_t size, void** _upb_DefPool_ScratchData(const upb_DefPool* s); size_t* _upb_DefPool_ScratchSize(const upb_DefPool* s); +void _upb_DefPool_SetPlatform(upb_DefPool* s, upb_MiniTablePlatform platform); // For generated code only: loads a generated descriptor. typedef struct _upb_DefPool_Init { @@ -8595,7 +8861,6 @@ typedef const char* upb_EpsCopyInputStream_IsDoneFallbackFunc( UPB_INLINE void upb_EpsCopyInputStream_Init(upb_EpsCopyInputStream* e, const char** ptr, size_t size, bool enable_aliasing) { - bool ret; if (size <= kUpb_EpsCopyInputStream_SlopBytes) { memset(&e->patch, 0, 32); if (size) memcpy(&e->patch, *ptr, size); @@ -8604,13 +8869,11 @@ UPB_INLINE void upb_EpsCopyInputStream_Init(upb_EpsCopyInputStream* e, *ptr = e->patch; e->end = *ptr + size; e->limit = 0; - ret = true; } else { e->end = *ptr + size - kUpb_EpsCopyInputStream_SlopBytes; e->limit = kUpb_EpsCopyInputStream_SlopBytes; e->aliasing = enable_aliasing ? kUpb_EpsCopyInputStream_NoDelta : kUpb_EpsCopyInputStream_NoAliasing; - ret = false; } e->limit_ptr = e->end; e->error = false; @@ -8662,6 +8925,7 @@ UPB_INLINE bool upb_EpsCopyInputStream_IsDoneWithCallback( *ptr = func(e, *ptr, overrun); return *ptr == NULL; } + UPB_UNREACHABLE(); } const char* _upb_EpsCopyInputStream_IsDoneFallbackNoCallback( @@ -8797,14 +9061,24 @@ UPB_INLINE const char* upb_EpsCopyInputStream_ReadStringAliased( return ret; } -// Skips `size` bytes of string data from the input and returns a pointer past -// the end. Returns NULL on end of stream or error. +// Skips `size` bytes of data from the input and returns a pointer past the end. +// Returns NULL on end of stream or error. UPB_INLINE const char* upb_EpsCopyInputStream_Skip(upb_EpsCopyInputStream* e, const char* ptr, int size) { if (!upb_EpsCopyInputStream_CheckDataSizeAvailable(e, ptr, size)) return NULL; return ptr + size; } +// Copies `size` bytes of data from the input `ptr` into the buffer `to`, and +// returns a pointer past the end. Returns NULL on end of stream or error. +UPB_INLINE const char* upb_EpsCopyInputStream_Copy(upb_EpsCopyInputStream* e, + const char* ptr, void* to, + int size) { + if (!upb_EpsCopyInputStream_CheckDataSizeAvailable(e, ptr, size)) return NULL; + memcpy(to, ptr, size); + return ptr + size; +} + // Reads string data from the stream and advances the pointer accordingly. // If aliasing was enabled when the stream was initialized, then the returned // pointer will point into the input buffer if possible, otherwise new data @@ -8825,10 +9099,8 @@ UPB_INLINE const char* upb_EpsCopyInputStream_ReadString( UPB_ASSERT(arena); char* data = (char*)upb_Arena_Malloc(arena, size); if (!data) return NULL; - memcpy(data, *ptr, size); - const char* ret = *ptr + size; + const char* ret = upb_EpsCopyInputStream_Copy(e, *ptr, data, size); *ptr = data; - UPB_ASSUME(ret != NULL); return ret; } } @@ -9499,26 +9771,25 @@ UPB_INLINE const char* upb_WireReader_ReadFixed64(const char* ptr, void* val) { return ptr + 8; } +const char* _upb_WireReader_SkipGroup(const char* ptr, uint32_t tag, + int depth_limit, + upb_EpsCopyInputStream* stream); + // Skips data for a group, returning a pointer past the end of the group, or // NULL if there was an error parsing the group. The `tag` argument should be // the start group tag that begins the group. The `depth_limit` argument // indicates how many levels of recursion the group is allowed to have before // reporting a parse error (this limit exists to protect against stack // overflow). -const char* upb_WireReader_SkipGroup(const char* ptr, uint32_t tag, - int depth_limit, - upb_EpsCopyInputStream* stream); - -// Skips data for a wire value of any type, returning a pointer past the end of -// the data, or NULL if there was an error parsing the group. The `tag` argument -// should be the tag that was just parsed. The `depth_limit` argument indicates -// how many levels of recursion a group is allowed to have before reporting a -// parse error (this limit exists to protect against stack overflow). // -// REQUIRES: there must be at least 10 bytes of data available at `ptr`. -// Bounds checks must be performed before calling this function, preferably -// by calling upb_EpsCopyInputStream_IsDone(). -UPB_INLINE const char* upb_WireReader_SkipValue( +// TODO: evaluate how the depth_limit should be specified. Do users need +// control over this? +UPB_INLINE const char* upb_WireReader_SkipGroup( + const char* ptr, uint32_t tag, upb_EpsCopyInputStream* stream) { + return _upb_WireReader_SkipGroup(ptr, tag, 100, stream); +} + +UPB_INLINE const char* _upb_WireReader_SkipValue( const char* ptr, uint32_t tag, int depth_limit, upb_EpsCopyInputStream* stream) { switch (upb_WireReader_GetWireType(tag)) { @@ -9536,7 +9807,7 @@ UPB_INLINE const char* upb_WireReader_SkipValue( return ptr; } case kUpb_WireType_StartGroup: - return upb_WireReader_SkipGroup(ptr, tag, depth_limit, stream); + return _upb_WireReader_SkipGroup(ptr, tag, depth_limit, stream); case kUpb_WireType_EndGroup: return NULL; // Should be handled before now. default: @@ -9544,6 +9815,23 @@ UPB_INLINE const char* upb_WireReader_SkipValue( } } +// Skips data for a wire value of any type, returning a pointer past the end of +// the data, or NULL if there was an error parsing the group. The `tag` argument +// should be the tag that was just parsed. The `depth_limit` argument indicates +// how many levels of recursion a group is allowed to have before reporting a +// parse error (this limit exists to protect against stack overflow). +// +// REQUIRES: there must be at least 10 bytes of data available at `ptr`. +// Bounds checks must be performed before calling this function, preferably +// by calling upb_EpsCopyInputStream_IsDone(). +// +// TODO: evaluate how the depth_limit should be specified. Do users need +// control over this? +UPB_INLINE const char* upb_WireReader_SkipValue( + const char* ptr, uint32_t tag, upb_EpsCopyInputStream* stream) { + return _upb_WireReader_SkipValue(ptr, tag, 100, stream); +} + #ifdef __cplusplus } /* extern "C" */ #endif @@ -9644,90 +9932,6 @@ UPB_INLINE bool _upb_FieldType_IsPackable(upb_FieldType type) { #endif /* UPB_MINI_TABLE_COMMON_INTERNAL_H_ */ -#ifndef UPB_MINI_TABLE_DECODE_H_ -#define UPB_MINI_TABLE_DECODE_H_ - - -// Must be last. - -typedef enum { - kUpb_MiniTablePlatform_32Bit, - kUpb_MiniTablePlatform_64Bit, - kUpb_MiniTablePlatform_Native = - UPB_SIZE(kUpb_MiniTablePlatform_32Bit, kUpb_MiniTablePlatform_64Bit), -} upb_MiniTablePlatform; - -#ifdef __cplusplus -extern "C" { -#endif - -// Builds a mini table from the data encoded in the buffer [data, len]. If any -// errors occur, returns NULL and sets a status message. In the success case, -// the caller must call upb_MiniTable_SetSub*() for all message or proto2 enum -// fields to link the table to the appropriate sub-tables. -upb_MiniTable* _upb_MiniTable_Build(const char* data, size_t len, - upb_MiniTablePlatform platform, - upb_Arena* arena, upb_Status* status); - -UPB_API_INLINE upb_MiniTable* upb_MiniTable_Build(const char* data, size_t len, - upb_Arena* arena, - upb_Status* status) { - return _upb_MiniTable_Build(data, len, kUpb_MiniTablePlatform_Native, arena, - status); -} - -// Links a sub-message field to a MiniTable for that sub-message. If a -// sub-message field is not linked, it will be treated as an unknown field -// during parsing, and setting the field will not be allowed. It is possible -// to link the message field later, at which point it will no longer be treated -// as unknown. However there is no synchronization for this operation, which -// means parallel mutation requires external synchronization. -UPB_API void upb_MiniTable_SetSubMessage(upb_MiniTable* table, - upb_MiniTableField* field, - const upb_MiniTable* sub); - -// Links an enum field to a MiniTable for that enum. All enum fields must -// be linked prior to parsing. -UPB_API void upb_MiniTable_SetSubEnum(upb_MiniTable* table, - upb_MiniTableField* field, - const upb_MiniTableEnum* sub); - -const char* _upb_MiniTableExtension_Build(const char* data, size_t len, - upb_MiniTableExtension* ext, - const upb_MiniTable* extendee, - upb_MiniTableSub sub, - upb_MiniTablePlatform platform, - upb_Status* status); - -UPB_API_INLINE const char* upb_MiniTableExtension_Build( - const char* data, size_t len, upb_MiniTableExtension* ext, - const upb_MiniTable* extendee, upb_MiniTableSub sub, upb_Status* status) { - return _upb_MiniTableExtension_Build(data, len, ext, extendee, sub, - kUpb_MiniTablePlatform_Native, status); -} - -UPB_API upb_MiniTableEnum* upb_MiniTableEnum_Build(const char* data, size_t len, - upb_Arena* arena, - upb_Status* status); - -// Like upb_MiniTable_Build(), but the user provides a buffer of layout data so -// it can be reused from call to call, avoiding repeated realloc()/free(). -// -// The caller owns `*buf` both before and after the call, and must free() it -// when it is no longer in use. The function will realloc() `*buf` as -// necessary, updating `*size` accordingly. -upb_MiniTable* upb_MiniTable_BuildWithBuf(const char* data, size_t len, - upb_MiniTablePlatform platform, - upb_Arena* arena, void** buf, - size_t* buf_size, upb_Status* status); - -#ifdef __cplusplus -} /* extern "C" */ -#endif - - -#endif /* UPB_MINI_TABLE_DECODE_H_ */ - #ifndef UPB_MINI_TABLE_ENCODE_INTERNAL_H_ #define UPB_MINI_TABLE_ENCODE_INTERNAL_H_ @@ -9817,17 +10021,17 @@ char* upb_MtDataEncoder_EncodeMessageSet(upb_MtDataEncoder* e, char* ptr); // We want to copy the options verbatim into the destination options proto. // We use serialize+parse as our deep copy. -#define UPB_DEF_SET_OPTIONS(target, desc_type, options_type, proto) \ - if (google_protobuf_##desc_type##_has_options(proto)) { \ - size_t size; \ - char* pb = google_protobuf_##options_type##_serialize( \ - google_protobuf_##desc_type##_options(proto), ctx->tmp_arena, &size); \ - if (!pb) _upb_DefBuilder_OomErr(ctx); \ - target = \ - google_protobuf_##options_type##_parse(pb, size, _upb_DefBuilder_Arena(ctx)); \ - if (!target) _upb_DefBuilder_OomErr(ctx); \ - } else { \ - target = (const google_protobuf_##options_type*)kUpbDefOptDefault; \ +#define UPB_DEF_SET_OPTIONS(target, desc_type, options_type, proto) \ + if (UPB_DESC(desc_type##_has_options)(proto)) { \ + size_t size; \ + char* pb = UPB_DESC(options_type##_serialize)( \ + UPB_DESC(desc_type##_options)(proto), ctx->tmp_arena, &size); \ + if (!pb) _upb_DefBuilder_OomErr(ctx); \ + target = \ + UPB_DESC(options_type##_parse)(pb, size, _upb_DefBuilder_Arena(ctx)); \ + if (!target) _upb_DefBuilder_OomErr(ctx); \ + } else { \ + target = (const UPB_DESC(options_type)*)kUpbDefOptDefault; \ } #ifdef __cplusplus @@ -9841,6 +10045,7 @@ struct upb_DefBuilder { upb_Arena* tmp_arena; // For temporary allocations. upb_Status* status; // Record errors here. const upb_MiniTableFile* layout; // NULL if we should build layouts. + upb_MiniTablePlatform platform; // Platform we are targeting. int enum_count; // Count of enums built so far. int msg_count; // Count of messages built so far. int ext_count; // Count of extensions built so far. @@ -9966,9 +10171,10 @@ bool _upb_EnumDef_Insert(upb_EnumDef* e, upb_EnumValueDef* v, upb_Arena* a); const upb_MiniTableEnum* _upb_EnumDef_MiniTable(const upb_EnumDef* e); // Allocate and initialize an array of |n| enum defs. -upb_EnumDef* _upb_EnumDefs_New(upb_DefBuilder* ctx, int n, - const google_protobuf_EnumDescriptorProto* const* protos, - const upb_MessageDef* containing_type); +upb_EnumDef* _upb_EnumDefs_New( + upb_DefBuilder* ctx, int n, + const UPB_DESC(EnumDescriptorProto) * const* protos, + const upb_MessageDef* containing_type); #ifdef __cplusplus } /* extern "C" */ @@ -9992,7 +10198,7 @@ upb_EnumValueDef* _upb_EnumValueDef_At(const upb_EnumValueDef* v, int i); // Allocate and initialize an array of |n| enum value defs owned by |e|. upb_EnumValueDef* _upb_EnumValueDefs_New( upb_DefBuilder* ctx, const char* prefix, int n, - const google_protobuf_EnumValueDescriptorProto* const* protos, upb_EnumDef* e, + const UPB_DESC(EnumValueDescriptorProto) * const* protos, upb_EnumDef* e, bool* is_sorted); const upb_EnumValueDef** _upb_EnumValueDefs_Sorted(const upb_EnumValueDef* v, @@ -10029,7 +10235,7 @@ void _upb_FieldDef_Resolve(upb_DefBuilder* ctx, const char* prefix, // Allocate and initialize an array of |n| field defs. upb_FieldDef* _upb_FieldDefs_New( upb_DefBuilder* ctx, int n, - const google_protobuf_FieldDescriptorProto* const* protos, const char* prefix, + const UPB_DESC(FieldDescriptorProto) * const* protos, const char* prefix, upb_MessageDef* m, bool* is_sorted); // Allocate and return a list of pointers to the |n| field defs in |ff|, @@ -10063,7 +10269,7 @@ const int32_t* _upb_FileDef_WeakDependencyIndexes(const upb_FileDef* f); const char* _upb_FileDef_RawPackage(const upb_FileDef* f); void _upb_FileDef_Create(upb_DefBuilder* ctx, - const google_protobuf_FileDescriptorProto* file_proto); + const UPB_DESC(FileDescriptorProto) * file_proto); #ifdef __cplusplus } /* extern "C" */ @@ -10095,7 +10301,7 @@ void _upb_MessageDef_Resolve(upb_DefBuilder* ctx, upb_MessageDef* m); // Allocate and initialize an array of |n| message defs. upb_MessageDef* _upb_MessageDefs_New( - upb_DefBuilder* ctx, int n, const google_protobuf_DescriptorProto* const* protos, + upb_DefBuilder* ctx, int n, const UPB_DESC(DescriptorProto) * const* protos, const upb_MessageDef* containing_type); #ifdef __cplusplus @@ -10120,7 +10326,7 @@ upb_ServiceDef* _upb_ServiceDef_At(const upb_ServiceDef* s, int i); // Allocate and initialize an array of |n| service defs. upb_ServiceDef* _upb_ServiceDefs_New( upb_DefBuilder* ctx, int n, - const google_protobuf_ServiceDescriptorProto* const* protos); + const UPB_DESC(ServiceDescriptorProto) * const* protos); #ifdef __cplusplus } /* extern "C" */ @@ -10201,7 +10407,7 @@ upb_EnumReservedRange* _upb_EnumReservedRange_At(const upb_EnumReservedRange* r, // Allocate and initialize an array of |n| reserved ranges owned by |e|. upb_EnumReservedRange* _upb_EnumReservedRanges_New( upb_DefBuilder* ctx, int n, - const google_protobuf_EnumDescriptorProto_EnumReservedRange* const* protos, + const UPB_DESC(EnumDescriptorProto_EnumReservedRange) * const* protos, const upb_EnumDef* e); #ifdef __cplusplus @@ -10226,7 +10432,7 @@ upb_ExtensionRange* _upb_ExtensionRange_At(const upb_ExtensionRange* r, int i); // Allocate and initialize an array of |n| extension ranges owned by |m|. upb_ExtensionRange* _upb_ExtensionRanges_New( upb_DefBuilder* ctx, int n, - const google_protobuf_DescriptorProto_ExtensionRange* const* protos, + const UPB_DESC(DescriptorProto_ExtensionRange) * const* protos, const upb_MessageDef* m); #ifdef __cplusplus @@ -10253,7 +10459,7 @@ bool _upb_OneofDef_Insert(upb_OneofDef* o, const upb_FieldDef* f, // Allocate and initialize an array of |n| oneof defs owned by |m|. upb_OneofDef* _upb_OneofDefs_New( upb_DefBuilder* ctx, int n, - const google_protobuf_OneofDescriptorProto* const* protos, upb_MessageDef* m); + const UPB_DESC(OneofDescriptorProto) * const* protos, upb_MessageDef* m); size_t _upb_OneofDefs_Finalize(upb_DefBuilder* ctx, upb_MessageDef* m); @@ -10302,7 +10508,7 @@ upb_MessageReservedRange* _upb_MessageReservedRange_At( // Allocate and initialize an array of |n| reserved ranges owned by |m|. upb_MessageReservedRange* _upb_MessageReservedRanges_New( upb_DefBuilder* ctx, int n, - const google_protobuf_DescriptorProto_ReservedRange* const* protos, + const UPB_DESC(DescriptorProto_ReservedRange) * const* protos, const upb_MessageDef* m); #ifdef __cplusplus @@ -10327,7 +10533,7 @@ upb_MethodDef* _upb_MethodDef_At(const upb_MethodDef* m, int i); // Allocate and initialize an array of |n| method defs owned by |s|. upb_MethodDef* _upb_MethodDefs_New( upb_DefBuilder* ctx, int n, - const google_protobuf_MethodDescriptorProto* const* protos, upb_ServiceDef* s); + const UPB_DESC(MethodDescriptorProto) * const* protos, upb_ServiceDef* s); #ifdef __cplusplus } /* extern "C" */ @@ -10382,6 +10588,7 @@ typedef struct upb_Decoder { uint16_t options; bool missing_required; upb_Arena arena; + upb_DecodeStatus status; jmp_buf err; #ifndef NDEBUG @@ -10519,6 +10726,7 @@ UPB_INLINE uint32_t _upb_FastDecoder_LoadTag(const char* ptr) { #undef UPB_PTRADD #undef UPB_MUSTTAIL #undef UPB_FASTTABLE_SUPPORTED +#undef UPB_FASTTABLE_MASK #undef UPB_FASTTABLE #undef UPB_FASTTABLE_INIT #undef UPB_POISON_MEMORY_REGION @@ -10527,3 +10735,6 @@ UPB_INLINE uint32_t _upb_FastDecoder_LoadTag(const char* ptr) { #undef UPB_TREAT_PROTO2_ENUMS_LIKE_PROTO3 #undef UPB_DEPRECATED #undef UPB_GNUC_MIN +#undef UPB_DESCRIPTOR_UPB_H_FILENAME +#undef UPB_DESC +#undef UPB_IS_GOOGLE3 diff --git a/protobuf_deps.bzl b/protobuf_deps.bzl index 3527f79017..1269a2dcf4 100644 --- a/protobuf_deps.bzl +++ b/protobuf_deps.bzl @@ -150,7 +150,7 @@ def protobuf_deps(): _github_archive( name = "upb", repo = "https://github.com/protocolbuffers/upb", - commit = "0c6b72dbf891eafc91050ad60733ea3022fac2b3", - sha256 = "9c8cdfa013450548c9f03fac8e1390aeb21a75413f443790815b71d475c9af49", + commit = "5d4d54d387a6cccc7cbebec797cc253d58b42c69", + sha256 = "81acf80e2b452c051ae6239f2ead4f1b56056d7256daea1292d3a423151518e8", patches = ["@com_google_protobuf//build_defs:upb.patch"], ) diff --git a/ruby/ext/google/protobuf_c/ruby-upb.c b/ruby/ext/google/protobuf_c/ruby-upb.c index 4b62ad38f5..f55f352ff7 100644 --- a/ruby/ext/google/protobuf_c/ruby-upb.c +++ b/ruby/ext/google/protobuf_c/ruby-upb.c @@ -86,7 +86,11 @@ #define UPB_ALIGN_UP(size, align) (((size) + (align) - 1) / (align) * (align)) #define UPB_ALIGN_DOWN(size, align) ((size) / (align) * (align)) #define UPB_ALIGN_MALLOC(size) UPB_ALIGN_UP(size, UPB_MALLOC_ALIGN) +#ifdef __clang__ +#define UPB_ALIGN_OF(type) _Alignof(type) +#else #define UPB_ALIGN_OF(type) offsetof (struct { char c; type member; }, member) +#endif // Hints to the compiler about likely/unlikely branches. #if defined (__GNUC__) || defined(__clang__) @@ -219,11 +223,13 @@ #endif /* UPB_FASTTABLE_INIT() allows protos compiled for fasttable to gracefully - * degrade to non-fasttable if we are using UPB_TRY_ENABLE_FASTTABLE. */ -#if !UPB_FASTTABLE && defined(UPB_TRY_ENABLE_FASTTABLE) + * degrade to non-fasttable if the runtime or platform do not support it. */ +#if !UPB_FASTTABLE #define UPB_FASTTABLE_INIT(...) +#define UPB_FASTTABLE_MASK(mask) -1 #else #define UPB_FASTTABLE_INIT(...) __VA_ARGS__ +#define UPB_FASTTABLE_MASK(mask) mask #endif #undef UPB_FASTTABLE_SUPPORTED @@ -279,6 +285,16 @@ void __asan_unpoison_memory_region(void const volatile *addr, size_t size); #define UPB_DEPRECATED #endif +// begin:google_only +// #define UPB_IS_GOOGLE3 +// end:google_only + +#if defined(UPB_IS_GOOGLE3) && !defined(UPB_BOOTSTRAP_STAGE0) +#define UPB_DESC(sym) proto2_##sym +#else +#define UPB_DESC(sym) google_protobuf_##sym +#endif + #include #include @@ -668,6 +684,7 @@ bool _upb_mapsorter_pushmap(_upb_mapsorter* s, upb_FieldType key_type, #include +// Must be last. static const upb_MiniTableSub google_protobuf_FileDescriptorSet_submsgs[1] = { {.submsg = &google_protobuf_FileDescriptorProto_msg_init}, @@ -680,7 +697,11 @@ static const upb_MiniTableField google_protobuf_FileDescriptorSet__fields[1] = { const upb_MiniTable google_protobuf_FileDescriptorSet_msg_init = { &google_protobuf_FileDescriptorSet_submsgs[0], &google_protobuf_FileDescriptorSet__fields[0], - 8, 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_prm_1bt_max192b}, + }) }; static const upb_MiniTableSub google_protobuf_FileDescriptorProto_submsgs[6] = { @@ -711,7 +732,25 @@ static const upb_MiniTableField google_protobuf_FileDescriptorProto__fields[13] const upb_MiniTable google_protobuf_FileDescriptorProto_msg_init = { &google_protobuf_FileDescriptorProto_submsgs[0], &google_protobuf_FileDescriptorProto__fields[0], - UPB_SIZE(72, 144), 13, kUpb_ExtMode_NonExtendable, 13, 255, 0, + UPB_SIZE(72, 144), 13, kUpb_ExtMode_NonExtendable, 13, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psb_1bt}, + {0x0018000002000012, &upb_psb_1bt}, + {0x002800003f00001a, &upb_prb_1bt}, + {0x003000003f000022, &upb_prm_1bt_max128b}, + {0x003800003f01002a, &upb_prm_1bt_max64b}, + {0x004000003f020032, &upb_prm_1bt_max64b}, + {0x004800003f03003a, &upb_prm_1bt_max128b}, + {0x0050000003040042, &upb_psm_1bt_max256b}, + {0x005800000405004a, &upb_psm_1bt_max64b}, + {0x006000003f000050, &upb_prv4_1bt}, + {0x006800003f000058, &upb_prv4_1bt}, + {0x0070000005000062, &upb_psb_1bt}, + {0x008000000600006a, &upb_psb_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTableSub google_protobuf_DescriptorProto_submsgs[8] = { @@ -741,7 +780,25 @@ static const upb_MiniTableField google_protobuf_DescriptorProto__fields[10] = { const upb_MiniTable google_protobuf_DescriptorProto_msg_init = { &google_protobuf_DescriptorProto_submsgs[0], &google_protobuf_DescriptorProto__fields[0], - UPB_SIZE(48, 96), 10, kUpb_ExtMode_NonExtendable, 10, 255, 0, + UPB_SIZE(48, 96), 10, kUpb_ExtMode_NonExtendable, 10, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psb_1bt}, + {0x001800003f000012, &upb_prm_1bt_max128b}, + {0x002000003f01001a, &upb_prm_1bt_max128b}, + {0x002800003f020022, &upb_prm_1bt_max64b}, + {0x003000003f03002a, &upb_prm_1bt_max64b}, + {0x003800003f040032, &upb_prm_1bt_max128b}, + {0x004000000205003a, &upb_psm_1bt_max64b}, + {0x004800003f060042, &upb_prm_1bt_max64b}, + {0x005000003f07004a, &upb_prm_1bt_max64b}, + {0x005800003f000052, &upb_prb_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTableSub google_protobuf_DescriptorProto_ExtensionRange_submsgs[1] = { @@ -757,7 +814,13 @@ static const upb_MiniTableField google_protobuf_DescriptorProto_ExtensionRange__ const upb_MiniTable google_protobuf_DescriptorProto_ExtensionRange_msg_init = { &google_protobuf_DescriptorProto_ExtensionRange_submsgs[0], &google_protobuf_DescriptorProto_ExtensionRange__fields[0], - UPB_SIZE(16, 24), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(16, 24), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0004000001000008, &upb_psv4_1bt}, + {0x0008000002000010, &upb_psv4_1bt}, + {0x001000000300001a, &upb_psm_1bt_max64b}, + }) }; static const upb_MiniTableField google_protobuf_DescriptorProto_ReservedRange__fields[2] = { @@ -768,7 +831,13 @@ static const upb_MiniTableField google_protobuf_DescriptorProto_ReservedRange__f const upb_MiniTable google_protobuf_DescriptorProto_ReservedRange_msg_init = { NULL, &google_protobuf_DescriptorProto_ReservedRange__fields[0], - 16, 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + 16, 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0004000001000008, &upb_psv4_1bt}, + {0x0008000002000010, &upb_psv4_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTableSub google_protobuf_ExtensionRangeOptions_submsgs[1] = { @@ -782,7 +851,41 @@ static const upb_MiniTableField google_protobuf_ExtensionRangeOptions__fields[1] const upb_MiniTable google_protobuf_ExtensionRangeOptions_msg_init = { &google_protobuf_ExtensionRangeOptions_submsgs[0], &google_protobuf_ExtensionRangeOptions__fields[0], - 8, 1, kUpb_ExtMode_Extendable, 0, 255, 0, + 8, 1, kUpb_ExtMode_Extendable, 0, UPB_FASTTABLE_MASK(248), 0, + UPB_FASTTABLE_INIT({ + {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}, + {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}, + {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}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {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}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTableSub google_protobuf_FieldDescriptorProto_submsgs[3] = { @@ -808,7 +911,41 @@ static const upb_MiniTableField google_protobuf_FieldDescriptorProto__fields[11] const upb_MiniTable google_protobuf_FieldDescriptorProto_msg_init = { &google_protobuf_FieldDescriptorProto_submsgs[0], &google_protobuf_FieldDescriptorProto__fields[0], - UPB_SIZE(72, 112), 11, kUpb_ExtMode_NonExtendable, 10, 255, 0, + UPB_SIZE(72, 112), 11, kUpb_ExtMode_NonExtendable, 10, UPB_FASTTABLE_MASK(248), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001800000100000a, &upb_psb_1bt}, + {0x0028000002000012, &upb_psb_1bt}, + {0x0004000003000018, &upb_psv4_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0038000006000032, &upb_psb_1bt}, + {0x004800000700003a, &upb_psb_1bt}, + {0x0058000008020042, &upb_psm_1bt_max64b}, + {0x0010000009000048, &upb_psv4_1bt}, + {0x006000000a000052, &upb_psb_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001400000b000188, &upb_psb1_2bt}, + {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}, + {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_MiniTableSub google_protobuf_OneofDescriptorProto_submsgs[1] = { @@ -823,7 +960,13 @@ static const upb_MiniTableField google_protobuf_OneofDescriptorProto__fields[2] const upb_MiniTable google_protobuf_OneofDescriptorProto_msg_init = { &google_protobuf_OneofDescriptorProto_submsgs[0], &google_protobuf_OneofDescriptorProto__fields[0], - UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psb_1bt}, + {0x0018000002000012, &upb_psm_1bt_max64b}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTableSub google_protobuf_EnumDescriptorProto_submsgs[3] = { @@ -843,7 +986,17 @@ static const upb_MiniTableField google_protobuf_EnumDescriptorProto__fields[5] = const upb_MiniTable google_protobuf_EnumDescriptorProto_msg_init = { &google_protobuf_EnumDescriptorProto_submsgs[0], &google_protobuf_EnumDescriptorProto__fields[0], - UPB_SIZE(32, 56), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0, + UPB_SIZE(32, 56), 5, kUpb_ExtMode_NonExtendable, 5, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psb_1bt}, + {0x001800003f000012, &upb_prm_1bt_max64b}, + {0x002000000201001a, &upb_psm_1bt_max64b}, + {0x002800003f020022, &upb_prm_1bt_max64b}, + {0x003000003f00002a, &upb_prb_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTableField google_protobuf_EnumDescriptorProto_EnumReservedRange__fields[2] = { @@ -854,7 +1007,13 @@ static const upb_MiniTableField google_protobuf_EnumDescriptorProto_EnumReserved const upb_MiniTable google_protobuf_EnumDescriptorProto_EnumReservedRange_msg_init = { NULL, &google_protobuf_EnumDescriptorProto_EnumReservedRange__fields[0], - 16, 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + 16, 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0004000001000008, &upb_psv4_1bt}, + {0x0008000002000010, &upb_psv4_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTableSub google_protobuf_EnumValueDescriptorProto_submsgs[1] = { @@ -870,7 +1029,13 @@ static const upb_MiniTableField google_protobuf_EnumValueDescriptorProto__fields const upb_MiniTable google_protobuf_EnumValueDescriptorProto_msg_init = { &google_protobuf_EnumValueDescriptorProto_submsgs[0], &google_protobuf_EnumValueDescriptorProto__fields[0], - UPB_SIZE(24, 32), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(24, 32), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psb_1bt}, + {0x0004000002000010, &upb_psv4_1bt}, + {0x001800000300001a, &upb_psm_1bt_max64b}, + }) }; static const upb_MiniTableSub google_protobuf_ServiceDescriptorProto_submsgs[2] = { @@ -887,7 +1052,13 @@ static const upb_MiniTableField google_protobuf_ServiceDescriptorProto__fields[3 const upb_MiniTable google_protobuf_ServiceDescriptorProto_msg_init = { &google_protobuf_ServiceDescriptorProto_submsgs[0], &google_protobuf_ServiceDescriptorProto__fields[0], - UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psb_1bt}, + {0x001800003f000012, &upb_prm_1bt_max128b}, + {0x002000000201001a, &upb_psm_1bt_max64b}, + }) }; static const upb_MiniTableSub google_protobuf_MethodDescriptorProto_submsgs[1] = { @@ -906,7 +1077,17 @@ static const upb_MiniTableField google_protobuf_MethodDescriptorProto__fields[6] const upb_MiniTable google_protobuf_MethodDescriptorProto_msg_init = { &google_protobuf_MethodDescriptorProto_submsgs[0], &google_protobuf_MethodDescriptorProto__fields[0], - UPB_SIZE(40, 64), 6, kUpb_ExtMode_NonExtendable, 6, 255, 0, + UPB_SIZE(40, 64), 6, kUpb_ExtMode_NonExtendable, 6, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psb_1bt}, + {0x0018000002000012, &upb_psb_1bt}, + {0x002800000300001a, &upb_psb_1bt}, + {0x0038000004000022, &upb_psm_1bt_max64b}, + {0x0001000005000028, &upb_psb1_1bt}, + {0x0002000006000030, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTableSub google_protobuf_FileOptions_submsgs[2] = { @@ -941,7 +1122,41 @@ static const upb_MiniTableField google_protobuf_FileOptions__fields[21] = { const upb_MiniTable google_protobuf_FileOptions_msg_init = { &google_protobuf_FileOptions_submsgs[0], &google_protobuf_FileOptions__fields[0], - UPB_SIZE(104, 192), 21, kUpb_ExtMode_Extendable, 1, 255, 0, + UPB_SIZE(104, 192), 21, kUpb_ExtMode_Extendable, 1, UPB_FASTTABLE_MASK(248), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001800000100000a, &upb_psb_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0028000002000042, &upb_psb_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0008000004000050, &upb_psb1_1bt}, + {0x003800000500005a, &upb_psb_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0009000006000180, &upb_psb1_2bt}, + {0x000a000007000188, &upb_psb1_2bt}, + {0x000b000008000190, &upb_psb1_2bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000c0000090001a0, &upb_psb1_2bt}, + {0x005800000e0002aa, &upb_psb_2bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000d00000a0001b8, &upb_psb1_2bt}, + {0x00780000100002c2, &upb_psb_2bt}, + {0x00880000110002ca, &upb_psb_2bt}, + {0x00100000120002d0, &upb_psb1_2bt}, + {0x000e00000b0001d8, &upb_psb1_2bt}, + {0x00980000130002e2, &upb_psb_2bt}, + {0x00a80000140002ea, &upb_psb_2bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000f00000c0001f8, &upb_psb1_2bt}, + }) }; static const upb_MiniTableSub google_protobuf_MessageOptions_submsgs[1] = { @@ -960,7 +1175,41 @@ static const upb_MiniTableField google_protobuf_MessageOptions__fields[6] = { const upb_MiniTable google_protobuf_MessageOptions_msg_init = { &google_protobuf_MessageOptions_submsgs[0], &google_protobuf_MessageOptions__fields[0], - 16, 6, kUpb_ExtMode_Extendable, 3, 255, 0, + 16, 6, kUpb_ExtMode_Extendable, 3, UPB_FASTTABLE_MASK(248), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0001000001000008, &upb_psb1_1bt}, + {0x0002000002000010, &upb_psb1_1bt}, + {0x0003000003000018, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0004000004000038, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0005000005000058, &upb_psb1_1bt}, + {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}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f003eba, &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}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTableSub google_protobuf_FieldOptions_submsgs[3] = { @@ -984,7 +1233,41 @@ static const upb_MiniTableField google_protobuf_FieldOptions__fields[9] = { const upb_MiniTable google_protobuf_FieldOptions_msg_init = { &google_protobuf_FieldOptions_submsgs[0], &google_protobuf_FieldOptions__fields[0], - UPB_SIZE(24, 32), 9, kUpb_ExtMode_Extendable, 3, 255, 0, + UPB_SIZE(24, 32), 9, kUpb_ExtMode_Extendable, 3, UPB_FASTTABLE_MASK(248), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0008000002000010, &upb_psb1_1bt}, + {0x0009000003000018, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000a000004000028, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0010000006000050, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0011000007000078, &upb_psb1_1bt}, + {0x0012000008000180, &upb_psb1_2bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001800003f023eba, &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}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTableSub google_protobuf_OneofOptions_submsgs[1] = { @@ -998,7 +1281,41 @@ static const upb_MiniTableField google_protobuf_OneofOptions__fields[1] = { const upb_MiniTable google_protobuf_OneofOptions_msg_init = { &google_protobuf_OneofOptions_submsgs[0], &google_protobuf_OneofOptions__fields[0], - 8, 1, kUpb_ExtMode_Extendable, 0, 255, 0, + 8, 1, kUpb_ExtMode_Extendable, 0, UPB_FASTTABLE_MASK(248), 0, + UPB_FASTTABLE_INIT({ + {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}, + {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}, + {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}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {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}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTableSub google_protobuf_EnumOptions_submsgs[1] = { @@ -1015,7 +1332,41 @@ static const upb_MiniTableField google_protobuf_EnumOptions__fields[4] = { const upb_MiniTable google_protobuf_EnumOptions_msg_init = { &google_protobuf_EnumOptions_submsgs[0], &google_protobuf_EnumOptions__fields[0], - UPB_SIZE(8, 16), 4, kUpb_ExtMode_Extendable, 0, 255, 0, + UPB_SIZE(8, 16), 4, kUpb_ExtMode_Extendable, 0, UPB_FASTTABLE_MASK(248), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0001000001000010, &upb_psb1_1bt}, + {0x0002000002000018, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0003000003000030, &upb_psb1_1bt}, + {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}, + {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}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f003eba, &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}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTableSub google_protobuf_EnumValueOptions_submsgs[1] = { @@ -1030,7 +1381,41 @@ static const upb_MiniTableField google_protobuf_EnumValueOptions__fields[2] = { const upb_MiniTable google_protobuf_EnumValueOptions_msg_init = { &google_protobuf_EnumValueOptions_submsgs[0], &google_protobuf_EnumValueOptions__fields[0], - UPB_SIZE(8, 16), 2, kUpb_ExtMode_Extendable, 1, 255, 0, + UPB_SIZE(8, 16), 2, kUpb_ExtMode_Extendable, 1, UPB_FASTTABLE_MASK(248), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0001000001000008, &upb_psb1_1bt}, + {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}, + {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}, + {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}, + {0x000800003f003eba, &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}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTableSub google_protobuf_ServiceOptions_submsgs[1] = { @@ -1045,7 +1430,41 @@ static const upb_MiniTableField google_protobuf_ServiceOptions__fields[2] = { const upb_MiniTable google_protobuf_ServiceOptions_msg_init = { &google_protobuf_ServiceOptions_submsgs[0], &google_protobuf_ServiceOptions__fields[0], - UPB_SIZE(8, 16), 2, kUpb_ExtMode_Extendable, 0, 255, 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}, + {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}, + {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}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0001000001000288, &upb_psb1_2bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f003eba, &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}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTableSub google_protobuf_MethodOptions_submsgs[2] = { @@ -1062,7 +1481,41 @@ static const upb_MiniTableField google_protobuf_MethodOptions__fields[3] = { const upb_MiniTable google_protobuf_MethodOptions_msg_init = { &google_protobuf_MethodOptions_submsgs[0], &google_protobuf_MethodOptions__fields[0], - 16, 3, kUpb_ExtMode_Extendable, 0, 255, 0, + 16, 3, kUpb_ExtMode_Extendable, 0, UPB_FASTTABLE_MASK(248), 0, + UPB_FASTTABLE_INIT({ + {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}, + {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}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0001000001000288, &upb_psb1_2bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f013eba, &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}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTableSub google_protobuf_UninterpretedOption_submsgs[1] = { @@ -1082,7 +1535,25 @@ static const upb_MiniTableField google_protobuf_UninterpretedOption__fields[7] = const upb_MiniTable google_protobuf_UninterpretedOption_msg_init = { &google_protobuf_UninterpretedOption_submsgs[0], &google_protobuf_UninterpretedOption__fields[0], - UPB_SIZE(56, 88), 7, kUpb_ExtMode_NonExtendable, 0, 255, 0, + UPB_SIZE(56, 88), 7, kUpb_ExtMode_NonExtendable, 0, UPB_FASTTABLE_MASK(120), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f000012, &upb_prm_1bt_max64b}, + {0x001000000100001a, &upb_psb_1bt}, + {0x0020000002000020, &upb_psv8_1bt}, + {0x0028000003000028, &upb_psv8_1bt}, + {0x0030000004000031, &upb_psf8_1bt}, + {0x003800000500003a, &upb_psb_1bt}, + {0x0048000006000042, &upb_psb_1bt}, + {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_UninterpretedOption_NamePart__fields[2] = { @@ -1093,7 +1564,13 @@ static const upb_MiniTableField google_protobuf_UninterpretedOption_NamePart__fi const upb_MiniTable google_protobuf_UninterpretedOption_NamePart_msg_init = { NULL, &google_protobuf_UninterpretedOption_NamePart__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 2, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 2, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psb_1bt}, + {0x0001000002000010, &upb_psb1_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTableSub google_protobuf_SourceCodeInfo_submsgs[1] = { @@ -1107,7 +1584,11 @@ static const upb_MiniTableField google_protobuf_SourceCodeInfo__fields[1] = { const upb_MiniTable google_protobuf_SourceCodeInfo_msg_init = { &google_protobuf_SourceCodeInfo_submsgs[0], &google_protobuf_SourceCodeInfo__fields[0], - 8, 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_prm_1bt_max128b}, + }) }; static const upb_MiniTableField google_protobuf_SourceCodeInfo_Location__fields[5] = { @@ -1121,7 +1602,17 @@ static const upb_MiniTableField google_protobuf_SourceCodeInfo_Location__fields[ const upb_MiniTable google_protobuf_SourceCodeInfo_Location_msg_init = { NULL, &google_protobuf_SourceCodeInfo_Location__fields[0], - UPB_SIZE(32, 64), 5, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(32, 64), 5, kUpb_ExtMode_NonExtendable, 4, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800003f00000a, &upb_ppv4_1bt}, + {0x001000003f000012, &upb_ppv4_1bt}, + {0x001800000100001a, &upb_psb_1bt}, + {0x0028000002000022, &upb_psb_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x003800003f000032, &upb_prb_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTableSub google_protobuf_GeneratedCodeInfo_submsgs[1] = { @@ -1135,7 +1626,11 @@ static const upb_MiniTableField google_protobuf_GeneratedCodeInfo__fields[1] = { const upb_MiniTable google_protobuf_GeneratedCodeInfo_msg_init = { &google_protobuf_GeneratedCodeInfo_submsgs[0], &google_protobuf_GeneratedCodeInfo__fields[0], - 8, 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + 8, 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000000003f00000a, &upb_prm_1bt_max64b}, + }) }; static const upb_MiniTableSub google_protobuf_GeneratedCodeInfo_Annotation_submsgs[1] = { @@ -1153,7 +1648,17 @@ static const upb_MiniTableField google_protobuf_GeneratedCodeInfo_Annotation__fi const upb_MiniTable google_protobuf_GeneratedCodeInfo_Annotation_msg_init = { &google_protobuf_GeneratedCodeInfo_Annotation_submsgs[0], &google_protobuf_GeneratedCodeInfo_Annotation__fields[0], - UPB_SIZE(32, 40), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0, + UPB_SIZE(32, 40), 5, kUpb_ExtMode_NonExtendable, 5, UPB_FASTTABLE_MASK(56), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x001000003f00000a, &upb_ppv4_1bt}, + {0x0018000001000012, &upb_psb_1bt}, + {0x0004000002000018, &upb_psv4_1bt}, + {0x0008000003000020, &upb_psv4_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) }; static const upb_MiniTable *messages_layout[27] = { @@ -4060,6 +4565,12 @@ static void jsonenc_value(jsonenc* e, const upb_Message* msg, jsonenc_putstr(e, "null"); break; case 2: + if (upb_JsonEncode_HandleSpecialDoubles(e, val.double_val)) { + jsonenc_err( + e, + "google.protobuf.Value cannot encode double values for " + "infinity or nan, because they would be parsed as a string"); + } upb_JsonEncode_Double(e, val.double_val); break; case 3: @@ -4863,7 +5374,7 @@ upb_GetExtensionAsBytes_Status upb_MiniTable_GetExtensionAsBytes( return kUpb_GetExtensionAsBytes_Ok; } -upb_FindUnknownRet upb_FindUnknownRet_ParseError() { +static upb_FindUnknownRet upb_FindUnknownRet_ParseError(void) { return (upb_FindUnknownRet){.status = kUpb_FindUnknown_ParseError}; } @@ -4885,14 +5396,14 @@ upb_FindUnknownRet upb_MiniTable_FindUnknown(const upb_Message* msg, if (field_number == upb_WireReader_GetFieldNumber(tag)) { ret.status = kUpb_FindUnknown_Ok; ret.ptr = upb_EpsCopyInputStream_GetAliasedPtr(&stream, unknown_begin); - ptr = upb_WireReader_SkipValue(ptr, tag, depth_limit, &stream); + ptr = _upb_WireReader_SkipValue(ptr, tag, depth_limit, &stream); // Because we know that the input is a flat buffer, it is safe to perform // pointer arithmetic on aliased pointers. ret.len = upb_EpsCopyInputStream_GetAliasedPtr(&stream, ptr) - ret.ptr; return ret; } - ptr = upb_WireReader_SkipValue(ptr, tag, depth_limit, &stream); + ptr = _upb_WireReader_SkipValue(ptr, tag, depth_limit, &stream); if (!ptr) return upb_FindUnknownRet_ParseError(); } ret.status = kUpb_FindUnknown_NotPresent; @@ -4911,7 +5422,7 @@ upb_UnknownToMessageRet upb_MiniTable_PromoteUnknownToMessage( // Callers should check that message is not set first before calling // PromotoUnknownToMessage. UPB_ASSERT(mini_table->subs[field->submsg_index].submsg == sub_mini_table); - UPB_ASSERT(upb_MiniTable_GetMessage(msg, field, NULL) == NULL); + UPB_ASSERT(upb_Message_GetMessage(msg, field, NULL) == NULL); upb_UnknownToMessageRet ret; ret.status = kUpb_UnknownToMessage_Ok; do { @@ -4939,7 +5450,7 @@ upb_UnknownToMessageRet upb_MiniTable_PromoteUnknownToMessage( } } while (unknown.status == kUpb_FindUnknown_Ok); if (message) { - upb_MiniTable_SetMessage(msg, mini_table, field, message); + upb_Message_SetMessage(msg, mini_table, field, message); ret.message = message; } return ret; @@ -5029,8 +5540,8 @@ upb_UnknownToMessage_Status upb_MiniTable_PromoteUnknownToMap( /* base_message= */ NULL, decode_options, arena); if (ret.status != kUpb_UnknownToMessage_Ok) return ret.status; // Allocate map on demand before append. - upb_Map* map = - upb_MiniTable_GetMutableMap(msg, map_entry_mini_table, field, arena); + upb_Map* map = upb_Message_GetOrCreateMutableMap(msg, map_entry_mini_table, + field, arena); upb_Message* map_entry_message = ret.message; upb_MapInsertStatus insert_status = upb_Message_InsertMapEntry( map, mini_table, field, map_entry_message, arena); @@ -6872,6 +7383,7 @@ struct upb_DefPool { upb_strtable files; // file_name -> (upb_FileDef*) upb_inttable exts; // (upb_MiniTableExtension*) -> (upb_FieldDef*) upb_ExtensionRegistry* extreg; + upb_MiniTablePlatform platform; void* scratch_data; size_t scratch_size; size_t bytes_loaded; @@ -6901,6 +7413,8 @@ upb_DefPool* upb_DefPool_New(void) { s->extreg = upb_ExtensionRegistry_New(s->arena); if (!s->extreg) goto err; + s->platform = kUpb_MiniTablePlatform_Native; + return s; err: @@ -6954,6 +7468,11 @@ size_t* _upb_DefPool_ScratchSize(const upb_DefPool* s) { return (size_t*)&s->scratch_size; } +void _upb_DefPool_SetPlatform(upb_DefPool* s, upb_MiniTablePlatform platform) { + assert(upb_strtable_count(&s->files) == 0); + s->platform = platform; +} + const upb_MessageDef* upb_DefPool_FindMessageByName(const upb_DefPool* s, const char* sym) { return _upb_DefPool_Unpack(s, sym, strlen(sym), UPB_DEFTYPE_MSG); @@ -7107,9 +7626,9 @@ static void remove_filedef(upb_DefPool* s, upb_FileDef* file) { } static const upb_FileDef* _upb_DefPool_AddFile( - upb_DefPool* s, const google_protobuf_FileDescriptorProto* file_proto, + upb_DefPool* s, const UPB_DESC(FileDescriptorProto) * file_proto, const upb_MiniTableFile* layout, upb_Status* status) { - const upb_StringView name = google_protobuf_FileDescriptorProto_name(file_proto); + const upb_StringView name = UPB_DESC(FileDescriptorProto_name)(file_proto); if (name.size == 0) { upb_Status_SetErrorFormat(status, @@ -7131,6 +7650,7 @@ static const upb_FileDef* _upb_DefPool_AddFile( upb_DefBuilder ctx = { .symtab = s, .layout = layout, + .platform = s->platform, .msg_count = 0, .enum_count = 0, .ext_count = 0, @@ -7161,9 +7681,10 @@ static const upb_FileDef* _upb_DefPool_AddFile( return ctx.file; } -const upb_FileDef* upb_DefPool_AddFile( - upb_DefPool* s, const google_protobuf_FileDescriptorProto* file_proto, - upb_Status* status) { +const upb_FileDef* upb_DefPool_AddFile(upb_DefPool* s, + const UPB_DESC(FileDescriptorProto) * + file_proto, + upb_Status* status) { return _upb_DefPool_AddFile(s, file_proto, NULL, status); } @@ -7172,7 +7693,7 @@ bool _upb_DefPool_LoadDefInitEx(upb_DefPool* s, const _upb_DefPool_Init* init, /* Since this function should never fail (it would indicate a bug in upb) we * print errors to stderr instead of returning error status to the user. */ _upb_DefPool_Init** deps = init->deps; - google_protobuf_FileDescriptorProto* file; + UPB_DESC(FileDescriptorProto) * file; upb_Arena* arena; upb_Status status; @@ -7188,7 +7709,7 @@ bool _upb_DefPool_LoadDefInitEx(upb_DefPool* s, const _upb_DefPool_Init* init, if (!_upb_DefPool_LoadDefInitEx(s, *deps, rebuild_minitable)) goto err; } - file = google_protobuf_FileDescriptorProto_parse_ex( + file = UPB_DESC(FileDescriptorProto_parse_ex)( init->descriptor.data, init->descriptor.size, NULL, kUpb_DecodeOption_AliasString, arena); s->bytes_loaded += init->descriptor.size; @@ -7327,7 +7848,7 @@ bool _upb_DescState_Grow(upb_DescState* d, upb_Arena* a) { // Must be last. struct upb_EnumDef { - const google_protobuf_EnumOptions* opts; + const UPB_DESC(EnumOptions) * opts; const upb_MiniTableEnum* layout; // Only for proto2. const upb_FileDef* file; const upb_MessageDef* containing_type; // Could be merged with "file". @@ -7375,7 +7896,7 @@ bool _upb_EnumDef_Insert(upb_EnumDef* e, upb_EnumValueDef* v, upb_Arena* a) { return true; } -const google_protobuf_EnumOptions* upb_EnumDef_Options(const upb_EnumDef* e) { +const UPB_DESC(EnumOptions) * upb_EnumDef_Options(const upb_EnumDef* e) { return e->opts; } @@ -7523,10 +8044,10 @@ static upb_StringView* _upb_EnumReservedNames_New( } static void create_enumdef(upb_DefBuilder* ctx, const char* prefix, - const google_protobuf_EnumDescriptorProto* enum_proto, + const UPB_DESC(EnumDescriptorProto) * enum_proto, upb_EnumDef* e) { - const google_protobuf_EnumValueDescriptorProto* const* values; - const google_protobuf_EnumDescriptorProto_EnumReservedRange* const* res_ranges; + const UPB_DESC(EnumValueDescriptorProto)* const* values; + const UPB_DESC(EnumDescriptorProto_EnumReservedRange)* const* res_ranges; const upb_StringView* res_names; upb_StringView name; size_t n_value, n_res_range, n_res_name; @@ -7534,14 +8055,14 @@ static void create_enumdef(upb_DefBuilder* ctx, const char* prefix, // Must happen before _upb_DefBuilder_Add() e->file = _upb_DefBuilder_File(ctx); - name = google_protobuf_EnumDescriptorProto_name(enum_proto); + name = UPB_DESC(EnumDescriptorProto_name)(enum_proto); _upb_DefBuilder_CheckIdentNotFull(ctx, name); e->full_name = _upb_DefBuilder_MakeFullName(ctx, prefix, name); _upb_DefBuilder_Add(ctx, e->full_name, _upb_DefType_Pack(e, UPB_DEFTYPE_ENUM)); - values = google_protobuf_EnumDescriptorProto_value(enum_proto, &n_value); + values = UPB_DESC(EnumDescriptorProto_value)(enum_proto, &n_value); bool ok = upb_strtable_init(&e->ntoi, n_value, ctx->arena); if (!ok) _upb_DefBuilder_OomErr(ctx); @@ -7560,11 +8081,12 @@ static void create_enumdef(upb_DefBuilder* ctx, const char* prefix, } res_ranges = - google_protobuf_EnumDescriptorProto_reserved_range(enum_proto, &n_res_range); + UPB_DESC(EnumDescriptorProto_reserved_range)(enum_proto, &n_res_range); e->res_range_count = n_res_range; e->res_ranges = _upb_EnumReservedRanges_New(ctx, n_res_range, res_ranges, e); - res_names = google_protobuf_EnumDescriptorProto_reserved_name(enum_proto, &n_res_name); + res_names = + UPB_DESC(EnumDescriptorProto_reserved_name)(enum_proto, &n_res_name); e->res_name_count = n_res_name; e->res_names = _upb_EnumReservedNames_New(ctx, n_res_name, res_names); @@ -7584,9 +8106,10 @@ static void create_enumdef(upb_DefBuilder* ctx, const char* prefix, } } -upb_EnumDef* _upb_EnumDefs_New(upb_DefBuilder* ctx, int n, - const google_protobuf_EnumDescriptorProto* const* protos, - const upb_MessageDef* containing_type) { +upb_EnumDef* _upb_EnumDefs_New( + upb_DefBuilder* ctx, int n, + const UPB_DESC(EnumDescriptorProto) * const* protos, + const upb_MessageDef* containing_type) { _upb_DefType_CheckPadding(sizeof(upb_EnumDef)); // If a containing type is defined then get the full name from that. @@ -7626,16 +8149,16 @@ int32_t upb_EnumReservedRange_End(const upb_EnumReservedRange* r) { upb_EnumReservedRange* _upb_EnumReservedRanges_New( upb_DefBuilder* ctx, int n, - const google_protobuf_EnumDescriptorProto_EnumReservedRange* const* protos, + const UPB_DESC(EnumDescriptorProto_EnumReservedRange) * const* protos, const upb_EnumDef* e) { upb_EnumReservedRange* r = _upb_DefBuilder_Alloc(ctx, sizeof(upb_EnumReservedRange) * n); for (int i = 0; i < n; i++) { const int32_t start = - google_protobuf_EnumDescriptorProto_EnumReservedRange_start(protos[i]); + UPB_DESC(EnumDescriptorProto_EnumReservedRange_start)(protos[i]); const int32_t end = - google_protobuf_EnumDescriptorProto_EnumReservedRange_end(protos[i]); + UPB_DESC(EnumDescriptorProto_EnumReservedRange_end)(protos[i]); // A full validation would also check that each range is disjoint, and that // none of the fields overlap with the extension ranges, but we are just @@ -7659,7 +8182,7 @@ upb_EnumReservedRange* _upb_EnumReservedRanges_New( // Must be last. struct upb_EnumValueDef { - const google_protobuf_EnumValueOptions* opts; + const UPB_DESC(EnumValueOptions) * opts; const upb_EnumDef* parent; const char* full_name; int32_t number; @@ -7690,8 +8213,8 @@ const upb_EnumValueDef** _upb_EnumValueDefs_Sorted(const upb_EnumValueDef* v, return (const upb_EnumValueDef**)out; } -const google_protobuf_EnumValueOptions* upb_EnumValueDef_Options( - const upb_EnumValueDef* v) { +const UPB_DESC(EnumValueOptions) * + upb_EnumValueDef_Options(const upb_EnumValueDef* v) { return v->opts; } @@ -7719,13 +8242,14 @@ uint32_t upb_EnumValueDef_Index(const upb_EnumValueDef* v) { } static void create_enumvaldef(upb_DefBuilder* ctx, const char* prefix, - const google_protobuf_EnumValueDescriptorProto* val_proto, + const UPB_DESC(EnumValueDescriptorProto) * + val_proto, upb_EnumDef* e, upb_EnumValueDef* v) { - upb_StringView name = google_protobuf_EnumValueDescriptorProto_name(val_proto); + upb_StringView name = UPB_DESC(EnumValueDescriptorProto_name)(val_proto); v->parent = e; // Must happen prior to _upb_DefBuilder_Add() v->full_name = _upb_DefBuilder_MakeFullName(ctx, prefix, name); - v->number = google_protobuf_EnumValueDescriptorProto_number(val_proto); + v->number = UPB_DESC(EnumValueDescriptorProto_number)(val_proto); _upb_DefBuilder_Add(ctx, v->full_name, _upb_DefType_Pack(v, UPB_DEFTYPE_ENUMVAL)); @@ -7739,7 +8263,7 @@ static void create_enumvaldef(upb_DefBuilder* ctx, const char* prefix, // Allocate and initialize an array of |n| enum value defs owned by |e|. upb_EnumValueDef* _upb_EnumValueDefs_New( upb_DefBuilder* ctx, const char* prefix, int n, - const google_protobuf_EnumValueDescriptorProto* const* protos, upb_EnumDef* e, + const UPB_DESC(EnumValueDescriptorProto) * const* protos, upb_EnumDef* e, bool* is_sorted) { _upb_DefType_CheckPadding(sizeof(upb_EnumValueDef)); @@ -7770,7 +8294,7 @@ upb_EnumValueDef* _upb_EnumValueDefs_New( // Must be last. struct upb_ExtensionRange { - const google_protobuf_ExtensionRangeOptions* opts; + const UPB_DESC(ExtensionRangeOptions) * opts; int32_t start; int32_t end; }; @@ -7779,8 +8303,8 @@ upb_ExtensionRange* _upb_ExtensionRange_At(const upb_ExtensionRange* r, int i) { return (upb_ExtensionRange*)&r[i]; } -const google_protobuf_ExtensionRangeOptions* upb_ExtensionRange_Options( - const upb_ExtensionRange* r) { +const UPB_DESC(ExtensionRangeOptions) * + upb_ExtensionRange_Options(const upb_ExtensionRange* r) { return r->opts; } @@ -7796,19 +8320,19 @@ int32_t upb_ExtensionRange_End(const upb_ExtensionRange* r) { return r->end; } upb_ExtensionRange* _upb_ExtensionRanges_New( upb_DefBuilder* ctx, int n, - const google_protobuf_DescriptorProto_ExtensionRange* const* protos, + const UPB_DESC(DescriptorProto_ExtensionRange) * const* protos, const upb_MessageDef* m) { upb_ExtensionRange* r = _upb_DefBuilder_Alloc(ctx, sizeof(upb_ExtensionRange) * n); for (int i = 0; i < n; i++) { const int32_t start = - google_protobuf_DescriptorProto_ExtensionRange_start(protos[i]); - const int32_t end = google_protobuf_DescriptorProto_ExtensionRange_end(protos[i]); - const int32_t max = - google_protobuf_MessageOptions_message_set_wire_format(upb_MessageDef_Options(m)) - ? INT32_MAX - : kUpb_MaxFieldNumber + 1; + UPB_DESC(DescriptorProto_ExtensionRange_start)(protos[i]); + const int32_t end = UPB_DESC(DescriptorProto_ExtensionRange_end)(protos[i]); + const int32_t max = UPB_DESC(MessageOptions_message_set_wire_format)( + upb_MessageDef_Options(m)) + ? INT32_MAX + : kUpb_MaxFieldNumber + 1; // A full validation would also check that each range is disjoint, and that // none of the fields overlap with the extension ranges, but we are just @@ -7842,7 +8366,7 @@ typedef struct { } str_t; struct upb_FieldDef { - const google_protobuf_FieldOptions* opts; + const UPB_DESC(FieldOptions) * opts; const upb_FileDef* file; const upb_MessageDef* msgdef; const char* full_name; @@ -7863,7 +8387,7 @@ struct upb_FieldDef { union { const upb_MessageDef* msgdef; const upb_EnumDef* enumdef; - const google_protobuf_FieldDescriptorProto* unresolved; + const UPB_DESC(FieldDescriptorProto) * unresolved; } sub; uint32_t number_; uint16_t index_; @@ -7884,7 +8408,7 @@ upb_FieldDef* _upb_FieldDef_At(const upb_FieldDef* f, int i) { return (upb_FieldDef*)&f[i]; } -const google_protobuf_FieldOptions* upb_FieldDef_Options(const upb_FieldDef* f) { +const UPB_DESC(FieldOptions) * upb_FieldDef_Options(const upb_FieldDef* f) { return f->opts; } @@ -8339,22 +8863,23 @@ static void set_default_default(upb_DefBuilder* ctx, upb_FieldDef* f) { } static void _upb_FieldDef_Create(upb_DefBuilder* ctx, const char* prefix, - const google_protobuf_FieldDescriptorProto* field_proto, + const UPB_DESC(FieldDescriptorProto) * + field_proto, upb_MessageDef* m, upb_FieldDef* f) { // Must happen before _upb_DefBuilder_Add() f->file = _upb_DefBuilder_File(ctx); - if (!google_protobuf_FieldDescriptorProto_has_name(field_proto)) { + if (!UPB_DESC(FieldDescriptorProto_has_name)(field_proto)) { _upb_DefBuilder_Errf(ctx, "field has no name"); } - const upb_StringView name = google_protobuf_FieldDescriptorProto_name(field_proto); + const upb_StringView name = UPB_DESC(FieldDescriptorProto_name)(field_proto); _upb_DefBuilder_CheckIdentNotFull(ctx, name); - f->has_json_name_ = google_protobuf_FieldDescriptorProto_has_json_name(field_proto); + f->has_json_name_ = UPB_DESC(FieldDescriptorProto_has_json_name)(field_proto); if (f->has_json_name_) { const upb_StringView sv = - google_protobuf_FieldDescriptorProto_json_name(field_proto); + UPB_DESC(FieldDescriptorProto_json_name)(field_proto); f->json_name = upb_strdup2(sv.data, sv.size, ctx->arena); } else { f->json_name = make_json_name(name.data, name.size, ctx->arena); @@ -8362,18 +8887,18 @@ static void _upb_FieldDef_Create(upb_DefBuilder* ctx, const char* prefix, if (!f->json_name) _upb_DefBuilder_OomErr(ctx); f->full_name = _upb_DefBuilder_MakeFullName(ctx, prefix, name); - f->label_ = (int)google_protobuf_FieldDescriptorProto_label(field_proto); - f->number_ = google_protobuf_FieldDescriptorProto_number(field_proto); + f->label_ = (int)UPB_DESC(FieldDescriptorProto_label)(field_proto); + f->number_ = UPB_DESC(FieldDescriptorProto_number)(field_proto); f->proto3_optional_ = - google_protobuf_FieldDescriptorProto_proto3_optional(field_proto); + UPB_DESC(FieldDescriptorProto_proto3_optional)(field_proto); f->msgdef = m; f->scope.oneof = NULL; - const bool has_type = google_protobuf_FieldDescriptorProto_has_type(field_proto); + const bool has_type = UPB_DESC(FieldDescriptorProto_has_type)(field_proto); const bool has_type_name = - google_protobuf_FieldDescriptorProto_has_type_name(field_proto); + UPB_DESC(FieldDescriptorProto_has_type_name)(field_proto); - f->type_ = (int)google_protobuf_FieldDescriptorProto_type(field_proto); + f->type_ = (int)UPB_DESC(FieldDescriptorProto_type)(field_proto); if (has_type) { switch (f->type_) { @@ -8418,8 +8943,9 @@ static void _upb_FieldDef_Create(upb_DefBuilder* ctx, const char* prefix, f->full_name); } - if (google_protobuf_FieldDescriptorProto_has_oneof_index(field_proto)) { - uint32_t oneof_index = google_protobuf_FieldDescriptorProto_oneof_index(field_proto); + if (UPB_DESC(FieldDescriptorProto_has_oneof_index)(field_proto)) { + uint32_t oneof_index = + UPB_DESC(FieldDescriptorProto_oneof_index)(field_proto); if (upb_FieldDef_Label(f) != kUpb_Label_Optional) { _upb_DefBuilder_Errf(ctx, "fields in oneof must have OPTIONAL label (%s)", @@ -8444,8 +8970,8 @@ static void _upb_FieldDef_Create(upb_DefBuilder* ctx, const char* prefix, UPB_DEF_SET_OPTIONS(f->opts, FieldDescriptorProto, FieldOptions, field_proto); - if (google_protobuf_FieldOptions_has_packed(f->opts)) { - f->is_packed_ = google_protobuf_FieldOptions_packed(f->opts); + if (UPB_DESC(FieldOptions_has_packed)(f->opts)) { + f->is_packed_ = UPB_DESC(FieldOptions_packed)(f->opts); } else { // Repeated fields default to packed for proto3 only. f->is_packed_ = upb_FieldDef_IsPrimitive(f) && @@ -8454,14 +8980,14 @@ static void _upb_FieldDef_Create(upb_DefBuilder* ctx, const char* prefix, } } -static void _upb_FieldDef_CreateExt( - upb_DefBuilder* ctx, const char* prefix, - const google_protobuf_FieldDescriptorProto* field_proto, upb_MessageDef* m, - upb_FieldDef* f) { +static void _upb_FieldDef_CreateExt(upb_DefBuilder* ctx, const char* prefix, + const UPB_DESC(FieldDescriptorProto) * + field_proto, + upb_MessageDef* m, upb_FieldDef* f) { _upb_FieldDef_Create(ctx, prefix, field_proto, m, f); f->is_extension_ = true; - if (google_protobuf_FieldDescriptorProto_has_oneof_index(field_proto)) { + if (UPB_DESC(FieldDescriptorProto_has_oneof_index)(field_proto)) { _upb_DefBuilder_Errf(ctx, "oneof_index provided for extension field (%s)", f->full_name); } @@ -8475,14 +9001,14 @@ static void _upb_FieldDef_CreateExt( } } -static void _upb_FieldDef_CreateNotExt( - upb_DefBuilder* ctx, const char* prefix, - const google_protobuf_FieldDescriptorProto* field_proto, upb_MessageDef* m, - upb_FieldDef* f) { +static void _upb_FieldDef_CreateNotExt(upb_DefBuilder* ctx, const char* prefix, + const UPB_DESC(FieldDescriptorProto) * + field_proto, + upb_MessageDef* m, upb_FieldDef* f) { _upb_FieldDef_Create(ctx, prefix, field_proto, m, f); f->is_extension_ = false; - if (!google_protobuf_FieldDescriptorProto_has_oneof_index(field_proto)) { + if (!UPB_DESC(FieldDescriptorProto_has_oneof_index)(field_proto)) { if (f->proto3_optional_) { _upb_DefBuilder_Errf( ctx, @@ -8509,7 +9035,7 @@ static void _upb_FieldDef_CreateNotExt( upb_FieldDef* _upb_FieldDefs_New( upb_DefBuilder* ctx, int n, - const google_protobuf_FieldDescriptorProto* const* protos, const char* prefix, + const UPB_DESC(FieldDescriptorProto) * const* protos, const char* prefix, upb_MessageDef* m, bool* is_sorted) { _upb_DefType_CheckPadding(sizeof(upb_FieldDef)); upb_FieldDef* defs = @@ -8544,11 +9070,9 @@ upb_FieldDef* _upb_FieldDefs_New( static void resolve_subdef(upb_DefBuilder* ctx, const char* prefix, upb_FieldDef* f) { - const google_protobuf_FieldDescriptorProto* field_proto = f->sub.unresolved; - upb_StringView name = - google_protobuf_FieldDescriptorProto_type_name(field_proto); - bool has_name = - google_protobuf_FieldDescriptorProto_has_type_name(field_proto); + const UPB_DESC(FieldDescriptorProto)* field_proto = f->sub.unresolved; + upb_StringView name = UPB_DESC(FieldDescriptorProto_type_name)(field_proto); + bool has_name = UPB_DESC(FieldDescriptorProto_has_type_name)(field_proto); switch ((int)f->type_) { case UPB_FIELD_TYPE_UNSPECIFIED: { // Type was not specified and must be inferred. @@ -8633,13 +9157,14 @@ bool upb_FieldDef_MiniDescriptorEncode(const upb_FieldDef* f, upb_Arena* a, static void resolve_extension(upb_DefBuilder* ctx, const char* prefix, upb_FieldDef* f, - const google_protobuf_FieldDescriptorProto* field_proto) { - if (!google_protobuf_FieldDescriptorProto_has_extendee(field_proto)) { + const UPB_DESC(FieldDescriptorProto) * + field_proto) { + if (!UPB_DESC(FieldDescriptorProto_has_extendee)(field_proto)) { _upb_DefBuilder_Errf(ctx, "extension for field '%s' had no extendee", f->full_name); } - upb_StringView name = google_protobuf_FieldDescriptorProto_extendee(field_proto); + upb_StringView name = UPB_DESC(FieldDescriptorProto_extendee)(field_proto); const upb_MessageDef* m = _upb_DefBuilder_Resolve(ctx, f->full_name, prefix, name, UPB_DEFTYPE_MSG); f->msgdef = m; @@ -8679,12 +9204,13 @@ static void resolve_extension(upb_DefBuilder* ctx, const char* prefix, } static void resolve_default(upb_DefBuilder* ctx, upb_FieldDef* f, - const google_protobuf_FieldDescriptorProto* field_proto) { + const UPB_DESC(FieldDescriptorProto) * + field_proto) { // Have to delay resolving of the default value until now because of the enum // case, since enum defaults are specified with a label. - if (google_protobuf_FieldDescriptorProto_has_default_value(field_proto)) { + if (UPB_DESC(FieldDescriptorProto_has_default_value)(field_proto)) { upb_StringView defaultval = - google_protobuf_FieldDescriptorProto_default_value(field_proto); + UPB_DESC(FieldDescriptorProto_default_value)(field_proto); if (upb_FileDef_Syntax(f->file) == kUpb_Syntax_Proto3) { _upb_DefBuilder_Errf(ctx, @@ -8709,7 +9235,7 @@ static void resolve_default(upb_DefBuilder* ctx, upb_FieldDef* f, void _upb_FieldDef_Resolve(upb_DefBuilder* ctx, const char* prefix, upb_FieldDef* f) { // We have to stash this away since resolve_subdef() may overwrite it. - const google_protobuf_FieldDescriptorProto* field_proto = f->sub.unresolved; + const UPB_DESC(FieldDescriptorProto)* field_proto = f->sub.unresolved; resolve_subdef(ctx, prefix, f); resolve_default(ctx, f, field_proto); @@ -8723,7 +9249,7 @@ void _upb_FieldDef_Resolve(upb_DefBuilder* ctx, const char* prefix, // Must be last. struct upb_FileDef { - const google_protobuf_FileOptions* opts; + const UPB_DESC(FileOptions) * opts; const char* name; const char* package; @@ -8748,7 +9274,7 @@ struct upb_FileDef { upb_Syntax syntax; }; -const google_protobuf_FileOptions* upb_FileDef_Options(const upb_FileDef* f) { +const UPB_DESC(FileOptions) * upb_FileDef_Options(const upb_FileDef* f) { return f->opts; } @@ -8850,13 +9376,13 @@ static bool streql_view(upb_StringView view, const char* b) { return view.size == strlen(b) && memcmp(view.data, b, view.size) == 0; } -static int count_exts_in_msg(const google_protobuf_DescriptorProto* msg_proto) { +static int count_exts_in_msg(const UPB_DESC(DescriptorProto) * msg_proto) { size_t n; - google_protobuf_DescriptorProto_extension(msg_proto, &n); + UPB_DESC(DescriptorProto_extension)(msg_proto, &n); int ext_count = n; - const google_protobuf_DescriptorProto* const* nested_msgs = - google_protobuf_DescriptorProto_nested_type(msg_proto, &n); + const UPB_DESC(DescriptorProto)* const* nested_msgs = + UPB_DESC(DescriptorProto_nested_type)(msg_proto, &n); for (size_t i = 0; i < n; i++) { ext_count += count_exts_in_msg(nested_msgs[i]); } @@ -8866,14 +9392,14 @@ static int count_exts_in_msg(const google_protobuf_DescriptorProto* msg_proto) { // Allocate and initialize one file def, and add it to the context object. void _upb_FileDef_Create(upb_DefBuilder* ctx, - const google_protobuf_FileDescriptorProto* file_proto) { + const UPB_DESC(FileDescriptorProto) * file_proto) { upb_FileDef* file = _upb_DefBuilder_Alloc(ctx, sizeof(upb_FileDef)); ctx->file = file; - const google_protobuf_DescriptorProto* const* msgs; - const google_protobuf_EnumDescriptorProto* const* enums; - const google_protobuf_FieldDescriptorProto* const* exts; - const google_protobuf_ServiceDescriptorProto* const* services; + const UPB_DESC(DescriptorProto)* const* msgs; + const UPB_DESC(EnumDescriptorProto)* const* enums; + const UPB_DESC(FieldDescriptorProto)* const* exts; + const UPB_DESC(ServiceDescriptorProto)* const* services; const upb_StringView* strs; const int32_t* public_deps; const int32_t* weak_deps; @@ -8882,9 +9408,9 @@ void _upb_FileDef_Create(upb_DefBuilder* ctx, file->symtab = ctx->symtab; // Count all extensions in the file, to build a flat array of layouts. - google_protobuf_FileDescriptorProto_extension(file_proto, &n); + UPB_DESC(FileDescriptorProto_extension)(file_proto, &n); int ext_count = n; - msgs = google_protobuf_FileDescriptorProto_message_type(file_proto, &n); + msgs = UPB_DESC(FileDescriptorProto_message_type)(file_proto, &n); for (int i = 0; i < n; i++) { ext_count += count_exts_in_msg(msgs[i]); } @@ -8909,13 +9435,13 @@ void _upb_FileDef_Create(upb_DefBuilder* ctx, } } - if (!google_protobuf_FileDescriptorProto_has_name(file_proto)) { + if (!UPB_DESC(FileDescriptorProto_has_name)(file_proto)) { _upb_DefBuilder_Errf(ctx, "File has no name"); } - file->name = strviewdup(ctx, google_protobuf_FileDescriptorProto_name(file_proto)); + file->name = strviewdup(ctx, UPB_DESC(FileDescriptorProto_name)(file_proto)); - upb_StringView package = google_protobuf_FileDescriptorProto_package(file_proto); + upb_StringView package = UPB_DESC(FileDescriptorProto_package)(file_proto); if (package.size) { _upb_DefBuilder_CheckIdentFull(ctx, package); file->package = strviewdup(ctx, package); @@ -8923,8 +9449,8 @@ void _upb_FileDef_Create(upb_DefBuilder* ctx, file->package = NULL; } - if (google_protobuf_FileDescriptorProto_has_syntax(file_proto)) { - upb_StringView syntax = google_protobuf_FileDescriptorProto_syntax(file_proto); + if (UPB_DESC(FileDescriptorProto_has_syntax)(file_proto)) { + upb_StringView syntax = UPB_DESC(FileDescriptorProto_syntax)(file_proto); if (streql_view(syntax, "proto2")) { file->syntax = kUpb_Syntax_Proto2; @@ -8942,7 +9468,7 @@ void _upb_FileDef_Create(upb_DefBuilder* ctx, UPB_DEF_SET_OPTIONS(file->opts, FileDescriptorProto, FileOptions, file_proto); // Verify dependencies. - strs = google_protobuf_FileDescriptorProto_dependency(file_proto, &n); + strs = UPB_DESC(FileDescriptorProto_dependency)(file_proto, &n); file->dep_count = n; file->deps = _upb_DefBuilder_Alloc(ctx, sizeof(*file->deps) * n); @@ -8958,7 +9484,7 @@ void _upb_FileDef_Create(upb_DefBuilder* ctx, } } - public_deps = google_protobuf_FileDescriptorProto_public_dependency(file_proto, &n); + public_deps = UPB_DESC(FileDescriptorProto_public_dependency)(file_proto, &n); file->public_dep_count = n; file->public_deps = _upb_DefBuilder_Alloc(ctx, sizeof(*file->public_deps) * n); @@ -8971,7 +9497,7 @@ void _upb_FileDef_Create(upb_DefBuilder* ctx, mutable_public_deps[i] = public_deps[i]; } - weak_deps = google_protobuf_FileDescriptorProto_weak_dependency(file_proto, &n); + weak_deps = UPB_DESC(FileDescriptorProto_weak_dependency)(file_proto, &n); file->weak_dep_count = n; file->weak_deps = _upb_DefBuilder_Alloc(ctx, sizeof(*file->weak_deps) * n); int32_t* mutable_weak_deps = (int32_t*)file->weak_deps; @@ -8984,23 +9510,23 @@ void _upb_FileDef_Create(upb_DefBuilder* ctx, } // Create enums. - enums = google_protobuf_FileDescriptorProto_enum_type(file_proto, &n); + enums = UPB_DESC(FileDescriptorProto_enum_type)(file_proto, &n); file->top_lvl_enum_count = n; file->top_lvl_enums = _upb_EnumDefs_New(ctx, n, enums, NULL); // Create extensions. - exts = google_protobuf_FileDescriptorProto_extension(file_proto, &n); + exts = UPB_DESC(FileDescriptorProto_extension)(file_proto, &n); file->top_lvl_ext_count = n; file->top_lvl_exts = _upb_FieldDefs_New(ctx, n, exts, file->package, NULL, NULL); // Create messages. - msgs = google_protobuf_FileDescriptorProto_message_type(file_proto, &n); + msgs = UPB_DESC(FileDescriptorProto_message_type)(file_proto, &n); file->top_lvl_msg_count = n; file->top_lvl_msgs = _upb_MessageDefs_New(ctx, n, msgs, NULL); // Create services. - services = google_protobuf_FileDescriptorProto_service(file_proto, &n); + services = UPB_DESC(FileDescriptorProto_service)(file_proto, &n); file->service_count = n; file->services = _upb_ServiceDefs_New(ctx, n, services); @@ -9228,7 +9754,7 @@ bool upb_Message_DiscardUnknown(upb_Message* msg, const upb_MessageDef* m, // Must be last. struct upb_MessageDef { - const google_protobuf_MessageOptions* opts; + const UPB_DESC(MessageOptions) * opts; const upb_MiniTable* layout; const upb_FileDef* file; const upb_MessageDef* containing_type; @@ -9325,7 +9851,8 @@ bool _upb_MessageDef_IsValidExtensionNumber(const upb_MessageDef* m, int n) { return false; } -const google_protobuf_MessageOptions* upb_MessageDef_Options(const upb_MessageDef* m) { +const UPB_DESC(MessageOptions) * + upb_MessageDef_Options(const upb_MessageDef* m) { return m->opts; } @@ -9439,6 +9966,10 @@ int upb_MessageDef_OneofCount(const upb_MessageDef* m) { return m->oneof_count; } +int upb_MessageDef_RealOneofCount(const upb_MessageDef* m) { + return m->real_oneof_count; +} + int upb_MessageDef_NestedMessageCount(const upb_MessageDef* m) { return m->nested_msg_count; } @@ -9518,11 +10049,11 @@ const upb_OneofDef* upb_MessageDef_FindOneofByName(const upb_MessageDef* m, } bool upb_MessageDef_IsMapEntry(const upb_MessageDef* m) { - return google_protobuf_MessageOptions_map_entry(m->opts); + return UPB_DESC(MessageOptions_map_entry)(m->opts); } bool upb_MessageDef_IsMessageSet(const upb_MessageDef* m) { - return google_protobuf_MessageOptions_message_set_wire_format(m->opts); + return UPB_DESC(MessageOptions_message_set_wire_format)(m->opts); } static upb_MiniTable* _upb_MessageDef_MakeMiniTable(upb_DefBuilder* ctx, @@ -9534,8 +10065,8 @@ static upb_MiniTable* _upb_MessageDef_MakeMiniTable(upb_DefBuilder* ctx, void** scratch_data = _upb_DefPool_ScratchData(ctx->symtab); size_t* scratch_size = _upb_DefPool_ScratchSize(ctx->symtab); upb_MiniTable* ret = upb_MiniTable_BuildWithBuf( - desc.data, desc.size, kUpb_MiniTablePlatform_Native, ctx->arena, - scratch_data, scratch_size, ctx->status); + desc.data, desc.size, ctx->platform, ctx->arena, scratch_data, + scratch_size, ctx->status); if (!ret) _upb_DefBuilder_FailJmp(ctx); return ret; @@ -9571,7 +10102,7 @@ void _upb_MessageDef_Resolve(upb_DefBuilder* ctx, upb_MessageDef* m) { if (upb_FieldDef_Type(ext) == kUpb_FieldType_Message && upb_FieldDef_Label(ext) == kUpb_Label_Optional && upb_FieldDef_MessageSubDef(ext) == m && - google_protobuf_MessageOptions_message_set_wire_format( + UPB_DESC(MessageOptions_message_set_wire_format)( upb_MessageDef_Options(upb_FieldDef_ContainingType(ext)))) { m->in_message_set = true; } @@ -9740,7 +10271,7 @@ bool upb_MessageDef_MiniDescriptorEncode(const upb_MessageDef* m, upb_Arena* a, if (upb_MessageDef_IsMapEntry(m)) { if (!_upb_MessageDef_EncodeMap(&s, m, a)) return false; - } else if (google_protobuf_MessageOptions_message_set_wire_format(m->opts)) { + } else if (UPB_DESC(MessageOptions_message_set_wire_format)(m->opts)) { if (!_upb_MessageDef_EncodeMessageSet(&s, m, a)) return false; } else { if (!_upb_MessageDef_EncodeMessage(&s, m, a)) return false; @@ -9766,13 +10297,13 @@ static upb_StringView* _upb_ReservedNames_New(upb_DefBuilder* ctx, int n, } static void create_msgdef(upb_DefBuilder* ctx, const char* prefix, - const google_protobuf_DescriptorProto* msg_proto, + const UPB_DESC(DescriptorProto) * msg_proto, const upb_MessageDef* containing_type, upb_MessageDef* m) { - const google_protobuf_OneofDescriptorProto* const* oneofs; - const google_protobuf_FieldDescriptorProto* const* fields; - const google_protobuf_DescriptorProto_ExtensionRange* const* ext_ranges; - const google_protobuf_DescriptorProto_ReservedRange* const* res_ranges; + const UPB_DESC(OneofDescriptorProto)* const* oneofs; + const UPB_DESC(FieldDescriptorProto)* const* fields; + const UPB_DESC(DescriptorProto_ExtensionRange)* const* ext_ranges; + const UPB_DESC(DescriptorProto_ReservedRange)* const* res_ranges; const upb_StringView* res_names; size_t n_oneof, n_field, n_enum, n_ext, n_msg; size_t n_ext_range, n_res_range, n_res_name; @@ -9784,17 +10315,19 @@ static void create_msgdef(upb_DefBuilder* ctx, const char* prefix, m->containing_type = containing_type; m->is_sorted = true; - name = google_protobuf_DescriptorProto_name(msg_proto); + name = UPB_DESC(DescriptorProto_name)(msg_proto); _upb_DefBuilder_CheckIdentNotFull(ctx, name); m->full_name = _upb_DefBuilder_MakeFullName(ctx, prefix, name); _upb_DefBuilder_Add(ctx, m->full_name, _upb_DefType_Pack(m, UPB_DEFTYPE_MSG)); - oneofs = google_protobuf_DescriptorProto_oneof_decl(msg_proto, &n_oneof); - fields = google_protobuf_DescriptorProto_field(msg_proto, &n_field); - ext_ranges = google_protobuf_DescriptorProto_extension_range(msg_proto, &n_ext_range); - res_ranges = google_protobuf_DescriptorProto_reserved_range(msg_proto, &n_res_range); - res_names = google_protobuf_DescriptorProto_reserved_name(msg_proto, &n_res_name); + oneofs = UPB_DESC(DescriptorProto_oneof_decl)(msg_proto, &n_oneof); + fields = UPB_DESC(DescriptorProto_field)(msg_proto, &n_field); + ext_ranges = + UPB_DESC(DescriptorProto_extension_range)(msg_proto, &n_ext_range); + res_ranges = + UPB_DESC(DescriptorProto_reserved_range)(msg_proto, &n_res_range); + res_names = UPB_DESC(DescriptorProto_reserved_name)(msg_proto, &n_res_name); bool ok = upb_inttable_init(&m->itof, ctx->arena); if (!ok) _upb_DefBuilder_OomErr(ctx); @@ -9823,7 +10356,7 @@ static void create_msgdef(upb_DefBuilder* ctx, const char* prefix, _upb_FieldDefs_New(ctx, n_field, fields, m->full_name, m, &m->is_sorted); // Message Sets may not contain fields. - if (UPB_UNLIKELY(google_protobuf_MessageOptions_message_set_wire_format(m->opts))) { + if (UPB_UNLIKELY(UPB_DESC(MessageOptions_message_set_wire_format)(m->opts))) { if (UPB_UNLIKELY(n_field > 0)) { _upb_DefBuilder_Errf(ctx, "invalid message set (%s)", m->full_name); } @@ -9845,25 +10378,25 @@ static void create_msgdef(upb_DefBuilder* ctx, const char* prefix, assign_msg_wellknowntype(m); upb_inttable_compact(&m->itof, ctx->arena); - const google_protobuf_EnumDescriptorProto* const* enums = - google_protobuf_DescriptorProto_enum_type(msg_proto, &n_enum); + const UPB_DESC(EnumDescriptorProto)* const* enums = + UPB_DESC(DescriptorProto_enum_type)(msg_proto, &n_enum); m->nested_enum_count = n_enum; m->nested_enums = _upb_EnumDefs_New(ctx, n_enum, enums, m); - const google_protobuf_FieldDescriptorProto* const* exts = - google_protobuf_DescriptorProto_extension(msg_proto, &n_ext); + const UPB_DESC(FieldDescriptorProto)* const* exts = + UPB_DESC(DescriptorProto_extension)(msg_proto, &n_ext); m->nested_ext_count = n_ext; m->nested_exts = _upb_FieldDefs_New(ctx, n_ext, exts, m->full_name, m, NULL); - const google_protobuf_DescriptorProto* const* msgs = - google_protobuf_DescriptorProto_nested_type(msg_proto, &n_msg); + const UPB_DESC(DescriptorProto)* const* msgs = + UPB_DESC(DescriptorProto_nested_type)(msg_proto, &n_msg); m->nested_msg_count = n_msg; m->nested_msgs = _upb_MessageDefs_New(ctx, n_msg, msgs, m); } // Allocate and initialize an array of |n| message defs. upb_MessageDef* _upb_MessageDefs_New( - upb_DefBuilder* ctx, int n, const google_protobuf_DescriptorProto* const* protos, + upb_DefBuilder* ctx, int n, const UPB_DESC(DescriptorProto) * const* protos, const upb_MessageDef* containing_type) { _upb_DefType_CheckPadding(sizeof(upb_MessageDef)); @@ -9899,14 +10432,15 @@ int32_t upb_MessageReservedRange_End(const upb_MessageReservedRange* r) { upb_MessageReservedRange* _upb_MessageReservedRanges_New( upb_DefBuilder* ctx, int n, - const google_protobuf_DescriptorProto_ReservedRange* const* protos, + const UPB_DESC(DescriptorProto_ReservedRange) * const* protos, const upb_MessageDef* m) { upb_MessageReservedRange* r = _upb_DefBuilder_Alloc(ctx, sizeof(upb_MessageReservedRange) * n); for (int i = 0; i < n; i++) { - const int32_t start = google_protobuf_DescriptorProto_ReservedRange_start(protos[i]); - const int32_t end = google_protobuf_DescriptorProto_ReservedRange_end(protos[i]); + const int32_t start = + UPB_DESC(DescriptorProto_ReservedRange_start)(protos[i]); + const int32_t end = UPB_DESC(DescriptorProto_ReservedRange_end)(protos[i]); const int32_t max = kUpb_MaxFieldNumber + 1; // A full validation would also check that each range is disjoint, and that @@ -9929,7 +10463,7 @@ upb_MessageReservedRange* _upb_MessageReservedRanges_New( // Must be last. struct upb_MethodDef { - const google_protobuf_MethodOptions* opts; + const UPB_DESC(MethodOptions) * opts; upb_ServiceDef* service; const char* full_name; const upb_MessageDef* input_type; @@ -9947,7 +10481,7 @@ const upb_ServiceDef* upb_MethodDef_Service(const upb_MethodDef* m) { return m->service; } -const google_protobuf_MethodOptions* upb_MethodDef_Options(const upb_MethodDef* m) { +const UPB_DESC(MethodOptions) * upb_MethodDef_Options(const upb_MethodDef* m) { return m->opts; } @@ -9982,23 +10516,25 @@ bool upb_MethodDef_ServerStreaming(const upb_MethodDef* m) { } static void create_method(upb_DefBuilder* ctx, - const google_protobuf_MethodDescriptorProto* method_proto, + const UPB_DESC(MethodDescriptorProto) * method_proto, upb_ServiceDef* s, upb_MethodDef* m) { - upb_StringView name = google_protobuf_MethodDescriptorProto_name(method_proto); + upb_StringView name = UPB_DESC(MethodDescriptorProto_name)(method_proto); m->service = s; m->full_name = _upb_DefBuilder_MakeFullName(ctx, upb_ServiceDef_FullName(s), name); m->client_streaming = - google_protobuf_MethodDescriptorProto_client_streaming(method_proto); + UPB_DESC(MethodDescriptorProto_client_streaming)(method_proto); m->server_streaming = - google_protobuf_MethodDescriptorProto_server_streaming(method_proto); + UPB_DESC(MethodDescriptorProto_server_streaming)(method_proto); m->input_type = _upb_DefBuilder_Resolve( ctx, m->full_name, m->full_name, - google_protobuf_MethodDescriptorProto_input_type(method_proto), UPB_DEFTYPE_MSG); + UPB_DESC(MethodDescriptorProto_input_type)(method_proto), + UPB_DEFTYPE_MSG); m->output_type = _upb_DefBuilder_Resolve( ctx, m->full_name, m->full_name, - google_protobuf_MethodDescriptorProto_output_type(method_proto), UPB_DEFTYPE_MSG); + UPB_DESC(MethodDescriptorProto_output_type)(method_proto), + UPB_DEFTYPE_MSG); UPB_DEF_SET_OPTIONS(m->opts, MethodDescriptorProto, MethodOptions, method_proto); @@ -10007,7 +10543,7 @@ static void create_method(upb_DefBuilder* ctx, // Allocate and initialize an array of |n| method defs belonging to |s|. upb_MethodDef* _upb_MethodDefs_New( upb_DefBuilder* ctx, int n, - const google_protobuf_MethodDescriptorProto* const* protos, upb_ServiceDef* s) { + const UPB_DESC(MethodDescriptorProto) * const* protos, upb_ServiceDef* s) { upb_MethodDef* m = _upb_DefBuilder_Alloc(ctx, sizeof(upb_MethodDef) * n); for (int i = 0; i < n; i++) { create_method(ctx, protos[i], s, &m[i]); @@ -10024,7 +10560,7 @@ upb_MethodDef* _upb_MethodDefs_New( // Must be last. struct upb_OneofDef { - const google_protobuf_OneofOptions* opts; + const UPB_DESC(OneofOptions) * opts; const upb_MessageDef* parent; const char* full_name; int field_count; @@ -10041,7 +10577,7 @@ upb_OneofDef* _upb_OneofDef_At(const upb_OneofDef* o, int i) { return (upb_OneofDef*)&o[i]; } -const google_protobuf_OneofOptions* upb_OneofDef_Options(const upb_OneofDef* o) { +const UPB_DESC(OneofOptions) * upb_OneofDef_Options(const upb_OneofDef* o) { return o->opts; } @@ -10147,10 +10683,10 @@ size_t _upb_OneofDefs_Finalize(upb_DefBuilder* ctx, upb_MessageDef* m) { } static void create_oneofdef(upb_DefBuilder* ctx, upb_MessageDef* m, - const google_protobuf_OneofDescriptorProto* oneof_proto, + const UPB_DESC(OneofDescriptorProto) * oneof_proto, const upb_OneofDef* _o) { upb_OneofDef* o = (upb_OneofDef*)_o; - upb_StringView name = google_protobuf_OneofDescriptorProto_name(oneof_proto); + upb_StringView name = UPB_DESC(OneofDescriptorProto_name)(oneof_proto); o->parent = m; o->full_name = @@ -10178,7 +10714,7 @@ static void create_oneofdef(upb_DefBuilder* ctx, upb_MessageDef* m, // Allocate and initialize an array of |n| oneof defs. upb_OneofDef* _upb_OneofDefs_New( upb_DefBuilder* ctx, int n, - const google_protobuf_OneofDescriptorProto* const* protos, upb_MessageDef* m) { + const UPB_DESC(OneofDescriptorProto) * const* protos, upb_MessageDef* m) { _upb_DefType_CheckPadding(sizeof(upb_OneofDef)); upb_OneofDef* o = _upb_DefBuilder_Alloc(ctx, sizeof(upb_OneofDef) * n); @@ -10192,7 +10728,7 @@ upb_OneofDef* _upb_OneofDefs_New( // Must be last. struct upb_ServiceDef { - const google_protobuf_ServiceOptions* opts; + const UPB_DESC(ServiceOptions) * opts; const upb_FileDef* file; const char* full_name; upb_MethodDef* methods; @@ -10204,7 +10740,8 @@ upb_ServiceDef* _upb_ServiceDef_At(const upb_ServiceDef* s, int index) { return (upb_ServiceDef*)&s[index]; } -const google_protobuf_ServiceOptions* upb_ServiceDef_Options(const upb_ServiceDef* s) { +const UPB_DESC(ServiceOptions) * + upb_ServiceDef_Options(const upb_ServiceDef* s) { return s->opts; } @@ -10247,7 +10784,7 @@ const upb_MethodDef* upb_ServiceDef_FindMethodByName(const upb_ServiceDef* s, } static void create_service(upb_DefBuilder* ctx, - const google_protobuf_ServiceDescriptorProto* svc_proto, + const UPB_DESC(ServiceDescriptorProto) * svc_proto, upb_ServiceDef* s) { upb_StringView name; size_t n; @@ -10255,15 +10792,15 @@ static void create_service(upb_DefBuilder* ctx, // Must happen before _upb_DefBuilder_Add() s->file = _upb_DefBuilder_File(ctx); - name = google_protobuf_ServiceDescriptorProto_name(svc_proto); + name = UPB_DESC(ServiceDescriptorProto_name)(svc_proto); _upb_DefBuilder_CheckIdentNotFull(ctx, name); const char* package = _upb_FileDef_RawPackage(s->file); s->full_name = _upb_DefBuilder_MakeFullName(ctx, package, name); _upb_DefBuilder_Add(ctx, s->full_name, _upb_DefType_Pack(s, UPB_DEFTYPE_SERVICE)); - const google_protobuf_MethodDescriptorProto* const* methods = - google_protobuf_ServiceDescriptorProto_method(svc_proto, &n); + const UPB_DESC(MethodDescriptorProto)* const* methods = + UPB_DESC(ServiceDescriptorProto_method)(svc_proto, &n); s->method_count = n; s->methods = _upb_MethodDefs_New(ctx, n, methods, s); @@ -10273,7 +10810,7 @@ static void create_service(upb_DefBuilder* ctx, upb_ServiceDef* _upb_ServiceDefs_New( upb_DefBuilder* ctx, int n, - const google_protobuf_ServiceDescriptorProto* const* protos) { + const UPB_DESC(ServiceDescriptorProto) * const* protos) { _upb_DefType_CheckPadding(sizeof(upb_ServiceDef)); upb_ServiceDef* s = _upb_DefBuilder_Alloc(ctx, sizeof(upb_ServiceDef) * n); @@ -10336,12 +10873,14 @@ static const char* _upb_Decoder_DecodeMessage(upb_Decoder* d, const char* ptr, UPB_NORETURN static void* _upb_Decoder_ErrorJmp(upb_Decoder* d, upb_DecodeStatus status) { assert(status != kUpb_DecodeStatus_Ok); - UPB_LONGJMP(d->err, status); + d->status = status; + UPB_LONGJMP(d->err, 1); } const char* _upb_FastDecoder_ErrorJmp(upb_Decoder* d, int status) { assert(status != kUpb_DecodeStatus_Ok); - UPB_LONGJMP(d->err, status); + d->status = status; + UPB_LONGJMP(d->err, 1); return NULL; } @@ -10619,27 +11158,21 @@ static const char* _upb_Decoder_DecodeFixedPacked( // Note: if/when the decoder supports multi-buffer input, we will need to // handle buffer seams here. if (_upb_IsLittleEndian()) { - memcpy(mem, ptr, val->size); - ptr += val->size; + ptr = upb_EpsCopyInputStream_Copy(&d->input, ptr, mem, val->size); } else { - const char* end = ptr + val->size; + int delta = upb_EpsCopyInputStream_PushLimit(&d->input, ptr, val->size); char* dst = mem; - while (ptr < end) { + while (!_upb_Decoder_IsDone(d, &ptr)) { if (lg2 == 2) { - uint32_t val; - memcpy(&val, ptr, sizeof(val)); - val = _upb_BigEndian_Swap32(val); - memcpy(dst, &val, sizeof(val)); + ptr = upb_WireReader_ReadFixed32(ptr, dst); + dst += 4; } else { UPB_ASSERT(lg2 == 3); - uint64_t val; - memcpy(&val, ptr, sizeof(val)); - val = _upb_BigEndian_Swap64(val); - memcpy(dst, &val, sizeof(val)); + ptr = upb_WireReader_ReadFixed64(ptr, dst); + dst += 8; } - ptr += 1 << lg2; - dst += 1 << lg2; } + upb_EpsCopyInputStream_PopLimit(&d->input, ptr, delta); } return ptr; @@ -11276,21 +11809,17 @@ static const char* _upb_Decoder_DecodeWireValue(upb_Decoder* d, const char* ptr, _upb_Decoder_Munge(field->descriptortype, val); return ptr; case kUpb_WireType_32Bit: - memcpy(&val->uint32_val, ptr, 4); - val->uint32_val = _upb_BigEndian_Swap32(val->uint32_val); *op = kUpb_DecodeOp_Scalar4Byte; if (((1 << field->descriptortype) & kFixed32OkMask) == 0) { *op = kUpb_DecodeOp_UnknownField; } - return ptr + 4; + return upb_WireReader_ReadFixed32(ptr, &val->uint32_val); case kUpb_WireType_64Bit: - memcpy(&val->uint64_val, ptr, 8); - val->uint64_val = _upb_BigEndian_Swap64(val->uint64_val); *op = kUpb_DecodeOp_Scalar8Byte; if (((1 << field->descriptortype) & kFixed64OkMask) == 0) { *op = kUpb_DecodeOp_UnknownField; } - return ptr + 8; + return upb_WireReader_ReadFixed64(ptr, &val->uint64_val); case kUpb_WireType_Delimited: ptr = upb_Decoder_DecodeSize(d, ptr, &val->size); *op = _upb_Decoder_GetDelimitedOp(mt, field); @@ -11522,16 +12051,18 @@ upb_DecodeStatus upb_Decode(const char* buf, size_t size, void* msg, state.arena.last_size = arena->last_size; state.arena.cleanup_metadata = arena->cleanup_metadata; state.arena.parent = arena; + state.status = kUpb_DecodeStatus_Ok; - upb_DecodeStatus status = UPB_SETJMP(state.err); - if (UPB_LIKELY(status == kUpb_DecodeStatus_Ok)) { - status = _upb_Decoder_DecodeTop(&state, buf, msg, l); + if (UPB_SETJMP(state.err) == 0) { + state.status = _upb_Decoder_DecodeTop(&state, buf, msg, l); + } else { + UPB_ASSERT(state.status != kUpb_DecodeStatus_Ok); } arena->head.ptr = state.arena.head.ptr; arena->head.end = state.arena.head.end; arena->cleanup_metadata = state.arena.cleanup_metadata; - return status; + return state.status; } #undef OP_FIXPCK_LG2 @@ -12551,6 +13082,7 @@ static uint64_t encode_zz64(int64_t n) { } typedef struct { + upb_EncodeStatus status; jmp_buf err; upb_Arena* arena; char *buf, *ptr, *limit; @@ -12568,7 +13100,9 @@ static size_t upb_roundup_pow2(size_t bytes) { } UPB_NORETURN static void encode_err(upb_encstate* e, upb_EncodeStatus s) { - UPB_LONGJMP(e->err, s); + UPB_ASSERT(s != kUpb_EncodeStatus_Ok); + e->status = s; + UPB_LONGJMP(e->err, 1); } UPB_NOINLINE @@ -13058,6 +13592,7 @@ upb_EncodeStatus upb_Encode(const void* msg, const upb_MiniTable* l, upb_encstate e; unsigned depth = (unsigned)options >> 16; + e.status = kUpb_EncodeStatus_Ok; e.arena = arena; e.buf = NULL; e.limit = NULL; @@ -13066,13 +13601,11 @@ upb_EncodeStatus upb_Encode(const void* msg, const upb_MiniTable* l, e.options = options; _upb_mapsorter_init(&e.sorter); - upb_EncodeStatus status = UPB_SETJMP(e.err); - // Unfortunately we must continue to perform hackery here because there are // code paths which blindly copy the returned pointer without bothering to // check for errors until much later (b/235839510). So we still set *buf to // NULL on error and we still set it to non-NULL on a successful empty result. - if (status == kUpb_EncodeStatus_Ok) { + if (UPB_SETJMP(e.err) == 0) { encode_message(&e, msg, l, size); *size = e.limit - e.ptr; if (*size == 0) { @@ -13083,12 +13616,13 @@ upb_EncodeStatus upb_Encode(const void* msg, const upb_MiniTable* l, *buf = e.ptr; } } else { + UPB_ASSERT(e.status != kUpb_EncodeStatus_Ok); *buf = NULL; *size = 0; } _upb_mapsorter_destroy(&e.sorter); - return status; + return e.status; } @@ -13112,9 +13646,9 @@ _upb_WireReader_ReadLongVarint(const char* ptr, uint64_t val) { return ret; } -const char* upb_WireReader_SkipGroup(const char* ptr, uint32_t tag, - int depth_limit, - upb_EpsCopyInputStream* stream) { +const char* _upb_WireReader_SkipGroup(const char* ptr, uint32_t tag, + int depth_limit, + upb_EpsCopyInputStream* stream) { if (--depth_limit == 0) return NULL; uint32_t end_group_tag = (tag & ~7ULL) | kUpb_WireType_EndGroup; while (!upb_EpsCopyInputStream_IsDone(stream, &ptr)) { @@ -13122,7 +13656,7 @@ const char* upb_WireReader_SkipGroup(const char* ptr, uint32_t tag, ptr = upb_WireReader_ReadTag(ptr, &tag); if (!ptr) return NULL; if (tag == end_group_tag) return ptr; - ptr = upb_WireReader_SkipValue(ptr, tag, depth_limit, stream); + ptr = _upb_WireReader_SkipValue(ptr, tag, depth_limit, stream); if (!ptr) return NULL; } return ptr; @@ -13159,6 +13693,7 @@ const char* upb_WireReader_SkipGroup(const char* ptr, uint32_t tag, #undef UPB_PTRADD #undef UPB_MUSTTAIL #undef UPB_FASTTABLE_SUPPORTED +#undef UPB_FASTTABLE_MASK #undef UPB_FASTTABLE #undef UPB_FASTTABLE_INIT #undef UPB_POISON_MEMORY_REGION @@ -13167,3 +13702,6 @@ const char* upb_WireReader_SkipGroup(const char* ptr, uint32_t tag, #undef UPB_TREAT_PROTO2_ENUMS_LIKE_PROTO3 #undef UPB_DEPRECATED #undef UPB_GNUC_MIN +#undef UPB_DESCRIPTOR_UPB_H_FILENAME +#undef UPB_DESC +#undef UPB_IS_GOOGLE3 diff --git a/ruby/ext/google/protobuf_c/ruby-upb.h b/ruby/ext/google/protobuf_c/ruby-upb.h index fc0883e213..1849461a76 100755 --- a/ruby/ext/google/protobuf_c/ruby-upb.h +++ b/ruby/ext/google/protobuf_c/ruby-upb.h @@ -87,7 +87,11 @@ #define UPB_ALIGN_UP(size, align) (((size) + (align) - 1) / (align) * (align)) #define UPB_ALIGN_DOWN(size, align) ((size) / (align) * (align)) #define UPB_ALIGN_MALLOC(size) UPB_ALIGN_UP(size, UPB_MALLOC_ALIGN) +#ifdef __clang__ +#define UPB_ALIGN_OF(type) _Alignof(type) +#else #define UPB_ALIGN_OF(type) offsetof (struct { char c; type member; }, member) +#endif // Hints to the compiler about likely/unlikely branches. #if defined (__GNUC__) || defined(__clang__) @@ -220,11 +224,13 @@ #endif /* UPB_FASTTABLE_INIT() allows protos compiled for fasttable to gracefully - * degrade to non-fasttable if we are using UPB_TRY_ENABLE_FASTTABLE. */ -#if !UPB_FASTTABLE && defined(UPB_TRY_ENABLE_FASTTABLE) + * degrade to non-fasttable if the runtime or platform do not support it. */ +#if !UPB_FASTTABLE #define UPB_FASTTABLE_INIT(...) +#define UPB_FASTTABLE_MASK(mask) -1 #else #define UPB_FASTTABLE_INIT(...) __VA_ARGS__ +#define UPB_FASTTABLE_MASK(mask) mask #endif #undef UPB_FASTTABLE_SUPPORTED @@ -280,6 +286,16 @@ void __asan_unpoison_memory_region(void const volatile *addr, size_t size); #define UPB_DEPRECATED #endif +// begin:google_only +// #define UPB_IS_GOOGLE3 +// end:google_only + +#if defined(UPB_IS_GOOGLE3) && !defined(UPB_BOOTSTRAP_STAGE0) +#define UPB_DESC(sym) proto2_##sym +#else +#define UPB_DESC(sym) google_protobuf_##sym +#endif + #ifndef UPB_BASE_STATUS_H_ #define UPB_BASE_STATUS_H_ @@ -2259,8 +2275,10 @@ UPB_API_INLINE const upb_MiniTableEnum* upb_MiniTable_GetSubEnumTable( #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Warray-bounds" #pragma GCC diagnostic ignored "-Wstringop-overflow" +#if __GNUC__ >= 11 #pragma GCC diagnostic ignored "-Wstringop-overread" #endif +#endif #ifdef __cplusplus extern "C" { @@ -2498,7 +2516,7 @@ UPB_INLINE void _upb_Message_ClearNonExtensionField( field); } -UPB_INLINE upb_Map* _upb_MiniTable_GetOrCreateMutableMap( +UPB_INLINE upb_Map* _upb_Message_GetOrCreateMutableMap( upb_Message* msg, const upb_MiniTableField* field, size_t key_size, size_t val_size, upb_Arena* arena) { _upb_MiniTableField_CheckIsMap(field); @@ -2609,7 +2627,7 @@ UPB_API_INLINE bool upb_Message_SetUInt32(upb_Message* msg, return _upb_Message_SetField(msg, field, &value, a); } -UPB_API_INLINE void upb_MiniTable_SetEnumProto2( +UPB_API_INLINE void upb_Message_SetEnumProto2( upb_Message* msg, const upb_MiniTable* msg_mini_table, const upb_MiniTableField* field, int32_t value) { UPB_ASSERT(field->descriptortype == kUpb_FieldType_Enum); @@ -2728,7 +2746,7 @@ UPB_API_INLINE bool upb_Message_SetString(upb_Message* msg, return _upb_Message_SetField(msg, field, &value, a); } -UPB_API_INLINE const upb_Message* upb_MiniTable_GetMessage( +UPB_API_INLINE const upb_Message* upb_Message_GetMessage( const upb_Message* msg, const upb_MiniTableField* field, upb_Message* default_val) { UPB_ASSERT(field->descriptortype == kUpb_FieldType_Message || @@ -2741,10 +2759,10 @@ UPB_API_INLINE const upb_Message* upb_MiniTable_GetMessage( return ret; } -UPB_API_INLINE void upb_MiniTable_SetMessage(upb_Message* msg, - const upb_MiniTable* mini_table, - const upb_MiniTableField* field, - upb_Message* sub_message) { +UPB_API_INLINE void upb_Message_SetMessage(upb_Message* msg, + const upb_MiniTable* mini_table, + const upb_MiniTableField* field, + upb_Message* sub_message) { UPB_ASSERT(field->descriptortype == kUpb_FieldType_Message || field->descriptortype == kUpb_FieldType_Group); UPB_ASSUME(!upb_IsRepeatedOrMap(field)); @@ -2754,7 +2772,7 @@ UPB_API_INLINE void upb_MiniTable_SetMessage(upb_Message* msg, _upb_Message_SetNonExtensionField(msg, field, &sub_message); } -UPB_API_INLINE upb_Message* upb_MiniTable_GetMutableMessage( +UPB_API_INLINE upb_Message* upb_Message_GetOrCreateMutableMessage( upb_Message* msg, const upb_MiniTable* mini_table, const upb_MiniTableField* field, upb_Arena* arena) { UPB_ASSERT(field->descriptortype == kUpb_FieldType_Message || @@ -2834,8 +2852,7 @@ UPB_API_INLINE const upb_Map* upb_Message_GetMap( return ret; } -// TODO: rename to GetOrCreateMutableMap -UPB_API_INLINE upb_Map* upb_MiniTable_GetMutableMap( +UPB_API_INLINE upb_Map* upb_Message_GetOrCreateMutableMap( upb_Message* msg, const upb_MiniTable* map_entry_mini_table, const upb_MiniTableField* field, upb_Arena* arena) { UPB_ASSERT(field->descriptortype == kUpb_FieldType_Message || @@ -2844,7 +2861,7 @@ UPB_API_INLINE upb_Map* upb_MiniTable_GetMutableMap( &map_entry_mini_table->fields[0]; const upb_MiniTableField* map_entry_value_field = &map_entry_mini_table->fields[1]; - return _upb_MiniTable_GetOrCreateMutableMap( + return _upb_Message_GetOrCreateMutableMap( msg, field, _upb_Map_CTypeSize(upb_MiniTableField_CType(map_entry_key_field)), _upb_Map_CTypeSize(upb_MiniTableField_CType(map_entry_value_field)), @@ -2924,7 +2941,7 @@ typedef struct { // Promotes unknown data inside message to a upb_Message parsing the unknown. // // The unknown data is removed from message after field value is set -// using upb_MiniTable_SetMessage. +// using upb_Message_SetMessage. upb_UnknownToMessageRet upb_MiniTable_PromoteUnknownToMessage( upb_Message* msg, const upb_MiniTable* mini_table, const upb_MiniTableField* field, const upb_MiniTable* sub_mini_table, @@ -3211,6 +3228,7 @@ upb_EncodeStatus upb_Encode(const void* msg, const upb_MiniTable* l, #endif /* UPB_WIRE_ENCODE_H_ */ +// Must be last. #ifdef __cplusplus extern "C" { @@ -3271,12 +3289,6 @@ extern const upb_MiniTable google_protobuf_SourceCodeInfo_Location_msg_init; extern const upb_MiniTable google_protobuf_GeneratedCodeInfo_msg_init; extern const upb_MiniTable google_protobuf_GeneratedCodeInfo_Annotation_msg_init; -typedef enum { - google_protobuf_FieldDescriptorProto_LABEL_OPTIONAL = 1, - google_protobuf_FieldDescriptorProto_LABEL_REQUIRED = 2, - google_protobuf_FieldDescriptorProto_LABEL_REPEATED = 3 -} google_protobuf_FieldDescriptorProto_Label; - typedef enum { google_protobuf_FieldDescriptorProto_TYPE_DOUBLE = 1, google_protobuf_FieldDescriptorProto_TYPE_FLOAT = 2, @@ -3298,6 +3310,18 @@ typedef enum { google_protobuf_FieldDescriptorProto_TYPE_SINT64 = 18 } google_protobuf_FieldDescriptorProto_Type; +typedef enum { + google_protobuf_FieldDescriptorProto_LABEL_OPTIONAL = 1, + google_protobuf_FieldDescriptorProto_LABEL_REQUIRED = 2, + google_protobuf_FieldDescriptorProto_LABEL_REPEATED = 3 +} google_protobuf_FieldDescriptorProto_Label; + +typedef enum { + google_protobuf_FileOptions_SPEED = 1, + google_protobuf_FileOptions_CODE_SIZE = 2, + google_protobuf_FileOptions_LITE_RUNTIME = 3 +} google_protobuf_FileOptions_OptimizeMode; + typedef enum { google_protobuf_FieldOptions_STRING = 0, google_protobuf_FieldOptions_CORD = 1, @@ -3311,10 +3335,10 @@ typedef enum { } google_protobuf_FieldOptions_JSType; typedef enum { - google_protobuf_FileOptions_SPEED = 1, - google_protobuf_FileOptions_CODE_SIZE = 2, - google_protobuf_FileOptions_LITE_RUNTIME = 3 -} google_protobuf_FileOptions_OptimizeMode; + google_protobuf_MethodOptions_IDEMPOTENCY_UNKNOWN = 0, + google_protobuf_MethodOptions_NO_SIDE_EFFECTS = 1, + google_protobuf_MethodOptions_IDEMPOTENT = 2 +} google_protobuf_MethodOptions_IdempotencyLevel; typedef enum { google_protobuf_GeneratedCodeInfo_Annotation_NONE = 0, @@ -3322,20 +3346,14 @@ typedef enum { google_protobuf_GeneratedCodeInfo_Annotation_ALIAS = 2 } google_protobuf_GeneratedCodeInfo_Annotation_Semantic; -typedef enum { - google_protobuf_MethodOptions_IDEMPOTENCY_UNKNOWN = 0, - google_protobuf_MethodOptions_NO_SIDE_EFFECTS = 1, - google_protobuf_MethodOptions_IDEMPOTENT = 2 -} google_protobuf_MethodOptions_IdempotencyLevel; - -extern const upb_MiniTableEnum google_protobuf_FieldDescriptorProto_Label_enum_init; extern const upb_MiniTableEnum google_protobuf_FieldDescriptorProto_Type_enum_init; +extern const upb_MiniTableEnum google_protobuf_FieldDescriptorProto_Label_enum_init; +extern const upb_MiniTableEnum google_protobuf_FileOptions_OptimizeMode_enum_init; extern const upb_MiniTableEnum google_protobuf_FieldOptions_CType_enum_init; extern const upb_MiniTableEnum google_protobuf_FieldOptions_JSType_enum_init; -extern const upb_MiniTableEnum google_protobuf_FileOptions_OptimizeMode_enum_init; -extern const upb_MiniTableEnum google_protobuf_GeneratedCodeInfo_Annotation_Semantic_enum_init; extern const upb_MiniTableEnum google_protobuf_MethodOptions_IdempotencyLevel_enum_init; +extern const upb_MiniTableEnum google_protobuf_GeneratedCodeInfo_Annotation_Semantic_enum_init; /* google.protobuf.FileDescriptorSet */ @@ -3689,10 +3707,12 @@ UPB_INLINE bool google_protobuf_FileDescriptorProto_has_edition(const google_pro UPB_INLINE void google_protobuf_FileDescriptorProto_set_name(google_protobuf_FileDescriptorProto *msg, upb_StringView value) { const upb_MiniTableField field = {1, UPB_SIZE(40, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FileDescriptorProto_set_package(google_protobuf_FileDescriptorProto *msg, upb_StringView value) { +} +UPB_INLINE void google_protobuf_FileDescriptorProto_set_package(google_protobuf_FileDescriptorProto *msg, upb_StringView value) { const upb_MiniTableField field = {2, UPB_SIZE(48, 24), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE upb_StringView* google_protobuf_FileDescriptorProto_mutable_dependency(google_protobuf_FileDescriptorProto* msg, size_t* size) { +} +UPB_INLINE upb_StringView* google_protobuf_FileDescriptorProto_mutable_dependency(google_protobuf_FileDescriptorProto* msg, size_t* size) { upb_MiniTableField field = {3, UPB_SIZE(4, 40), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { @@ -3823,7 +3843,8 @@ UPB_INLINE struct google_protobuf_FieldDescriptorProto* google_protobuf_FileDesc UPB_INLINE void google_protobuf_FileDescriptorProto_set_options(google_protobuf_FileDescriptorProto *msg, google_protobuf_FileOptions* value) { const upb_MiniTableField field = {8, UPB_SIZE(24, 80), 3, 4, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE struct google_protobuf_FileOptions* google_protobuf_FileDescriptorProto_mutable_options(google_protobuf_FileDescriptorProto* msg, upb_Arena* arena) { +} +UPB_INLINE struct google_protobuf_FileOptions* google_protobuf_FileDescriptorProto_mutable_options(google_protobuf_FileDescriptorProto* msg, upb_Arena* arena) { struct google_protobuf_FileOptions* sub = (struct google_protobuf_FileOptions*)google_protobuf_FileDescriptorProto_options(msg); if (sub == NULL) { sub = (struct google_protobuf_FileOptions*)_upb_Message_New(&google_protobuf_FileOptions_msg_init, arena); @@ -3834,7 +3855,8 @@ UPB_INLINE void google_protobuf_FileDescriptorProto_set_options(google_protobuf_ UPB_INLINE void google_protobuf_FileDescriptorProto_set_source_code_info(google_protobuf_FileDescriptorProto *msg, google_protobuf_SourceCodeInfo* value) { const upb_MiniTableField field = {9, UPB_SIZE(28, 88), 4, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE struct google_protobuf_SourceCodeInfo* google_protobuf_FileDescriptorProto_mutable_source_code_info(google_protobuf_FileDescriptorProto* msg, upb_Arena* arena) { +} +UPB_INLINE struct google_protobuf_SourceCodeInfo* google_protobuf_FileDescriptorProto_mutable_source_code_info(google_protobuf_FileDescriptorProto* msg, upb_Arena* arena) { struct google_protobuf_SourceCodeInfo* sub = (struct google_protobuf_SourceCodeInfo*)google_protobuf_FileDescriptorProto_source_code_info(msg); if (sub == NULL) { sub = (struct google_protobuf_SourceCodeInfo*)_upb_Message_New(&google_protobuf_SourceCodeInfo_msg_init, arena); @@ -3893,10 +3915,12 @@ UPB_INLINE bool google_protobuf_FileDescriptorProto_add_weak_dependency(google_p UPB_INLINE void google_protobuf_FileDescriptorProto_set_syntax(google_protobuf_FileDescriptorProto *msg, upb_StringView value) { const upb_MiniTableField field = {12, UPB_SIZE(56, 112), 5, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FileDescriptorProto_set_edition(google_protobuf_FileDescriptorProto *msg, upb_StringView value) { +} +UPB_INLINE void google_protobuf_FileDescriptorProto_set_edition(google_protobuf_FileDescriptorProto *msg, upb_StringView value) { const upb_MiniTableField field = {13, UPB_SIZE(64, 128), 6, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); } + /* google.protobuf.DescriptorProto */ UPB_INLINE google_protobuf_DescriptorProto* google_protobuf_DescriptorProto_new(upb_Arena* arena) { @@ -4126,7 +4150,8 @@ UPB_INLINE bool google_protobuf_DescriptorProto_has_reserved_name(const google_p UPB_INLINE void google_protobuf_DescriptorProto_set_name(google_protobuf_DescriptorProto *msg, upb_StringView value) { const upb_MiniTableField field = {1, UPB_SIZE(40, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProto_mutable_field(google_protobuf_DescriptorProto* msg, size_t* size) { +} +UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProto_mutable_field(google_protobuf_DescriptorProto* msg, size_t* size) { upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { @@ -4259,7 +4284,8 @@ UPB_INLINE struct google_protobuf_FieldDescriptorProto* google_protobuf_Descript UPB_INLINE void google_protobuf_DescriptorProto_set_options(google_protobuf_DescriptorProto *msg, google_protobuf_MessageOptions* value) { const upb_MiniTableField field = {7, UPB_SIZE(24, 64), 2, 5, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE struct google_protobuf_MessageOptions* google_protobuf_DescriptorProto_mutable_options(google_protobuf_DescriptorProto* msg, upb_Arena* arena) { +} +UPB_INLINE struct google_protobuf_MessageOptions* google_protobuf_DescriptorProto_mutable_options(google_protobuf_DescriptorProto* msg, upb_Arena* arena) { struct google_protobuf_MessageOptions* sub = (struct google_protobuf_MessageOptions*)google_protobuf_DescriptorProto_options(msg); if (sub == NULL) { sub = (struct google_protobuf_MessageOptions*)_upb_Message_New(&google_protobuf_MessageOptions_msg_init, arena); @@ -4428,13 +4454,16 @@ UPB_INLINE bool google_protobuf_DescriptorProto_ExtensionRange_has_options(const UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_set_start(google_protobuf_DescriptorProto_ExtensionRange *msg, int32_t value) { const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_set_end(google_protobuf_DescriptorProto_ExtensionRange *msg, int32_t value) { +} +UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_set_end(google_protobuf_DescriptorProto_ExtensionRange *msg, int32_t value) { const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_set_options(google_protobuf_DescriptorProto_ExtensionRange *msg, google_protobuf_ExtensionRangeOptions* value) { +} +UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_set_options(google_protobuf_DescriptorProto_ExtensionRange *msg, google_protobuf_ExtensionRangeOptions* value) { const upb_MiniTableField field = {3, UPB_SIZE(12, 16), 3, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE struct google_protobuf_ExtensionRangeOptions* google_protobuf_DescriptorProto_ExtensionRange_mutable_options(google_protobuf_DescriptorProto_ExtensionRange* msg, upb_Arena* arena) { +} +UPB_INLINE struct google_protobuf_ExtensionRangeOptions* google_protobuf_DescriptorProto_ExtensionRange_mutable_options(google_protobuf_DescriptorProto_ExtensionRange* msg, upb_Arena* arena) { struct google_protobuf_ExtensionRangeOptions* sub = (struct google_protobuf_ExtensionRangeOptions*)google_protobuf_DescriptorProto_ExtensionRange_options(msg); if (sub == NULL) { sub = (struct google_protobuf_ExtensionRangeOptions*)_upb_Message_New(&google_protobuf_ExtensionRangeOptions_msg_init, arena); @@ -4512,10 +4541,12 @@ UPB_INLINE bool google_protobuf_DescriptorProto_ReservedRange_has_end(const goog UPB_INLINE void google_protobuf_DescriptorProto_ReservedRange_set_start(google_protobuf_DescriptorProto_ReservedRange *msg, int32_t value) { const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_DescriptorProto_ReservedRange_set_end(google_protobuf_DescriptorProto_ReservedRange *msg, int32_t value) { +} +UPB_INLINE void google_protobuf_DescriptorProto_ReservedRange_set_end(google_protobuf_DescriptorProto_ReservedRange *msg, int32_t value) { const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); } + /* google.protobuf.ExtensionRangeOptions */ UPB_INLINE google_protobuf_ExtensionRangeOptions* google_protobuf_ExtensionRangeOptions_new(upb_Arena* arena) { @@ -4803,28 +4834,36 @@ UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_proto3_optional(const g UPB_INLINE void google_protobuf_FieldDescriptorProto_set_name(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) { const upb_MiniTableField field = {1, UPB_SIZE(28, 24), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FieldDescriptorProto_set_extendee(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) { +} +UPB_INLINE void google_protobuf_FieldDescriptorProto_set_extendee(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) { const upb_MiniTableField field = {2, UPB_SIZE(36, 40), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FieldDescriptorProto_set_number(google_protobuf_FieldDescriptorProto *msg, int32_t value) { +} +UPB_INLINE void google_protobuf_FieldDescriptorProto_set_number(google_protobuf_FieldDescriptorProto *msg, int32_t value) { const upb_MiniTableField field = {3, 4, 3, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FieldDescriptorProto_set_label(google_protobuf_FieldDescriptorProto *msg, int32_t value) { +} +UPB_INLINE void google_protobuf_FieldDescriptorProto_set_label(google_protobuf_FieldDescriptorProto *msg, int32_t value) { const upb_MiniTableField field = {4, 8, 4, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FieldDescriptorProto_set_type(google_protobuf_FieldDescriptorProto *msg, int32_t value) { +} +UPB_INLINE void google_protobuf_FieldDescriptorProto_set_type(google_protobuf_FieldDescriptorProto *msg, int32_t value) { const upb_MiniTableField field = {5, 12, 5, 1, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FieldDescriptorProto_set_type_name(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) { +} +UPB_INLINE void google_protobuf_FieldDescriptorProto_set_type_name(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) { const upb_MiniTableField field = {6, UPB_SIZE(44, 56), 6, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FieldDescriptorProto_set_default_value(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) { +} +UPB_INLINE void google_protobuf_FieldDescriptorProto_set_default_value(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) { const upb_MiniTableField field = {7, UPB_SIZE(52, 72), 7, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FieldDescriptorProto_set_options(google_protobuf_FieldDescriptorProto *msg, google_protobuf_FieldOptions* value) { +} +UPB_INLINE void google_protobuf_FieldDescriptorProto_set_options(google_protobuf_FieldDescriptorProto *msg, google_protobuf_FieldOptions* value) { const upb_MiniTableField field = {8, UPB_SIZE(16, 88), 8, 2, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE struct google_protobuf_FieldOptions* google_protobuf_FieldDescriptorProto_mutable_options(google_protobuf_FieldDescriptorProto* msg, upb_Arena* arena) { +} +UPB_INLINE struct google_protobuf_FieldOptions* google_protobuf_FieldDescriptorProto_mutable_options(google_protobuf_FieldDescriptorProto* msg, upb_Arena* arena) { struct google_protobuf_FieldOptions* sub = (struct google_protobuf_FieldOptions*)google_protobuf_FieldDescriptorProto_options(msg); if (sub == NULL) { sub = (struct google_protobuf_FieldOptions*)_upb_Message_New(&google_protobuf_FieldOptions_msg_init, arena); @@ -4835,13 +4874,16 @@ UPB_INLINE void google_protobuf_FieldDescriptorProto_set_name(google_protobuf_Fi UPB_INLINE void google_protobuf_FieldDescriptorProto_set_oneof_index(google_protobuf_FieldDescriptorProto *msg, int32_t value) { const upb_MiniTableField field = {9, UPB_SIZE(20, 16), 9, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FieldDescriptorProto_set_json_name(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) { +} +UPB_INLINE void google_protobuf_FieldDescriptorProto_set_json_name(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) { const upb_MiniTableField field = {10, UPB_SIZE(60, 96), 10, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FieldDescriptorProto_set_proto3_optional(google_protobuf_FieldDescriptorProto *msg, bool value) { +} +UPB_INLINE void google_protobuf_FieldDescriptorProto_set_proto3_optional(google_protobuf_FieldDescriptorProto *msg, bool value) { const upb_MiniTableField field = {17, UPB_SIZE(24, 20), 11, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); } + /* google.protobuf.OneofDescriptorProto */ UPB_INLINE google_protobuf_OneofDescriptorProto* google_protobuf_OneofDescriptorProto_new(upb_Arena* arena) { @@ -4911,10 +4953,12 @@ UPB_INLINE bool google_protobuf_OneofDescriptorProto_has_options(const google_pr UPB_INLINE void google_protobuf_OneofDescriptorProto_set_name(google_protobuf_OneofDescriptorProto *msg, upb_StringView value) { const upb_MiniTableField field = {1, 8, 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_OneofDescriptorProto_set_options(google_protobuf_OneofDescriptorProto *msg, google_protobuf_OneofOptions* value) { +} +UPB_INLINE void google_protobuf_OneofDescriptorProto_set_options(google_protobuf_OneofDescriptorProto *msg, google_protobuf_OneofOptions* value) { const upb_MiniTableField field = {2, UPB_SIZE(4, 24), 2, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE struct google_protobuf_OneofOptions* google_protobuf_OneofDescriptorProto_mutable_options(google_protobuf_OneofDescriptorProto* msg, upb_Arena* arena) { +} +UPB_INLINE struct google_protobuf_OneofOptions* google_protobuf_OneofDescriptorProto_mutable_options(google_protobuf_OneofDescriptorProto* msg, upb_Arena* arena) { struct google_protobuf_OneofOptions* sub = (struct google_protobuf_OneofOptions*)google_protobuf_OneofDescriptorProto_options(msg); if (sub == NULL) { sub = (struct google_protobuf_OneofOptions*)_upb_Message_New(&google_protobuf_OneofOptions_msg_init, arena); @@ -5052,7 +5096,8 @@ UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_reserved_name(const goog UPB_INLINE void google_protobuf_EnumDescriptorProto_set_name(google_protobuf_EnumDescriptorProto *msg, upb_StringView value) { const upb_MiniTableField field = {1, UPB_SIZE(20, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE google_protobuf_EnumValueDescriptorProto** google_protobuf_EnumDescriptorProto_mutable_value(google_protobuf_EnumDescriptorProto* msg, size_t* size) { +} +UPB_INLINE google_protobuf_EnumValueDescriptorProto** google_protobuf_EnumDescriptorProto_mutable_value(google_protobuf_EnumDescriptorProto* msg, size_t* size) { upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { @@ -5081,7 +5126,8 @@ UPB_INLINE struct google_protobuf_EnumValueDescriptorProto* google_protobuf_Enum UPB_INLINE void google_protobuf_EnumDescriptorProto_set_options(google_protobuf_EnumDescriptorProto *msg, google_protobuf_EnumOptions* value) { const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE struct google_protobuf_EnumOptions* google_protobuf_EnumDescriptorProto_mutable_options(google_protobuf_EnumDescriptorProto* msg, upb_Arena* arena) { +} +UPB_INLINE struct google_protobuf_EnumOptions* google_protobuf_EnumDescriptorProto_mutable_options(google_protobuf_EnumDescriptorProto* msg, upb_Arena* arena) { struct google_protobuf_EnumOptions* sub = (struct google_protobuf_EnumOptions*)google_protobuf_EnumDescriptorProto_options(msg); if (sub == NULL) { sub = (struct google_protobuf_EnumOptions*)_upb_Message_New(&google_protobuf_EnumOptions_msg_init, arena); @@ -5209,10 +5255,12 @@ UPB_INLINE bool google_protobuf_EnumDescriptorProto_EnumReservedRange_has_end(co UPB_INLINE void google_protobuf_EnumDescriptorProto_EnumReservedRange_set_start(google_protobuf_EnumDescriptorProto_EnumReservedRange *msg, int32_t value) { const upb_MiniTableField field = {1, 4, 1, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_EnumDescriptorProto_EnumReservedRange_set_end(google_protobuf_EnumDescriptorProto_EnumReservedRange *msg, int32_t value) { +} +UPB_INLINE void google_protobuf_EnumDescriptorProto_EnumReservedRange_set_end(google_protobuf_EnumDescriptorProto_EnumReservedRange *msg, int32_t value) { const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); } + /* google.protobuf.EnumValueDescriptorProto */ UPB_INLINE google_protobuf_EnumValueDescriptorProto* google_protobuf_EnumValueDescriptorProto_new(upb_Arena* arena) { @@ -5297,13 +5345,16 @@ UPB_INLINE bool google_protobuf_EnumValueDescriptorProto_has_options(const googl UPB_INLINE void google_protobuf_EnumValueDescriptorProto_set_name(google_protobuf_EnumValueDescriptorProto *msg, upb_StringView value) { const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_EnumValueDescriptorProto_set_number(google_protobuf_EnumValueDescriptorProto *msg, int32_t value) { +} +UPB_INLINE void google_protobuf_EnumValueDescriptorProto_set_number(google_protobuf_EnumValueDescriptorProto *msg, int32_t value) { const upb_MiniTableField field = {2, 4, 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_EnumValueDescriptorProto_set_options(google_protobuf_EnumValueDescriptorProto *msg, google_protobuf_EnumValueOptions* value) { +} +UPB_INLINE void google_protobuf_EnumValueDescriptorProto_set_options(google_protobuf_EnumValueDescriptorProto *msg, google_protobuf_EnumValueOptions* value) { const upb_MiniTableField field = {3, UPB_SIZE(8, 24), 3, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE struct google_protobuf_EnumValueOptions* google_protobuf_EnumValueDescriptorProto_mutable_options(google_protobuf_EnumValueDescriptorProto* msg, upb_Arena* arena) { +} +UPB_INLINE struct google_protobuf_EnumValueOptions* google_protobuf_EnumValueDescriptorProto_mutable_options(google_protobuf_EnumValueDescriptorProto* msg, upb_Arena* arena) { struct google_protobuf_EnumValueOptions* sub = (struct google_protobuf_EnumValueOptions*)google_protobuf_EnumValueDescriptorProto_options(msg); if (sub == NULL) { sub = (struct google_protobuf_EnumValueOptions*)_upb_Message_New(&google_protobuf_EnumValueOptions_msg_init, arena); @@ -5401,7 +5452,8 @@ UPB_INLINE bool google_protobuf_ServiceDescriptorProto_has_options(const google_ UPB_INLINE void google_protobuf_ServiceDescriptorProto_set_name(google_protobuf_ServiceDescriptorProto *msg, upb_StringView value) { const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE google_protobuf_MethodDescriptorProto** google_protobuf_ServiceDescriptorProto_mutable_method(google_protobuf_ServiceDescriptorProto* msg, size_t* size) { +} +UPB_INLINE google_protobuf_MethodDescriptorProto** google_protobuf_ServiceDescriptorProto_mutable_method(google_protobuf_ServiceDescriptorProto* msg, size_t* size) { upb_MiniTableField field = {2, UPB_SIZE(4, 24), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { @@ -5430,7 +5482,8 @@ UPB_INLINE struct google_protobuf_MethodDescriptorProto* google_protobuf_Service UPB_INLINE void google_protobuf_ServiceDescriptorProto_set_options(google_protobuf_ServiceDescriptorProto *msg, google_protobuf_ServiceOptions* value) { const upb_MiniTableField field = {3, UPB_SIZE(8, 32), 2, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE struct google_protobuf_ServiceOptions* google_protobuf_ServiceDescriptorProto_mutable_options(google_protobuf_ServiceDescriptorProto* msg, upb_Arena* arena) { +} +UPB_INLINE struct google_protobuf_ServiceOptions* google_protobuf_ServiceDescriptorProto_mutable_options(google_protobuf_ServiceDescriptorProto* msg, upb_Arena* arena) { struct google_protobuf_ServiceOptions* sub = (struct google_protobuf_ServiceOptions*)google_protobuf_ServiceDescriptorProto_options(msg); if (sub == NULL) { sub = (struct google_protobuf_ServiceOptions*)_upb_Message_New(&google_protobuf_ServiceOptions_msg_init, arena); @@ -5568,16 +5621,20 @@ UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_server_streaming(const UPB_INLINE void google_protobuf_MethodDescriptorProto_set_name(google_protobuf_MethodDescriptorProto *msg, upb_StringView value) { const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_MethodDescriptorProto_set_input_type(google_protobuf_MethodDescriptorProto *msg, upb_StringView value) { +} +UPB_INLINE void google_protobuf_MethodDescriptorProto_set_input_type(google_protobuf_MethodDescriptorProto *msg, upb_StringView value) { const upb_MiniTableField field = {2, UPB_SIZE(20, 24), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_MethodDescriptorProto_set_output_type(google_protobuf_MethodDescriptorProto *msg, upb_StringView value) { +} +UPB_INLINE void google_protobuf_MethodDescriptorProto_set_output_type(google_protobuf_MethodDescriptorProto *msg, upb_StringView value) { const upb_MiniTableField field = {3, UPB_SIZE(28, 40), 3, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_MethodDescriptorProto_set_options(google_protobuf_MethodDescriptorProto *msg, google_protobuf_MethodOptions* value) { +} +UPB_INLINE void google_protobuf_MethodDescriptorProto_set_options(google_protobuf_MethodDescriptorProto *msg, google_protobuf_MethodOptions* value) { const upb_MiniTableField field = {4, UPB_SIZE(4, 56), 4, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE struct google_protobuf_MethodOptions* google_protobuf_MethodDescriptorProto_mutable_options(google_protobuf_MethodDescriptorProto* msg, upb_Arena* arena) { +} +UPB_INLINE struct google_protobuf_MethodOptions* google_protobuf_MethodDescriptorProto_mutable_options(google_protobuf_MethodDescriptorProto* msg, upb_Arena* arena) { struct google_protobuf_MethodOptions* sub = (struct google_protobuf_MethodOptions*)google_protobuf_MethodDescriptorProto_options(msg); if (sub == NULL) { sub = (struct google_protobuf_MethodOptions*)_upb_Message_New(&google_protobuf_MethodOptions_msg_init, arena); @@ -5588,10 +5645,12 @@ UPB_INLINE void google_protobuf_MethodDescriptorProto_set_name(google_protobuf_M UPB_INLINE void google_protobuf_MethodDescriptorProto_set_client_streaming(google_protobuf_MethodDescriptorProto *msg, bool value) { const upb_MiniTableField field = {5, UPB_SIZE(8, 1), 5, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_MethodDescriptorProto_set_server_streaming(google_protobuf_MethodDescriptorProto *msg, bool value) { +} +UPB_INLINE void google_protobuf_MethodDescriptorProto_set_server_streaming(google_protobuf_MethodDescriptorProto *msg, bool value) { const upb_MiniTableField field = {6, UPB_SIZE(9, 2), 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); } + /* google.protobuf.FileOptions */ UPB_INLINE google_protobuf_FileOptions* google_protobuf_FileOptions_new(upb_Arena* arena) { @@ -5951,64 +6010,84 @@ UPB_INLINE bool google_protobuf_FileOptions_has_uninterpreted_option(const googl UPB_INLINE void google_protobuf_FileOptions_set_java_package(google_protobuf_FileOptions *msg, upb_StringView value) { const upb_MiniTableField field = {1, 24, 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FileOptions_set_java_outer_classname(google_protobuf_FileOptions *msg, upb_StringView value) { +} +UPB_INLINE void google_protobuf_FileOptions_set_java_outer_classname(google_protobuf_FileOptions *msg, upb_StringView value) { const upb_MiniTableField field = {8, UPB_SIZE(32, 40), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FileOptions_set_optimize_for(google_protobuf_FileOptions *msg, int32_t value) { +} +UPB_INLINE void google_protobuf_FileOptions_set_optimize_for(google_protobuf_FileOptions *msg, int32_t value) { const upb_MiniTableField field = {9, 4, 3, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FileOptions_set_java_multiple_files(google_protobuf_FileOptions *msg, bool value) { +} +UPB_INLINE void google_protobuf_FileOptions_set_java_multiple_files(google_protobuf_FileOptions *msg, bool value) { const upb_MiniTableField field = {10, 8, 4, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FileOptions_set_go_package(google_protobuf_FileOptions *msg, upb_StringView value) { +} +UPB_INLINE void google_protobuf_FileOptions_set_go_package(google_protobuf_FileOptions *msg, upb_StringView value) { const upb_MiniTableField field = {11, UPB_SIZE(40, 56), 5, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FileOptions_set_cc_generic_services(google_protobuf_FileOptions *msg, bool value) { +} +UPB_INLINE void google_protobuf_FileOptions_set_cc_generic_services(google_protobuf_FileOptions *msg, bool value) { const upb_MiniTableField field = {16, 9, 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FileOptions_set_java_generic_services(google_protobuf_FileOptions *msg, bool value) { +} +UPB_INLINE void google_protobuf_FileOptions_set_java_generic_services(google_protobuf_FileOptions *msg, bool value) { const upb_MiniTableField field = {17, 10, 7, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FileOptions_set_py_generic_services(google_protobuf_FileOptions *msg, bool value) { +} +UPB_INLINE void google_protobuf_FileOptions_set_py_generic_services(google_protobuf_FileOptions *msg, bool value) { const upb_MiniTableField field = {18, 11, 8, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FileOptions_set_java_generate_equals_and_hash(google_protobuf_FileOptions *msg, bool value) { +} +UPB_INLINE void google_protobuf_FileOptions_set_java_generate_equals_and_hash(google_protobuf_FileOptions *msg, bool value) { const upb_MiniTableField field = {20, 12, 9, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FileOptions_set_deprecated(google_protobuf_FileOptions *msg, bool value) { +} +UPB_INLINE void google_protobuf_FileOptions_set_deprecated(google_protobuf_FileOptions *msg, bool value) { const upb_MiniTableField field = {23, 13, 10, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FileOptions_set_java_string_check_utf8(google_protobuf_FileOptions *msg, bool value) { +} +UPB_INLINE void google_protobuf_FileOptions_set_java_string_check_utf8(google_protobuf_FileOptions *msg, bool value) { const upb_MiniTableField field = {27, 14, 11, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FileOptions_set_cc_enable_arenas(google_protobuf_FileOptions *msg, bool value) { +} +UPB_INLINE void google_protobuf_FileOptions_set_cc_enable_arenas(google_protobuf_FileOptions *msg, bool value) { const upb_MiniTableField field = {31, 15, 12, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FileOptions_set_objc_class_prefix(google_protobuf_FileOptions *msg, upb_StringView value) { +} +UPB_INLINE void google_protobuf_FileOptions_set_objc_class_prefix(google_protobuf_FileOptions *msg, upb_StringView value) { const upb_MiniTableField field = {36, UPB_SIZE(48, 72), 13, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FileOptions_set_csharp_namespace(google_protobuf_FileOptions *msg, upb_StringView value) { +} +UPB_INLINE void google_protobuf_FileOptions_set_csharp_namespace(google_protobuf_FileOptions *msg, upb_StringView value) { const upb_MiniTableField field = {37, UPB_SIZE(56, 88), 14, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FileOptions_set_swift_prefix(google_protobuf_FileOptions *msg, upb_StringView value) { +} +UPB_INLINE void google_protobuf_FileOptions_set_swift_prefix(google_protobuf_FileOptions *msg, upb_StringView value) { const upb_MiniTableField field = {39, UPB_SIZE(64, 104), 15, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FileOptions_set_php_class_prefix(google_protobuf_FileOptions *msg, upb_StringView value) { +} +UPB_INLINE void google_protobuf_FileOptions_set_php_class_prefix(google_protobuf_FileOptions *msg, upb_StringView value) { const upb_MiniTableField field = {40, UPB_SIZE(72, 120), 16, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FileOptions_set_php_namespace(google_protobuf_FileOptions *msg, upb_StringView value) { +} +UPB_INLINE void google_protobuf_FileOptions_set_php_namespace(google_protobuf_FileOptions *msg, upb_StringView value) { const upb_MiniTableField field = {41, UPB_SIZE(80, 136), 17, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FileOptions_set_php_generic_services(google_protobuf_FileOptions *msg, bool value) { +} +UPB_INLINE void google_protobuf_FileOptions_set_php_generic_services(google_protobuf_FileOptions *msg, bool value) { const upb_MiniTableField field = {42, 16, 18, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FileOptions_set_php_metadata_namespace(google_protobuf_FileOptions *msg, upb_StringView value) { +} +UPB_INLINE void google_protobuf_FileOptions_set_php_metadata_namespace(google_protobuf_FileOptions *msg, upb_StringView value) { const upb_MiniTableField field = {44, UPB_SIZE(88, 152), 19, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FileOptions_set_ruby_package(google_protobuf_FileOptions *msg, upb_StringView value) { +} +UPB_INLINE void google_protobuf_FileOptions_set_ruby_package(google_protobuf_FileOptions *msg, upb_StringView value) { const upb_MiniTableField field = {45, UPB_SIZE(96, 168), 20, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FileOptions_mutable_uninterpreted_option(google_protobuf_FileOptions* msg, size_t* size) { +} +UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FileOptions_mutable_uninterpreted_option(google_protobuf_FileOptions* msg, size_t* size) { upb_MiniTableField field = {999, UPB_SIZE(20, 184), 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { @@ -6169,19 +6248,24 @@ UPB_INLINE bool google_protobuf_MessageOptions_has_uninterpreted_option(const go UPB_INLINE void google_protobuf_MessageOptions_set_message_set_wire_format(google_protobuf_MessageOptions *msg, bool value) { const upb_MiniTableField field = {1, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_MessageOptions_set_no_standard_descriptor_accessor(google_protobuf_MessageOptions *msg, bool value) { +} +UPB_INLINE void google_protobuf_MessageOptions_set_no_standard_descriptor_accessor(google_protobuf_MessageOptions *msg, bool value) { const upb_MiniTableField field = {2, 2, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_MessageOptions_set_deprecated(google_protobuf_MessageOptions *msg, bool value) { +} +UPB_INLINE void google_protobuf_MessageOptions_set_deprecated(google_protobuf_MessageOptions *msg, bool value) { const upb_MiniTableField field = {3, 3, 3, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_MessageOptions_set_map_entry(google_protobuf_MessageOptions *msg, bool value) { +} +UPB_INLINE void google_protobuf_MessageOptions_set_map_entry(google_protobuf_MessageOptions *msg, bool value) { const upb_MiniTableField field = {7, 4, 4, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_MessageOptions_set_deprecated_legacy_json_field_conflicts(google_protobuf_MessageOptions *msg, bool value) { +} +UPB_INLINE void google_protobuf_MessageOptions_set_deprecated_legacy_json_field_conflicts(google_protobuf_MessageOptions *msg, bool value) { const upb_MiniTableField field = {11, 5, 5, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MessageOptions_mutable_uninterpreted_option(google_protobuf_MessageOptions* msg, size_t* size) { +} +UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MessageOptions_mutable_uninterpreted_option(google_protobuf_MessageOptions* msg, size_t* size) { upb_MiniTableField field = {999, 8, 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { @@ -6387,28 +6471,36 @@ UPB_INLINE bool google_protobuf_FieldOptions_has_uninterpreted_option(const goog UPB_INLINE void google_protobuf_FieldOptions_set_ctype(google_protobuf_FieldOptions *msg, int32_t value) { const upb_MiniTableField field = {1, 4, 1, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FieldOptions_set_packed(google_protobuf_FieldOptions *msg, bool value) { +} +UPB_INLINE void google_protobuf_FieldOptions_set_packed(google_protobuf_FieldOptions *msg, bool value) { const upb_MiniTableField field = {2, 8, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FieldOptions_set_deprecated(google_protobuf_FieldOptions *msg, bool value) { +} +UPB_INLINE void google_protobuf_FieldOptions_set_deprecated(google_protobuf_FieldOptions *msg, bool value) { const upb_MiniTableField field = {3, 9, 3, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FieldOptions_set_lazy(google_protobuf_FieldOptions *msg, bool value) { +} +UPB_INLINE void google_protobuf_FieldOptions_set_lazy(google_protobuf_FieldOptions *msg, bool value) { const upb_MiniTableField field = {5, 10, 4, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FieldOptions_set_jstype(google_protobuf_FieldOptions *msg, int32_t value) { +} +UPB_INLINE void google_protobuf_FieldOptions_set_jstype(google_protobuf_FieldOptions *msg, int32_t value) { const upb_MiniTableField field = {6, 12, 5, 1, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FieldOptions_set_weak(google_protobuf_FieldOptions *msg, bool value) { +} +UPB_INLINE void google_protobuf_FieldOptions_set_weak(google_protobuf_FieldOptions *msg, bool value) { const upb_MiniTableField field = {10, 16, 6, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FieldOptions_set_unverified_lazy(google_protobuf_FieldOptions *msg, bool value) { +} +UPB_INLINE void google_protobuf_FieldOptions_set_unverified_lazy(google_protobuf_FieldOptions *msg, bool value) { const upb_MiniTableField field = {15, 17, 7, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_FieldOptions_set_debug_redact(google_protobuf_FieldOptions *msg, bool value) { +} +UPB_INLINE void google_protobuf_FieldOptions_set_debug_redact(google_protobuf_FieldOptions *msg, bool value) { const upb_MiniTableField field = {16, 18, 8, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FieldOptions_mutable_uninterpreted_option(google_protobuf_FieldOptions* msg, size_t* size) { +} +UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FieldOptions_mutable_uninterpreted_option(google_protobuf_FieldOptions* msg, size_t* size) { upb_MiniTableField field = {999, UPB_SIZE(20, 24), 0, 2, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { @@ -6622,13 +6714,16 @@ UPB_INLINE bool google_protobuf_EnumOptions_has_uninterpreted_option(const googl UPB_INLINE void google_protobuf_EnumOptions_set_allow_alias(google_protobuf_EnumOptions *msg, bool value) { const upb_MiniTableField field = {2, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_EnumOptions_set_deprecated(google_protobuf_EnumOptions *msg, bool value) { +} +UPB_INLINE void google_protobuf_EnumOptions_set_deprecated(google_protobuf_EnumOptions *msg, bool value) { const upb_MiniTableField field = {3, 2, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_EnumOptions_set_deprecated_legacy_json_field_conflicts(google_protobuf_EnumOptions *msg, bool value) { +} +UPB_INLINE void google_protobuf_EnumOptions_set_deprecated_legacy_json_field_conflicts(google_protobuf_EnumOptions *msg, bool value) { const upb_MiniTableField field = {6, 3, 3, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumOptions_mutable_uninterpreted_option(google_protobuf_EnumOptions* msg, size_t* size) { +} +UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumOptions_mutable_uninterpreted_option(google_protobuf_EnumOptions* msg, size_t* size) { upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { @@ -6729,7 +6824,8 @@ UPB_INLINE bool google_protobuf_EnumValueOptions_has_uninterpreted_option(const UPB_INLINE void google_protobuf_EnumValueOptions_set_deprecated(google_protobuf_EnumValueOptions *msg, bool value) { const upb_MiniTableField field = {1, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumValueOptions_mutable_uninterpreted_option(google_protobuf_EnumValueOptions* msg, size_t* size) { +} +UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumValueOptions_mutable_uninterpreted_option(google_protobuf_EnumValueOptions* msg, size_t* size) { upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { @@ -6830,7 +6926,8 @@ UPB_INLINE bool google_protobuf_ServiceOptions_has_uninterpreted_option(const go UPB_INLINE void google_protobuf_ServiceOptions_set_deprecated(google_protobuf_ServiceOptions *msg, bool value) { const upb_MiniTableField field = {33, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ServiceOptions_mutable_uninterpreted_option(google_protobuf_ServiceOptions* msg, size_t* size) { +} +UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ServiceOptions_mutable_uninterpreted_option(google_protobuf_ServiceOptions* msg, size_t* size) { upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { @@ -6946,10 +7043,12 @@ UPB_INLINE bool google_protobuf_MethodOptions_has_uninterpreted_option(const goo UPB_INLINE void google_protobuf_MethodOptions_set_deprecated(google_protobuf_MethodOptions *msg, bool value) { const upb_MiniTableField field = {33, 1, 1, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_MethodOptions_set_idempotency_level(google_protobuf_MethodOptions *msg, int32_t value) { +} +UPB_INLINE void google_protobuf_MethodOptions_set_idempotency_level(google_protobuf_MethodOptions *msg, int32_t value) { const upb_MiniTableField field = {34, 4, 2, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MethodOptions_mutable_uninterpreted_option(google_protobuf_MethodOptions* msg, size_t* size) { +} +UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MethodOptions_mutable_uninterpreted_option(google_protobuf_MethodOptions* msg, size_t* size) { upb_MiniTableField field = {999, 8, 0, 1, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { @@ -7151,22 +7250,28 @@ UPB_INLINE struct google_protobuf_UninterpretedOption_NamePart* google_protobuf_ UPB_INLINE void google_protobuf_UninterpretedOption_set_identifier_value(google_protobuf_UninterpretedOption *msg, upb_StringView value) { const upb_MiniTableField field = {3, UPB_SIZE(8, 16), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_UninterpretedOption_set_positive_int_value(google_protobuf_UninterpretedOption *msg, uint64_t value) { +} +UPB_INLINE void google_protobuf_UninterpretedOption_set_positive_int_value(google_protobuf_UninterpretedOption *msg, uint64_t value) { const upb_MiniTableField field = {4, UPB_SIZE(16, 32), 2, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_UninterpretedOption_set_negative_int_value(google_protobuf_UninterpretedOption *msg, int64_t value) { +} +UPB_INLINE void google_protobuf_UninterpretedOption_set_negative_int_value(google_protobuf_UninterpretedOption *msg, int64_t value) { const upb_MiniTableField field = {5, UPB_SIZE(24, 40), 3, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_UninterpretedOption_set_double_value(google_protobuf_UninterpretedOption *msg, double value) { +} +UPB_INLINE void google_protobuf_UninterpretedOption_set_double_value(google_protobuf_UninterpretedOption *msg, double value) { const upb_MiniTableField field = {6, UPB_SIZE(32, 48), 4, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_UninterpretedOption_set_string_value(google_protobuf_UninterpretedOption *msg, upb_StringView value) { +} +UPB_INLINE void google_protobuf_UninterpretedOption_set_string_value(google_protobuf_UninterpretedOption *msg, upb_StringView value) { const upb_MiniTableField field = {7, UPB_SIZE(40, 56), 5, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_UninterpretedOption_set_aggregate_value(google_protobuf_UninterpretedOption *msg, upb_StringView value) { +} +UPB_INLINE void google_protobuf_UninterpretedOption_set_aggregate_value(google_protobuf_UninterpretedOption *msg, upb_StringView value) { const upb_MiniTableField field = {8, UPB_SIZE(48, 72), 6, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); } + /* google.protobuf.UninterpretedOption.NamePart */ UPB_INLINE google_protobuf_UninterpretedOption_NamePart* google_protobuf_UninterpretedOption_NamePart_new(upb_Arena* arena) { @@ -7236,10 +7341,12 @@ UPB_INLINE bool google_protobuf_UninterpretedOption_NamePart_has_is_extension(co UPB_INLINE void google_protobuf_UninterpretedOption_NamePart_set_name_part(google_protobuf_UninterpretedOption_NamePart *msg, upb_StringView value) { const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_UninterpretedOption_NamePart_set_is_extension(google_protobuf_UninterpretedOption_NamePart *msg, bool value) { +} +UPB_INLINE void google_protobuf_UninterpretedOption_NamePart_set_is_extension(google_protobuf_UninterpretedOption_NamePart *msg, bool value) { const upb_MiniTableField field = {2, 1, 2, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); } + /* google.protobuf.SourceCodeInfo */ UPB_INLINE google_protobuf_SourceCodeInfo* google_protobuf_SourceCodeInfo_new(upb_Arena* arena) { @@ -7500,10 +7607,12 @@ UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_add_span(google_protobuf UPB_INLINE void google_protobuf_SourceCodeInfo_Location_set_leading_comments(google_protobuf_SourceCodeInfo_Location *msg, upb_StringView value) { const upb_MiniTableField field = {3, UPB_SIZE(16, 24), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_SourceCodeInfo_Location_set_trailing_comments(google_protobuf_SourceCodeInfo_Location *msg, upb_StringView value) { +} +UPB_INLINE void google_protobuf_SourceCodeInfo_Location_set_trailing_comments(google_protobuf_SourceCodeInfo_Location *msg, upb_StringView value) { const upb_MiniTableField field = {4, UPB_SIZE(24, 40), 2, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE upb_StringView* google_protobuf_SourceCodeInfo_Location_mutable_leading_detached_comments(google_protobuf_SourceCodeInfo_Location* msg, size_t* size) { +} +UPB_INLINE upb_StringView* google_protobuf_SourceCodeInfo_Location_mutable_leading_detached_comments(google_protobuf_SourceCodeInfo_Location* msg, size_t* size) { upb_MiniTableField field = {6, UPB_SIZE(12, 56), 0, kUpb_NoSub, 12, kUpb_FieldMode_Array | kUpb_LabelFlags_IsAlternate | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { @@ -7754,16 +7863,20 @@ UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_add_path(google_pro UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_source_file(google_protobuf_GeneratedCodeInfo_Annotation *msg, upb_StringView value) { const upb_MiniTableField field = {2, UPB_SIZE(20, 24), 1, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_begin(google_protobuf_GeneratedCodeInfo_Annotation *msg, int32_t value) { +} +UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_begin(google_protobuf_GeneratedCodeInfo_Annotation *msg, int32_t value) { const upb_MiniTableField field = {3, UPB_SIZE(8, 4), 2, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_end(google_protobuf_GeneratedCodeInfo_Annotation *msg, int32_t value) { +} +UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_end(google_protobuf_GeneratedCodeInfo_Annotation *msg, int32_t value) { const upb_MiniTableField field = {4, UPB_SIZE(12, 8), 3, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); -}UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_semantic(google_protobuf_GeneratedCodeInfo_Annotation *msg, int32_t value) { +} +UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_semantic(google_protobuf_GeneratedCodeInfo_Annotation *msg, int32_t value) { const upb_MiniTableField field = {5, UPB_SIZE(16, 12), 4, 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); } + extern const upb_MiniTableFile google_protobuf_descriptor_proto_upb_file_layout; /* Max size 32 is google.protobuf.FileOptions */ @@ -7831,7 +7944,6 @@ typedef const char* upb_EpsCopyInputStream_IsDoneFallbackFunc( UPB_INLINE void upb_EpsCopyInputStream_Init(upb_EpsCopyInputStream* e, const char** ptr, size_t size, bool enable_aliasing) { - bool ret; if (size <= kUpb_EpsCopyInputStream_SlopBytes) { memset(&e->patch, 0, 32); if (size) memcpy(&e->patch, *ptr, size); @@ -7840,13 +7952,11 @@ UPB_INLINE void upb_EpsCopyInputStream_Init(upb_EpsCopyInputStream* e, *ptr = e->patch; e->end = *ptr + size; e->limit = 0; - ret = true; } else { e->end = *ptr + size - kUpb_EpsCopyInputStream_SlopBytes; e->limit = kUpb_EpsCopyInputStream_SlopBytes; e->aliasing = enable_aliasing ? kUpb_EpsCopyInputStream_NoDelta : kUpb_EpsCopyInputStream_NoAliasing; - ret = false; } e->limit_ptr = e->end; e->error = false; @@ -7898,6 +8008,7 @@ UPB_INLINE bool upb_EpsCopyInputStream_IsDoneWithCallback( *ptr = func(e, *ptr, overrun); return *ptr == NULL; } + UPB_UNREACHABLE(); } const char* _upb_EpsCopyInputStream_IsDoneFallbackNoCallback( @@ -8033,14 +8144,24 @@ UPB_INLINE const char* upb_EpsCopyInputStream_ReadStringAliased( return ret; } -// Skips `size` bytes of string data from the input and returns a pointer past -// the end. Returns NULL on end of stream or error. +// Skips `size` bytes of data from the input and returns a pointer past the end. +// Returns NULL on end of stream or error. UPB_INLINE const char* upb_EpsCopyInputStream_Skip(upb_EpsCopyInputStream* e, const char* ptr, int size) { if (!upb_EpsCopyInputStream_CheckDataSizeAvailable(e, ptr, size)) return NULL; return ptr + size; } +// Copies `size` bytes of data from the input `ptr` into the buffer `to`, and +// returns a pointer past the end. Returns NULL on end of stream or error. +UPB_INLINE const char* upb_EpsCopyInputStream_Copy(upb_EpsCopyInputStream* e, + const char* ptr, void* to, + int size) { + if (!upb_EpsCopyInputStream_CheckDataSizeAvailable(e, ptr, size)) return NULL; + memcpy(to, ptr, size); + return ptr + size; +} + // Reads string data from the stream and advances the pointer accordingly. // If aliasing was enabled when the stream was initialized, then the returned // pointer will point into the input buffer if possible, otherwise new data @@ -8061,10 +8182,8 @@ UPB_INLINE const char* upb_EpsCopyInputStream_ReadString( UPB_ASSERT(arena); char* data = (char*)upb_Arena_Malloc(arena, size); if (!data) return NULL; - memcpy(data, *ptr, size); - const char* ret = *ptr + size; + const char* ret = upb_EpsCopyInputStream_Copy(e, *ptr, data, size); *ptr = data; - UPB_ASSUME(ret != NULL); return ret; } } @@ -8260,6 +8379,16 @@ void upb_inttable_removeiter(upb_inttable* t, intptr_t* iter); #ifndef UPB_REFLECTION_COMMON_H_ #define UPB_REFLECTION_COMMON_H_ +// begin:google_only +// #ifndef UPB_BOOTSTRAP_STAGE0 +// #include "net/proto2/proto/descriptor.upb.h" +// #else +// #include "google/protobuf/descriptor.upb.h" +// #endif +// end:google_only + +// begin:github_only +// end:github_only typedef enum { kUpb_Syntax_Proto2 = 2, kUpb_Syntax_Proto3 = 3 } upb_Syntax; @@ -8386,9 +8515,10 @@ const upb_ServiceDef* upb_DefPool_FindServiceByNameWithSize( const upb_FileDef* upb_DefPool_FindFileContainingSymbol(const upb_DefPool* s, const char* name); -const upb_FileDef* upb_DefPool_AddFile( - upb_DefPool* s, const google_protobuf_FileDescriptorProto* file_proto, - upb_Status* status); +const upb_FileDef* upb_DefPool_AddFile(upb_DefPool* s, + const UPB_DESC(FileDescriptorProto) * + file_proto, + upb_Status* status); const upb_ExtensionRegistry* upb_DefPool_ExtensionRegistry( const upb_DefPool* s); @@ -8435,7 +8565,7 @@ bool upb_EnumDef_MiniDescriptorEncode(const upb_EnumDef* e, upb_Arena* a, upb_StringView* out); const char* upb_EnumDef_Name(const upb_EnumDef* e); -const google_protobuf_EnumOptions* upb_EnumDef_Options(const upb_EnumDef* e); +const UPB_DESC(EnumOptions) * upb_EnumDef_Options(const upb_EnumDef* e); upb_StringView upb_EnumDef_ReservedName(const upb_EnumDef* e, int i); int upb_EnumDef_ReservedNameCount(const upb_EnumDef* e); @@ -8472,8 +8602,8 @@ bool upb_EnumValueDef_HasOptions(const upb_EnumValueDef* v); uint32_t upb_EnumValueDef_Index(const upb_EnumValueDef* v); const char* upb_EnumValueDef_Name(const upb_EnumValueDef* v); int32_t upb_EnumValueDef_Number(const upb_EnumValueDef* v); -const google_protobuf_EnumValueOptions* upb_EnumValueDef_Options( - const upb_EnumValueDef* v); +const UPB_DESC(EnumValueOptions) * + upb_EnumValueDef_Options(const upb_EnumValueDef* v); #ifdef __cplusplus } /* extern "C" */ @@ -8498,8 +8628,8 @@ int32_t upb_ExtensionRange_Start(const upb_ExtensionRange* r); int32_t upb_ExtensionRange_End(const upb_ExtensionRange* r); bool upb_ExtensionRange_HasOptions(const upb_ExtensionRange* r); -const google_protobuf_ExtensionRangeOptions* upb_ExtensionRange_Options( - const upb_ExtensionRange* r); +const UPB_DESC(ExtensionRangeOptions) * + upb_ExtensionRange_Options(const upb_ExtensionRange* r); #ifdef __cplusplus } /* extern "C" */ @@ -8558,7 +8688,7 @@ bool upb_FieldDef_MiniDescriptorEncode(const upb_FieldDef* f, upb_Arena* a, const upb_MiniTableField* upb_FieldDef_MiniTable(const upb_FieldDef* f); const char* upb_FieldDef_Name(const upb_FieldDef* f); uint32_t upb_FieldDef_Number(const upb_FieldDef* f); -const google_protobuf_FieldOptions* upb_FieldDef_Options(const upb_FieldDef* f); +const UPB_DESC(FieldOptions) * upb_FieldDef_Options(const upb_FieldDef* f); const upb_OneofDef* upb_FieldDef_RealContainingOneof(const upb_FieldDef* f); upb_FieldType upb_FieldDef_Type(const upb_FieldDef* f); @@ -8585,7 +8715,7 @@ const upb_FileDef* upb_FileDef_Dependency(const upb_FileDef* f, int i); int upb_FileDef_DependencyCount(const upb_FileDef* f); bool upb_FileDef_HasOptions(const upb_FileDef* f); const char* upb_FileDef_Name(const upb_FileDef* f); -const google_protobuf_FileOptions* upb_FileDef_Options(const upb_FileDef* f); +const UPB_DESC(FileOptions) * upb_FileDef_Options(const upb_FileDef* f); const char* upb_FileDef_Package(const upb_FileDef* f); const upb_DefPool* upb_FileDef_Pool(const upb_FileDef* f); @@ -8738,8 +8868,10 @@ int upb_MessageDef_NestedMessageCount(const upb_MessageDef* m); const upb_OneofDef* upb_MessageDef_Oneof(const upb_MessageDef* m, int i); int upb_MessageDef_OneofCount(const upb_MessageDef* m); +int upb_MessageDef_RealOneofCount(const upb_MessageDef* m); -const google_protobuf_MessageOptions* upb_MessageDef_Options(const upb_MessageDef* m); +const UPB_DESC(MessageOptions) * + upb_MessageDef_Options(const upb_MessageDef* m); upb_StringView upb_MessageDef_ReservedName(const upb_MessageDef* m, int i); int upb_MessageDef_ReservedNameCount(const upb_MessageDef* m); @@ -8776,7 +8908,7 @@ bool upb_MethodDef_HasOptions(const upb_MethodDef* m); int upb_MethodDef_Index(const upb_MethodDef* m); const upb_MessageDef* upb_MethodDef_InputType(const upb_MethodDef* m); const char* upb_MethodDef_Name(const upb_MethodDef* m); -const google_protobuf_MethodOptions* upb_MethodDef_Options(const upb_MethodDef* m); +const UPB_DESC(MethodOptions) * upb_MethodDef_Options(const upb_MethodDef* m); const upb_MessageDef* upb_MethodDef_OutputType(const upb_MethodDef* m); bool upb_MethodDef_ServerStreaming(const upb_MethodDef* m); const upb_ServiceDef* upb_MethodDef_Service(const upb_MethodDef* m); @@ -8816,7 +8948,7 @@ const upb_FieldDef* upb_OneofDef_LookupNumber(const upb_OneofDef* o, uint32_t num); const char* upb_OneofDef_Name(const upb_OneofDef* o); int upb_OneofDef_numfields(const upb_OneofDef* o); -const google_protobuf_OneofOptions* upb_OneofDef_Options(const upb_OneofDef* o); +const UPB_DESC(OneofOptions) * upb_OneofDef_Options(const upb_OneofDef* o); #ifdef __cplusplus } /* extern "C" */ @@ -8846,7 +8978,8 @@ int upb_ServiceDef_Index(const upb_ServiceDef* s); const upb_MethodDef* upb_ServiceDef_Method(const upb_ServiceDef* s, int i); int upb_ServiceDef_MethodCount(const upb_ServiceDef* s); const char* upb_ServiceDef_Name(const upb_ServiceDef* s); -const google_protobuf_ServiceOptions* upb_ServiceDef_Options(const upb_ServiceDef* s); +const UPB_DESC(ServiceOptions) * + upb_ServiceDef_Options(const upb_ServiceDef* s); #ifdef __cplusplus } /* extern "C" */ @@ -9349,26 +9482,25 @@ UPB_INLINE const char* upb_WireReader_ReadFixed64(const char* ptr, void* val) { return ptr + 8; } +const char* _upb_WireReader_SkipGroup(const char* ptr, uint32_t tag, + int depth_limit, + upb_EpsCopyInputStream* stream); + // Skips data for a group, returning a pointer past the end of the group, or // NULL if there was an error parsing the group. The `tag` argument should be // the start group tag that begins the group. The `depth_limit` argument // indicates how many levels of recursion the group is allowed to have before // reporting a parse error (this limit exists to protect against stack // overflow). -const char* upb_WireReader_SkipGroup(const char* ptr, uint32_t tag, - int depth_limit, - upb_EpsCopyInputStream* stream); - -// Skips data for a wire value of any type, returning a pointer past the end of -// the data, or NULL if there was an error parsing the group. The `tag` argument -// should be the tag that was just parsed. The `depth_limit` argument indicates -// how many levels of recursion a group is allowed to have before reporting a -// parse error (this limit exists to protect against stack overflow). // -// REQUIRES: there must be at least 10 bytes of data available at `ptr`. -// Bounds checks must be performed before calling this function, preferably -// by calling upb_EpsCopyInputStream_IsDone(). -UPB_INLINE const char* upb_WireReader_SkipValue( +// TODO: evaluate how the depth_limit should be specified. Do users need +// control over this? +UPB_INLINE const char* upb_WireReader_SkipGroup( + const char* ptr, uint32_t tag, upb_EpsCopyInputStream* stream) { + return _upb_WireReader_SkipGroup(ptr, tag, 100, stream); +} + +UPB_INLINE const char* _upb_WireReader_SkipValue( const char* ptr, uint32_t tag, int depth_limit, upb_EpsCopyInputStream* stream) { switch (upb_WireReader_GetWireType(tag)) { @@ -9386,7 +9518,7 @@ UPB_INLINE const char* upb_WireReader_SkipValue( return ptr; } case kUpb_WireType_StartGroup: - return upb_WireReader_SkipGroup(ptr, tag, depth_limit, stream); + return _upb_WireReader_SkipGroup(ptr, tag, depth_limit, stream); case kUpb_WireType_EndGroup: return NULL; // Should be handled before now. default: @@ -9394,6 +9526,23 @@ UPB_INLINE const char* upb_WireReader_SkipValue( } } +// Skips data for a wire value of any type, returning a pointer past the end of +// the data, or NULL if there was an error parsing the group. The `tag` argument +// should be the tag that was just parsed. The `depth_limit` argument indicates +// how many levels of recursion a group is allowed to have before reporting a +// parse error (this limit exists to protect against stack overflow). +// +// REQUIRES: there must be at least 10 bytes of data available at `ptr`. +// Bounds checks must be performed before calling this function, preferably +// by calling upb_EpsCopyInputStream_IsDone(). +// +// TODO: evaluate how the depth_limit should be specified. Do users need +// control over this? +UPB_INLINE const char* upb_WireReader_SkipValue( + const char* ptr, uint32_t tag, upb_EpsCopyInputStream* stream) { + return _upb_WireReader_SkipValue(ptr, tag, 100, stream); +} + #ifdef __cplusplus } /* extern "C" */ #endif @@ -9686,6 +9835,7 @@ bool _upb_DefPool_LookupSym(const upb_DefPool* s, const char* sym, size_t size, void** _upb_DefPool_ScratchData(const upb_DefPool* s); size_t* _upb_DefPool_ScratchSize(const upb_DefPool* s); +void _upb_DefPool_SetPlatform(upb_DefPool* s, upb_MiniTablePlatform platform); // For generated code only: loads a generated descriptor. typedef struct _upb_DefPool_Init { @@ -9713,17 +9863,17 @@ bool _upb_DefPool_LoadDefInitEx(upb_DefPool* s, const _upb_DefPool_Init* init, // We want to copy the options verbatim into the destination options proto. // We use serialize+parse as our deep copy. -#define UPB_DEF_SET_OPTIONS(target, desc_type, options_type, proto) \ - if (google_protobuf_##desc_type##_has_options(proto)) { \ - size_t size; \ - char* pb = google_protobuf_##options_type##_serialize( \ - google_protobuf_##desc_type##_options(proto), ctx->tmp_arena, &size); \ - if (!pb) _upb_DefBuilder_OomErr(ctx); \ - target = \ - google_protobuf_##options_type##_parse(pb, size, _upb_DefBuilder_Arena(ctx)); \ - if (!target) _upb_DefBuilder_OomErr(ctx); \ - } else { \ - target = (const google_protobuf_##options_type*)kUpbDefOptDefault; \ +#define UPB_DEF_SET_OPTIONS(target, desc_type, options_type, proto) \ + if (UPB_DESC(desc_type##_has_options)(proto)) { \ + size_t size; \ + char* pb = UPB_DESC(options_type##_serialize)( \ + UPB_DESC(desc_type##_options)(proto), ctx->tmp_arena, &size); \ + if (!pb) _upb_DefBuilder_OomErr(ctx); \ + target = \ + UPB_DESC(options_type##_parse)(pb, size, _upb_DefBuilder_Arena(ctx)); \ + if (!target) _upb_DefBuilder_OomErr(ctx); \ + } else { \ + target = (const UPB_DESC(options_type)*)kUpbDefOptDefault; \ } #ifdef __cplusplus @@ -9737,6 +9887,7 @@ struct upb_DefBuilder { upb_Arena* tmp_arena; // For temporary allocations. upb_Status* status; // Record errors here. const upb_MiniTableFile* layout; // NULL if we should build layouts. + upb_MiniTablePlatform platform; // Platform we are targeting. int enum_count; // Count of enums built so far. int msg_count; // Count of messages built so far. int ext_count; // Count of extensions built so far. @@ -9862,9 +10013,10 @@ bool _upb_EnumDef_Insert(upb_EnumDef* e, upb_EnumValueDef* v, upb_Arena* a); const upb_MiniTableEnum* _upb_EnumDef_MiniTable(const upb_EnumDef* e); // Allocate and initialize an array of |n| enum defs. -upb_EnumDef* _upb_EnumDefs_New(upb_DefBuilder* ctx, int n, - const google_protobuf_EnumDescriptorProto* const* protos, - const upb_MessageDef* containing_type); +upb_EnumDef* _upb_EnumDefs_New( + upb_DefBuilder* ctx, int n, + const UPB_DESC(EnumDescriptorProto) * const* protos, + const upb_MessageDef* containing_type); #ifdef __cplusplus } /* extern "C" */ @@ -9888,7 +10040,7 @@ upb_EnumValueDef* _upb_EnumValueDef_At(const upb_EnumValueDef* v, int i); // Allocate and initialize an array of |n| enum value defs owned by |e|. upb_EnumValueDef* _upb_EnumValueDefs_New( upb_DefBuilder* ctx, const char* prefix, int n, - const google_protobuf_EnumValueDescriptorProto* const* protos, upb_EnumDef* e, + const UPB_DESC(EnumValueDescriptorProto) * const* protos, upb_EnumDef* e, bool* is_sorted); const upb_EnumValueDef** _upb_EnumValueDefs_Sorted(const upb_EnumValueDef* v, @@ -9925,7 +10077,7 @@ void _upb_FieldDef_Resolve(upb_DefBuilder* ctx, const char* prefix, // Allocate and initialize an array of |n| field defs. upb_FieldDef* _upb_FieldDefs_New( upb_DefBuilder* ctx, int n, - const google_protobuf_FieldDescriptorProto* const* protos, const char* prefix, + const UPB_DESC(FieldDescriptorProto) * const* protos, const char* prefix, upb_MessageDef* m, bool* is_sorted); // Allocate and return a list of pointers to the |n| field defs in |ff|, @@ -9959,7 +10111,7 @@ const int32_t* _upb_FileDef_WeakDependencyIndexes(const upb_FileDef* f); const char* _upb_FileDef_RawPackage(const upb_FileDef* f); void _upb_FileDef_Create(upb_DefBuilder* ctx, - const google_protobuf_FileDescriptorProto* file_proto); + const UPB_DESC(FileDescriptorProto) * file_proto); #ifdef __cplusplus } /* extern "C" */ @@ -9991,7 +10143,7 @@ void _upb_MessageDef_Resolve(upb_DefBuilder* ctx, upb_MessageDef* m); // Allocate and initialize an array of |n| message defs. upb_MessageDef* _upb_MessageDefs_New( - upb_DefBuilder* ctx, int n, const google_protobuf_DescriptorProto* const* protos, + upb_DefBuilder* ctx, int n, const UPB_DESC(DescriptorProto) * const* protos, const upb_MessageDef* containing_type); #ifdef __cplusplus @@ -10016,7 +10168,7 @@ upb_ServiceDef* _upb_ServiceDef_At(const upb_ServiceDef* s, int i); // Allocate and initialize an array of |n| service defs. upb_ServiceDef* _upb_ServiceDefs_New( upb_DefBuilder* ctx, int n, - const google_protobuf_ServiceDescriptorProto* const* protos); + const UPB_DESC(ServiceDescriptorProto) * const* protos); #ifdef __cplusplus } /* extern "C" */ @@ -10097,7 +10249,7 @@ upb_EnumReservedRange* _upb_EnumReservedRange_At(const upb_EnumReservedRange* r, // Allocate and initialize an array of |n| reserved ranges owned by |e|. upb_EnumReservedRange* _upb_EnumReservedRanges_New( upb_DefBuilder* ctx, int n, - const google_protobuf_EnumDescriptorProto_EnumReservedRange* const* protos, + const UPB_DESC(EnumDescriptorProto_EnumReservedRange) * const* protos, const upb_EnumDef* e); #ifdef __cplusplus @@ -10122,7 +10274,7 @@ upb_ExtensionRange* _upb_ExtensionRange_At(const upb_ExtensionRange* r, int i); // Allocate and initialize an array of |n| extension ranges owned by |m|. upb_ExtensionRange* _upb_ExtensionRanges_New( upb_DefBuilder* ctx, int n, - const google_protobuf_DescriptorProto_ExtensionRange* const* protos, + const UPB_DESC(DescriptorProto_ExtensionRange) * const* protos, const upb_MessageDef* m); #ifdef __cplusplus @@ -10149,7 +10301,7 @@ bool _upb_OneofDef_Insert(upb_OneofDef* o, const upb_FieldDef* f, // Allocate and initialize an array of |n| oneof defs owned by |m|. upb_OneofDef* _upb_OneofDefs_New( upb_DefBuilder* ctx, int n, - const google_protobuf_OneofDescriptorProto* const* protos, upb_MessageDef* m); + const UPB_DESC(OneofDescriptorProto) * const* protos, upb_MessageDef* m); size_t _upb_OneofDefs_Finalize(upb_DefBuilder* ctx, upb_MessageDef* m); @@ -10198,7 +10350,7 @@ upb_MessageReservedRange* _upb_MessageReservedRange_At( // Allocate and initialize an array of |n| reserved ranges owned by |m|. upb_MessageReservedRange* _upb_MessageReservedRanges_New( upb_DefBuilder* ctx, int n, - const google_protobuf_DescriptorProto_ReservedRange* const* protos, + const UPB_DESC(DescriptorProto_ReservedRange) * const* protos, const upb_MessageDef* m); #ifdef __cplusplus @@ -10223,7 +10375,7 @@ upb_MethodDef* _upb_MethodDef_At(const upb_MethodDef* m, int i); // Allocate and initialize an array of |n| method defs owned by |s|. upb_MethodDef* _upb_MethodDefs_New( upb_DefBuilder* ctx, int n, - const google_protobuf_MethodDescriptorProto* const* protos, upb_ServiceDef* s); + const UPB_DESC(MethodDescriptorProto) * const* protos, upb_ServiceDef* s); #ifdef __cplusplus } /* extern "C" */ @@ -10278,6 +10430,7 @@ typedef struct upb_Decoder { uint16_t options; bool missing_required; upb_Arena arena; + upb_DecodeStatus status; jmp_buf err; #ifndef NDEBUG @@ -10415,6 +10568,7 @@ UPB_INLINE uint32_t _upb_FastDecoder_LoadTag(const char* ptr) { #undef UPB_PTRADD #undef UPB_MUSTTAIL #undef UPB_FASTTABLE_SUPPORTED +#undef UPB_FASTTABLE_MASK #undef UPB_FASTTABLE #undef UPB_FASTTABLE_INIT #undef UPB_POISON_MEMORY_REGION @@ -10423,3 +10577,6 @@ UPB_INLINE uint32_t _upb_FastDecoder_LoadTag(const char* ptr) { #undef UPB_TREAT_PROTO2_ENUMS_LIKE_PROTO3 #undef UPB_DEPRECATED #undef UPB_GNUC_MIN +#undef UPB_DESCRIPTOR_UPB_H_FILENAME +#undef UPB_DESC +#undef UPB_IS_GOOGLE3 diff --git a/src/google/protobuf/compiler/BUILD.bazel b/src/google/protobuf/compiler/BUILD.bazel index d7aa4a8cea..3439f88597 100644 --- a/src/google/protobuf/compiler/BUILD.bazel +++ b/src/google/protobuf/compiler/BUILD.bazel @@ -192,6 +192,12 @@ filegroup( ], ) +filegroup( + name = "plugin_proto_src", + srcs = ["plugin.proto"], + visibility = ["@upb//:__subpackages__"], +) + exports_files( srcs = ["plugin.proto"], visibility = ["//:__pkg__"],