aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/protoc/src/google/protobuf/compiler/cpp/cpp_message.h
diff options
context:
space:
mode:
authormikhnenko <mikhnenko@yandex-team.com>2024-06-25 08:50:35 +0300
committermikhnenko <mikhnenko@yandex-team.com>2024-06-25 09:00:27 +0300
commit509c9fc9e7b9c3b8be7307d72a4c966e5f9aa194 (patch)
tree4b8a6a44009906ac852e59efa0bc78bb12043a5b /contrib/libs/protoc/src/google/protobuf/compiler/cpp/cpp_message.h
parent7688f2313619a39a60ef3c2734d8efbc49a0a6db (diff)
downloadydb-509c9fc9e7b9c3b8be7307d72a4c966e5f9aa194.tar.gz
Update protobuf to 3.20.2 and pyprotobuf to 3.20.3
Если это pull-request что-то сломал, то: - если это тест с канонизацией и еще нет pr с переканонизацией, то переканонизируйте пожалуйста сами - проверьте, что тест не флапает - приходите в [DEVTOOLSSUPPORT](https://st.yandex-team.ru/createTicket?queue=DEVTOOLSSUPPORT) - там вам обязательно помогут 987be5ed151f827f7f292f32420470b04b71a91d
Diffstat (limited to 'contrib/libs/protoc/src/google/protobuf/compiler/cpp/cpp_message.h')
-rw-r--r--contrib/libs/protoc/src/google/protobuf/compiler/cpp/cpp_message.h29
1 files changed, 14 insertions, 15 deletions
diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/cpp/cpp_message.h b/contrib/libs/protoc/src/google/protobuf/compiler/cpp/cpp_message.h
index 939f21a1da..5e4bbe84b8 100644
--- a/contrib/libs/protoc/src/google/protobuf/compiler/cpp/cpp_message.h
+++ b/contrib/libs/protoc/src/google/protobuf/compiler/cpp/cpp_message.h
@@ -96,22 +96,10 @@ class MessageGenerator {
void GenerateFieldAccessorDeclarations(io::Printer* printer);
void GenerateFieldAccessorDefinitions(io::Printer* printer);
- // Generate the table-driven parsing array. Returns the number of entries
- // generated.
- size_t GenerateParseOffsets(io::Printer* printer);
- size_t GenerateParseAuxTable(io::Printer* printer);
- // Generates a ParseTable entry. Returns whether the proto uses
- // table-driven parsing.
- bool GenerateParseTable(io::Printer* printer, size_t offset,
- size_t aux_offset);
-
// Generate the field offsets array. Returns the a pair of the total number
// of entries generated and the index of the first has_bit entry.
std::pair<size_t, size_t> GenerateOffsets(io::Printer* printer);
void GenerateSchema(io::Printer* printer, int offset, int has_offset);
- // For each field generates a table entry describing the field for the
- // table driven serializer.
- int GenerateFieldMetadata(io::Printer* printer);
// Generate constructors and destructor.
void GenerateStructors(io::Printer* printer);
@@ -177,6 +165,18 @@ class MessageGenerator {
std::vector<bool> already_processed,
bool copy_constructor) const;
+ // Returns the level that this message needs ArenaDtor. If the message has
+ // a field that is not arena-exclusive, it needs an ArenaDtor
+ // (go/proto-destructor).
+ //
+ // - Returning kNone means we don't need to generate ArenaDtor.
+ // - Returning kOnDemand means we need to generate ArenaDtor, but don't need
+ // to register ArenaDtor at construction. Such as when the message's
+ // ArenaDtor code is only for destructing inlined string.
+ // - Returning kRequired means we meed to generate ArenaDtor and register it
+ // at construction.
+ ArenaDtorNeeds NeedsArenaDestructor() const;
+
size_t HasBitsSize() const;
size_t InlinedStringDonatedSize() const;
int HasBitIndex(const FieldDescriptor* a) const;
@@ -200,7 +200,8 @@ class MessageGenerator {
int max_has_bit_index_;
// A map from field index to inlined_string index. For non-inlined-string
- // fields, the element is -1.
+ // fields, the element is -1. If there is no inlined string in the message,
+ // this is empty.
std::vector<int> inlined_string_indices_;
// The count of inlined_string fields in the message.
int max_inlined_string_index_;
@@ -209,8 +210,6 @@ class MessageGenerator {
std::vector<const ExtensionGenerator*> extension_generators_;
int num_required_fields_;
int num_weak_fields_;
- // table_driven_ indicates the generated message uses table-driven parsing.
- bool table_driven_;
std::unique_ptr<MessageLayoutHelper> message_layout_helper_;
std::unique_ptr<ParseFunctionGenerator> parse_function_generator_;