From ec76af2b0e8dee5e65522d8ff898be02c3e32ad3 Mon Sep 17 00:00:00 2001 From: Mike Kruskal Date: Tue, 28 Nov 2023 22:15:57 -0800 Subject: [PATCH] Internal Code Change PiperOrigin-RevId: 586204703 --- src/google/protobuf/cpp_edition_defaults.h | 2 +- src/google/protobuf/descriptor.pb.cc | 18 +++++++++--------- src/google/protobuf/descriptor.pb.h | 10 +++++----- src/google/protobuf/descriptor.proto | 2 +- upb/reflection/internal/upb_edition_defaults.h | 2 +- .../stage0/google/protobuf/descriptor.upb.c | 2 +- .../stage0/google/protobuf/descriptor.upb.h | 4 ++-- 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/google/protobuf/cpp_edition_defaults.h b/src/google/protobuf/cpp_edition_defaults.h index 0e87733027..151455f2d8 100644 --- a/src/google/protobuf/cpp_edition_defaults.h +++ b/src/google/protobuf/cpp_edition_defaults.h @@ -5,7 +5,7 @@ // the C++ runtime. This is used for feature resolution under Editions. // NOLINTBEGIN // clang-format off -#define PROTOBUF_INTERNAL_CPP_EDITION_DEFAULTS "\n\026\022\021\010\001\020\002\030\002 \001(\0010\002\302>\002\010\001\030\346\007\n\026\022\021\010\002\020\001\030\001 \002(\0010\001\302>\002\010\000\030\347\007\n\026\022\021\010\001\020\001\030\001 \002(\0010\001\302>\002\010\000\030\350\007 \346\007(\350\007" +#define PROTOBUF_INTERNAL_CPP_EDITION_DEFAULTS "\n\026\022\021\010\001\020\002\030\002 \003(\0010\002\302>\002\010\001\030\346\007\n\026\022\021\010\002\020\001\030\001 \002(\0010\001\302>\002\010\000\030\347\007\n\026\022\021\010\001\020\001\030\001 \002(\0010\001\302>\002\010\000\030\350\007 \346\007(\350\007" // clang-format on // NOLINTEND diff --git a/src/google/protobuf/descriptor.pb.cc b/src/google/protobuf/descriptor.pb.cc index a89d833a34..bfec171c41 100644 --- a/src/google/protobuf/descriptor.pb.cc +++ b/src/google/protobuf/descriptor.pb.cc @@ -1865,8 +1865,8 @@ const char descriptor_table_protodef_google_2fprotobuf_2fdescriptor_2eproto[] AB "SED\020\002\"V\n\025RepeatedFieldEncoding\022#\n\037REPEAT" "ED_FIELD_ENCODING_UNKNOWN\020\000\022\n\n\006PACKED\020\001\022" "\014\n\010EXPANDED\020\002\"C\n\016Utf8Validation\022\033\n\027UTF8_" - "VALIDATION_UNKNOWN\020\000\022\010\n\004NONE\020\001\022\n\n\006VERIFY" - "\020\002\"S\n\017MessageEncoding\022\034\n\030MESSAGE_ENCODIN" + "VALIDATION_UNKNOWN\020\000\022\n\n\006VERIFY\020\002\022\010\n\004NONE" + "\020\003\"S\n\017MessageEncoding\022\034\n\030MESSAGE_ENCODIN" "G_UNKNOWN\020\000\022\023\n\017LENGTH_PREFIXED\020\001\022\r\n\tDELI" "MITED\020\002\"H\n\nJsonFormat\022\027\n\023JSON_FORMAT_UNK" "NOWN\020\000\022\t\n\005ALLOW\020\001\022\026\n\022LEGACY_BEST_EFFORT\020" @@ -2261,16 +2261,16 @@ const ::google::protobuf::EnumDescriptor* FeatureSet_Utf8Validation_descriptor() return file_level_enum_descriptors_google_2fprotobuf_2fdescriptor_2eproto[12]; } PROTOBUF_CONSTINIT const uint32_t FeatureSet_Utf8Validation_internal_data_[] = { - 196608u, 0u, }; + 65536u, 32u, 6u, }; bool FeatureSet_Utf8Validation_IsValid(int value) { - return 0 <= value && value <= 2; + return 0 <= value && value <= 3 && ((13u >> value) & 1) != 0; } #if (__cplusplus < 201703) && \ (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) constexpr FeatureSet_Utf8Validation FeatureSet::UTF8_VALIDATION_UNKNOWN; -constexpr FeatureSet_Utf8Validation FeatureSet::NONE; constexpr FeatureSet_Utf8Validation FeatureSet::VERIFY; +constexpr FeatureSet_Utf8Validation FeatureSet::NONE; constexpr FeatureSet_Utf8Validation FeatureSet::Utf8Validation_MIN; constexpr FeatureSet_Utf8Validation FeatureSet::Utf8Validation_MAX; constexpr int FeatureSet::Utf8Validation_ARRAYSIZE; @@ -11396,8 +11396,8 @@ constexpr ::_pbi::TcParseTable<3, 6, 6, 0, 2> FeatureSet::_table_ = { {::_pbi::TcParser::FastEr0S1, {24, 2, 2, PROTOBUF_FIELD_OFFSET(FeatureSet, _impl_.repeated_field_encoding_)}}, // optional .google.protobuf.FeatureSet.Utf8Validation utf8_validation = 4 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = { - {::_pbi::TcParser::FastEr0S1, - {32, 3, 2, PROTOBUF_FIELD_OFFSET(FeatureSet, _impl_.utf8_validation_)}}, + {::_pbi::TcParser::FastEvS1, + {32, 3, 3, PROTOBUF_FIELD_OFFSET(FeatureSet, _impl_.utf8_validation_)}}, // optional .google.protobuf.FeatureSet.MessageEncoding message_encoding = 5 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = { {::_pbi::TcParser::FastEr0S1, {40, 4, 2, PROTOBUF_FIELD_OFFSET(FeatureSet, _impl_.message_encoding_)}}, @@ -11419,7 +11419,7 @@ constexpr ::_pbi::TcParseTable<3, 6, 6, 0, 2> FeatureSet::_table_ = { (0 | ::_fl::kFcOptional | ::_fl::kEnumRange)}, // optional .google.protobuf.FeatureSet.Utf8Validation utf8_validation = 4 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = { {PROTOBUF_FIELD_OFFSET(FeatureSet, _impl_.utf8_validation_), _Internal::kHasBitsOffset + 3, 3, - (0 | ::_fl::kFcOptional | ::_fl::kEnumRange)}, + (0 | ::_fl::kFcOptional | ::_fl::kEnum)}, // optional .google.protobuf.FeatureSet.MessageEncoding message_encoding = 5 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = { {PROTOBUF_FIELD_OFFSET(FeatureSet, _impl_.message_encoding_), _Internal::kHasBitsOffset + 4, 4, (0 | ::_fl::kFcOptional | ::_fl::kEnumRange)}, @@ -11430,7 +11430,7 @@ constexpr ::_pbi::TcParseTable<3, 6, 6, 0, 2> FeatureSet::_table_ = { {0, 4}, {0, 3}, {0, 3}, - {0, 3}, + {::_pbi::FieldAuxEnumData{}, ::google::protobuf::FeatureSet_Utf8Validation_internal_data_}, {0, 3}, {0, 3}, }}, {{ diff --git a/src/google/protobuf/descriptor.pb.h b/src/google/protobuf/descriptor.pb.h index b2714a0d10..cb2fe93640 100644 --- a/src/google/protobuf/descriptor.pb.h +++ b/src/google/protobuf/descriptor.pb.h @@ -542,15 +542,15 @@ inline bool FeatureSet_RepeatedFieldEncoding_Parse(absl::string_view name, Featu } enum FeatureSet_Utf8Validation : int { FeatureSet_Utf8Validation_UTF8_VALIDATION_UNKNOWN = 0, - FeatureSet_Utf8Validation_NONE = 1, FeatureSet_Utf8Validation_VERIFY = 2, + FeatureSet_Utf8Validation_NONE = 3, }; PROTOBUF_EXPORT bool FeatureSet_Utf8Validation_IsValid(int value); PROTOBUF_EXPORT extern const uint32_t FeatureSet_Utf8Validation_internal_data_[]; constexpr FeatureSet_Utf8Validation FeatureSet_Utf8Validation_Utf8Validation_MIN = static_cast(0); -constexpr FeatureSet_Utf8Validation FeatureSet_Utf8Validation_Utf8Validation_MAX = static_cast(2); -constexpr int FeatureSet_Utf8Validation_Utf8Validation_ARRAYSIZE = 2 + 1; +constexpr FeatureSet_Utf8Validation FeatureSet_Utf8Validation_Utf8Validation_MAX = static_cast(3); +constexpr int FeatureSet_Utf8Validation_Utf8Validation_ARRAYSIZE = 3 + 1; PROTOBUF_EXPORT const ::google::protobuf::EnumDescriptor* FeatureSet_Utf8Validation_descriptor(); template @@ -563,7 +563,7 @@ const std::string& FeatureSet_Utf8Validation_Name(T value) { template <> inline const std::string& FeatureSet_Utf8Validation_Name(FeatureSet_Utf8Validation value) { return ::google::protobuf::internal::NameOfDenseEnum( + 0, 3>( static_cast(value)); } inline bool FeatureSet_Utf8Validation_Parse(absl::string_view name, FeatureSet_Utf8Validation* value) { @@ -1778,8 +1778,8 @@ class PROTOBUF_EXPORT FeatureSet final : public ::google::protobuf::Message } using Utf8Validation = FeatureSet_Utf8Validation; static constexpr Utf8Validation UTF8_VALIDATION_UNKNOWN = FeatureSet_Utf8Validation_UTF8_VALIDATION_UNKNOWN; - static constexpr Utf8Validation NONE = FeatureSet_Utf8Validation_NONE; static constexpr Utf8Validation VERIFY = FeatureSet_Utf8Validation_VERIFY; + static constexpr Utf8Validation NONE = FeatureSet_Utf8Validation_NONE; static inline bool Utf8Validation_IsValid(int value) { return FeatureSet_Utf8Validation_IsValid(value); } diff --git a/src/google/protobuf/descriptor.proto b/src/google/protobuf/descriptor.proto index 6c444d7ede..fb6f58fee2 100644 --- a/src/google/protobuf/descriptor.proto +++ b/src/google/protobuf/descriptor.proto @@ -974,8 +974,8 @@ message FeatureSet { enum Utf8Validation { UTF8_VALIDATION_UNKNOWN = 0; - NONE = 1; VERIFY = 2; + NONE = 3; } optional Utf8Validation utf8_validation = 4 [ retention = RETENTION_RUNTIME, diff --git a/upb/reflection/internal/upb_edition_defaults.h b/upb/reflection/internal/upb_edition_defaults.h index 587d3b13d1..b5fedd310a 100644 --- a/upb/reflection/internal/upb_edition_defaults.h +++ b/upb/reflection/internal/upb_edition_defaults.h @@ -13,7 +13,7 @@ // features. This is used for feature resolution under Editions. // NOLINTBEGIN // clang-format off -#define UPB_INTERNAL_UPB_EDITION_DEFAULTS "\n\021\022\014\010\001\020\002\030\002 \001(\0010\002\030\346\007\n\021\022\014\010\002\020\001\030\001 \002(\0010\001\030\347\007\n\021\022\014\010\001\020\001\030\001 \002(\0010\001\030\350\007 \346\007(\350\007" +#define UPB_INTERNAL_UPB_EDITION_DEFAULTS "\n\021\022\014\010\001\020\002\030\002 \003(\0010\002\030\346\007\n\021\022\014\010\002\020\001\030\001 \002(\0010\001\030\347\007\n\021\022\014\010\001\020\001\030\001 \002(\0010\001\030\350\007 \346\007(\350\007" // clang-format on // NOLINTEND diff --git a/upb/reflection/stage0/google/protobuf/descriptor.upb.c b/upb/reflection/stage0/google/protobuf/descriptor.upb.c index a3c69be569..dd65b71f2f 100644 --- a/upb/reflection/stage0/google/protobuf/descriptor.upb.c +++ b/upb/reflection/stage0/google/protobuf/descriptor.upb.c @@ -471,7 +471,7 @@ const upb_MiniTableEnum* google_protobuf_FeatureSet_RepeatedFieldEncoding_enum_i const upb_MiniTableEnum* google_protobuf_FeatureSet_Utf8Validation_enum_init() { static const upb_MiniTableEnum* mini_table = NULL; - static const char* mini_descriptor = "!)"; + static const char* mini_descriptor = "!/"; if (mini_table) return mini_table; mini_table = upb_MiniTableEnum_Build(mini_descriptor, strlen(mini_descriptor), diff --git a/upb/reflection/stage0/google/protobuf/descriptor.upb.h b/upb/reflection/stage0/google/protobuf/descriptor.upb.h index b44602fb2e..d4a40f3a56 100644 --- a/upb/reflection/stage0/google/protobuf/descriptor.upb.h +++ b/upb/reflection/stage0/google/protobuf/descriptor.upb.h @@ -150,8 +150,8 @@ typedef enum { typedef enum { google_protobuf_FeatureSet_UTF8_VALIDATION_UNKNOWN = 0, - google_protobuf_FeatureSet_NONE = 1, - google_protobuf_FeatureSet_VERIFY = 2 + google_protobuf_FeatureSet_VERIFY = 2, + google_protobuf_FeatureSet_NONE = 3 } google_protobuf_FeatureSet_Utf8Validation; typedef enum {