Skip to content

Commit

Permalink
Auto-generate files after cl/619244115
Browse files Browse the repository at this point in the history
  • Loading branch information
protobuf-team-bot committed Mar 26, 2024
1 parent 11e767a commit b5e69ae
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 36 deletions.
34 changes: 16 additions & 18 deletions php/ext/google/protobuf/php-upb.c
Original file line number Diff line number Diff line change
Expand Up @@ -13473,30 +13473,15 @@ upb_CType upb_FieldDef_CType(const upb_FieldDef* f) {
return upb_FieldType_CType(f->type_);
}

upb_FieldType upb_FieldDef_Type(const upb_FieldDef* f) {
// TODO: remove once we can deprecate kUpb_FieldType_Group.
if (f->type_ == kUpb_FieldType_Message &&
UPB_DESC(FeatureSet_message_encoding)(f->resolved_features) ==
UPB_DESC(FeatureSet_DELIMITED)) {
return kUpb_FieldType_Group;
}
return f->type_;
}
upb_FieldType upb_FieldDef_Type(const upb_FieldDef* f) { return f->type_; }

uint32_t upb_FieldDef_Index(const upb_FieldDef* f) { return f->index_; }

uint32_t upb_FieldDef_LayoutIndex(const upb_FieldDef* f) {
return f->layout_index;
}

upb_Label upb_FieldDef_Label(const upb_FieldDef* f) {
// TODO: remove once we can deprecate kUpb_Label_Required.
if (UPB_DESC(FeatureSet_field_presence)(f->resolved_features) ==
UPB_DESC(FeatureSet_LEGACY_REQUIRED)) {
return kUpb_Label_Required;
}
return f->label_;
}
upb_Label upb_FieldDef_Label(const upb_FieldDef* f) { return f->label_; }

uint32_t upb_FieldDef_Number(const upb_FieldDef* f) { return f->number_; }

Expand Down Expand Up @@ -13959,7 +13944,6 @@ static void _upb_FieldDef_Create(upb_DefBuilder* ctx, const char* prefix,

const upb_StringView name = UPB_DESC(FieldDescriptorProto_name)(field_proto);
f->full_name = _upb_DefBuilder_MakeFullName(ctx, prefix, name);
f->label_ = (int)UPB_DESC(FieldDescriptorProto_label)(field_proto);
f->number_ = UPB_DESC(FieldDescriptorProto_number)(field_proto);
f->is_proto3_optional =
UPB_DESC(FieldDescriptorProto_proto3_optional)(field_proto);
Expand Down Expand Up @@ -14005,6 +13989,14 @@ static void _upb_FieldDef_Create(upb_DefBuilder* ctx, const char* prefix,
f->resolved_features = _upb_DefBuilder_DoResolveFeatures(
ctx, parent_features, unresolved_features, implicit);

f->label_ = (int)UPB_DESC(FieldDescriptorProto_label)(field_proto);
if (f->label_ == kUpb_Label_Optional &&
// TODO: remove once we can deprecate kUpb_Label_Required.
UPB_DESC(FeatureSet_field_presence)(f->resolved_features) ==
UPB_DESC(FeatureSet_LEGACY_REQUIRED)) {
f->label_ = kUpb_Label_Required;
}

if (!UPB_DESC(FieldDescriptorProto_has_name)(field_proto)) {
_upb_DefBuilder_Errf(ctx, "field has no name");
}
Expand All @@ -14024,6 +14016,12 @@ static void _upb_FieldDef_Create(upb_DefBuilder* ctx, const char* prefix,
UPB_DESC(FieldDescriptorProto_has_type_name)(field_proto);

f->type_ = (int)UPB_DESC(FieldDescriptorProto_type)(field_proto);
if (f->type_ == kUpb_FieldType_Message &&
// TODO: remove once we can deprecate kUpb_FieldType_Group.
UPB_DESC(FeatureSet_message_encoding)(f->resolved_features) ==
UPB_DESC(FeatureSet_DELIMITED)) {
f->type_ = kUpb_FieldType_Group;
}

if (has_type) {
switch (f->type_) {
Expand Down
34 changes: 16 additions & 18 deletions ruby/ext/google/protobuf_c/ruby-upb.c
Original file line number Diff line number Diff line change
Expand Up @@ -12987,30 +12987,15 @@ upb_CType upb_FieldDef_CType(const upb_FieldDef* f) {
return upb_FieldType_CType(f->type_);
}

upb_FieldType upb_FieldDef_Type(const upb_FieldDef* f) {
// TODO: remove once we can deprecate kUpb_FieldType_Group.
if (f->type_ == kUpb_FieldType_Message &&
UPB_DESC(FeatureSet_message_encoding)(f->resolved_features) ==
UPB_DESC(FeatureSet_DELIMITED)) {
return kUpb_FieldType_Group;
}
return f->type_;
}
upb_FieldType upb_FieldDef_Type(const upb_FieldDef* f) { return f->type_; }

uint32_t upb_FieldDef_Index(const upb_FieldDef* f) { return f->index_; }

uint32_t upb_FieldDef_LayoutIndex(const upb_FieldDef* f) {
return f->layout_index;
}

upb_Label upb_FieldDef_Label(const upb_FieldDef* f) {
// TODO: remove once we can deprecate kUpb_Label_Required.
if (UPB_DESC(FeatureSet_field_presence)(f->resolved_features) ==
UPB_DESC(FeatureSet_LEGACY_REQUIRED)) {
return kUpb_Label_Required;
}
return f->label_;
}
upb_Label upb_FieldDef_Label(const upb_FieldDef* f) { return f->label_; }

uint32_t upb_FieldDef_Number(const upb_FieldDef* f) { return f->number_; }

Expand Down Expand Up @@ -13473,7 +13458,6 @@ static void _upb_FieldDef_Create(upb_DefBuilder* ctx, const char* prefix,

const upb_StringView name = UPB_DESC(FieldDescriptorProto_name)(field_proto);
f->full_name = _upb_DefBuilder_MakeFullName(ctx, prefix, name);
f->label_ = (int)UPB_DESC(FieldDescriptorProto_label)(field_proto);
f->number_ = UPB_DESC(FieldDescriptorProto_number)(field_proto);
f->is_proto3_optional =
UPB_DESC(FieldDescriptorProto_proto3_optional)(field_proto);
Expand Down Expand Up @@ -13519,6 +13503,14 @@ static void _upb_FieldDef_Create(upb_DefBuilder* ctx, const char* prefix,
f->resolved_features = _upb_DefBuilder_DoResolveFeatures(
ctx, parent_features, unresolved_features, implicit);

f->label_ = (int)UPB_DESC(FieldDescriptorProto_label)(field_proto);
if (f->label_ == kUpb_Label_Optional &&
// TODO: remove once we can deprecate kUpb_Label_Required.
UPB_DESC(FeatureSet_field_presence)(f->resolved_features) ==
UPB_DESC(FeatureSet_LEGACY_REQUIRED)) {
f->label_ = kUpb_Label_Required;
}

if (!UPB_DESC(FieldDescriptorProto_has_name)(field_proto)) {
_upb_DefBuilder_Errf(ctx, "field has no name");
}
Expand All @@ -13538,6 +13530,12 @@ static void _upb_FieldDef_Create(upb_DefBuilder* ctx, const char* prefix,
UPB_DESC(FieldDescriptorProto_has_type_name)(field_proto);

f->type_ = (int)UPB_DESC(FieldDescriptorProto_type)(field_proto);
if (f->type_ == kUpb_FieldType_Message &&
// TODO: remove once we can deprecate kUpb_FieldType_Group.
UPB_DESC(FeatureSet_message_encoding)(f->resolved_features) ==
UPB_DESC(FeatureSet_DELIMITED)) {
f->type_ = kUpb_FieldType_Group;
}

if (has_type) {
switch (f->type_) {
Expand Down

0 comments on commit b5e69ae

Please sign in to comment.