Skip to content

Commit

Permalink
Add retention and target attributes to descriptor.proto
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 501049083
  • Loading branch information
acozzette authored and copybara-github committed Jan 10, 2023
1 parent 8e636d5 commit 0517b71
Show file tree
Hide file tree
Showing 5 changed files with 321 additions and 53 deletions.
24 changes: 22 additions & 2 deletions ruby/ext/google/protobuf_c/ruby-upb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1231,6 +1231,24 @@ const upb_MiniTableEnum google_protobuf_FieldOptions_JSType_enum_init = {
},
};

const upb_MiniTableEnum google_protobuf_FieldOptions_OptionRetention_enum_init = {
64,
0,
{
0x7,
0x0,
},
};

const upb_MiniTableEnum google_protobuf_FieldOptions_OptionTargetType_enum_init = {
64,
0,
{
0x3ff,
0x0,
},
};

const upb_MiniTableEnum google_protobuf_MethodOptions_IdempotencyLevel_enum_init = {
64,
0,
Expand All @@ -1249,12 +1267,14 @@ const upb_MiniTableEnum google_protobuf_GeneratedCodeInfo_Annotation_Semantic_en
},
};

static const upb_MiniTableEnum *enums_layout[7] = {
static const upb_MiniTableEnum *enums_layout[9] = {
&google_protobuf_FieldDescriptorProto_Type_enum_init,
&google_protobuf_FieldDescriptorProto_Label_enum_init,
&google_protobuf_FileOptions_OptimizeMode_enum_init,
&google_protobuf_FieldOptions_CType_enum_init,
&google_protobuf_FieldOptions_JSType_enum_init,
&google_protobuf_FieldOptions_OptionRetention_enum_init,
&google_protobuf_FieldOptions_OptionTargetType_enum_init,
&google_protobuf_MethodOptions_IdempotencyLevel_enum_init,
&google_protobuf_GeneratedCodeInfo_Annotation_Semantic_enum_init,
};
Expand All @@ -1264,7 +1284,7 @@ const upb_MiniTableFile google_protobuf_descriptor_proto_upb_file_layout = {
enums_layout,
NULL,
27,
7,
9,
0,
};

Expand Down
21 changes: 21 additions & 0 deletions ruby/ext/google/protobuf_c/ruby-upb.h
Original file line number Diff line number Diff line change
Expand Up @@ -3310,6 +3310,25 @@ typedef enum {
google_protobuf_FieldOptions_JS_NUMBER = 2
} google_protobuf_FieldOptions_JSType;

typedef enum {
google_protobuf_FieldOptions_RETENTION_UNKNOWN = 0,
google_protobuf_FieldOptions_RETENTION_RUNTIME = 1,
google_protobuf_FieldOptions_RETENTION_SOURCE = 2
} google_protobuf_FieldOptions_OptionRetention;

typedef enum {
google_protobuf_FieldOptions_TARGET_TYPE_UNKNOWN = 0,
google_protobuf_FieldOptions_TARGET_TYPE_FILE = 1,
google_protobuf_FieldOptions_TARGET_TYPE_EXTENSION_RANGE = 2,
google_protobuf_FieldOptions_TARGET_TYPE_MESSAGE = 3,
google_protobuf_FieldOptions_TARGET_TYPE_FIELD = 4,
google_protobuf_FieldOptions_TARGET_TYPE_ONEOF = 5,
google_protobuf_FieldOptions_TARGET_TYPE_ENUM = 6,
google_protobuf_FieldOptions_TARGET_TYPE_ENUM_ENTRY = 7,
google_protobuf_FieldOptions_TARGET_TYPE_SERVICE = 8,
google_protobuf_FieldOptions_TARGET_TYPE_METHOD = 9
} google_protobuf_FieldOptions_OptionTargetType;

typedef enum {
google_protobuf_FileOptions_SPEED = 1,
google_protobuf_FileOptions_CODE_SIZE = 2,
Expand All @@ -3333,6 +3352,8 @@ extern const upb_MiniTableEnum google_protobuf_FieldDescriptorProto_Label_enum_i
extern const upb_MiniTableEnum google_protobuf_FieldDescriptorProto_Type_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_FieldOptions_OptionRetention_enum_init;
extern const upb_MiniTableEnum google_protobuf_FieldOptions_OptionTargetType_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;
Expand Down
177 changes: 126 additions & 51 deletions src/google/protobuf/descriptor.pb.cc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 0517b71

Please sign in to comment.