In the custom vtable mode invert how the static/non-static overloads versions work for ByteSizeLong and _InternalSerialize. That way the public entry point and the function pointer both end up being the same. Currently, the static function is a separate function than the one called externally, forcing two functions to exist.

It has no effect in normal mode.

PiperOrigin-RevId: 651119789
pull/17316/head
Protobuf Team Bot 9 months ago committed by Copybara-Service
parent 5025dcd9c0
commit c97a042116
  1. 28
      editions/golden/compare_cpp_codegen_failure.txt
  2. 2
      editions/golden/compare_cpp_codegen_failure.xml
  3. 6
      src/google/protobuf/compiler/cpp/field_generators/cord_field.cc
  4. 26
      src/google/protobuf/compiler/cpp/field_generators/enum_field.cc
  5. 9
      src/google/protobuf/compiler/cpp/field_generators/map_field.cc
  6. 23
      src/google/protobuf/compiler/cpp/field_generators/message_field.cc
  7. 31
      src/google/protobuf/compiler/cpp/field_generators/primitive_field.cc
  8. 15
      src/google/protobuf/compiler/cpp/field_generators/string_field.cc
  9. 15
      src/google/protobuf/compiler/cpp/field_generators/string_view_field.cc
  10. 143
      src/google/protobuf/compiler/cpp/message.cc
  11. 4
      src/google/protobuf/compiler/cpp/tracker.cc
  12. 117
      src/google/protobuf/compiler/java/java_features.pb.cc
  13. 24
      src/google/protobuf/compiler/java/java_features.pb.h
  14. 819
      src/google/protobuf/compiler/plugin.pb.cc
  15. 96
      src/google/protobuf/compiler/plugin.pb.h
  16. 117
      src/google/protobuf/cpp_features.pb.cc
  17. 24
      src/google/protobuf/cpp_features.pb.h
  18. 7512
      src/google/protobuf/descriptor.pb.cc
  19. 792
      src/google/protobuf/descriptor.pb.h
  20. 22
      src/google/protobuf/generated_message_bases.cc
  21. 13
      src/google/protobuf/generated_message_bases.h
  22. 6
      src/google/protobuf/implicit_weak_message.cc
  23. 15
      src/google/protobuf/implicit_weak_message.h
  24. 23
      src/google/protobuf/message_lite.h

@ -16,23 +16,23 @@
(0 | ::_fl::kFcOptional | ::_fl::kInt32)}, (0 | ::_fl::kFcOptional | ::_fl::kInt32)},
}}, }},
@@ @@ @@ @@
(void)cached_has_bits; (void)cached_has_bits;
cached_has_bits = _impl_._has_bits_[0]; cached_has_bits = this_._impl_._has_bits_[0];
- // optional int32 int32_field = 1; - // optional int32 int32_field = 1;
+ // int32 int32_field = 1; + // int32 int32_field = 1;
if (cached_has_bits & 0x00000001u) { if (cached_has_bits & 0x00000001u) {
target = ::proto2::internal::WireFormatLite:: target = ::proto2::internal::WireFormatLite::
WriteInt32ToArrayWithField<1>( WriteInt32ToArrayWithField<1>(
@@ @@ @@ @@
(void)cached_has_bits; (void)cached_has_bits;
{ {
- // optional int32 int32_field = 1; - // optional int32 int32_field = 1;
+ // int32 int32_field = 1; + // int32 int32_field = 1;
cached_has_bits = _impl_._has_bits_[0]; cached_has_bits =
if (cached_has_bits & 0x00000001u) { this_._impl_._has_bits_[0];
total_size += ::_pbi::WireFormatLite::Int32SizePlusOne( if (cached_has_bits & 0x00000001u) {
[ FAILED ] third_party/protobuf/editions/golden/simple_proto3.pb.cc [ FAILED ] third_party/protobuf/editions/golden/simple_proto3.pb.cc
[ RUN ] third_party/protobuf/editions/golden/simple_proto3.pb.h [ RUN ] third_party/protobuf/editions/golden/simple_proto3.pb.h
@@ @@ @@ @@

@ -2,7 +2,7 @@
<testsuites tests="1" name="AllTests"> <testsuites tests="1" name="AllTests">
<testsuite name="EditionsCodegenTests"> <testsuite name="EditionsCodegenTests">
<testcase name="third_party/protobuf/editions/golden/simple_proto3.pb.cc" status="run" result="completed" classname="DiffTest"> <testcase name="third_party/protobuf/editions/golden/simple_proto3.pb.cc" status="run" result="completed" classname="DiffTest">
<failure message="Value of: third_party/protobuf/editions/golden/simple_proto3.pb.cc&#x0A;Expected: &#x0A;// Generated by the protocol buffer compiler. DO NOT EDIT!&#x0A;// NO CHECKED-IN PROTOBUF GENCODE&#x0A;// source: third_party/protobuf/editions/golden/simple_proto3.proto&#x0A;// Protobuf C++ Version: 0.20240709.0&#x0A;&#x0A;#include &quot;third_party/protobuf/editions/golden/simple_proto3.pb.h&quot;&#x0A;&#x0A;#include &lt;algorithm&gt;&#x0A;#include &lt;type_traits&gt;&#x0A;#include &quot;third_party/protobuf/io/coded_stream.h&quot;&#x0A;#include &quot;third_party/protobuf/generated_message_tctable_impl.h&quot;&#x0A;#include &quot;third_party/protobuf/extension_set.h&quot;&#x0A;#include &quot;third_party/protobuf/wire_format_lite.h&quot;&#x0A;#include &quot;third_party/protobuf/io/zero_copy_stream_impl_lite.h&quot;&#x0A;// @@protoc_insertion_point(includes)&#x0A;&#x0A;// Must be included last.&#x0A;, with the difference:&#x0A;@@ @@&#x0A; ::_pbi::TcParser::GetTable&lt;::protobuf_editions_test::golden::SimpleProto3&gt;(), // to_prefetch&#x0A; #endif // PROTOBUF_PREFETCH_PARSE_TABLE&#x0A; }, {{&#x0A;- // optional int32 int32_field = 1;&#x0A;+ // int32 int32_field = 1;&#x0A; {::_pbi::TcParser::FastV32S1,&#x0A; {8, 0, 0, PROTOBUF_FIELD_OFFSET(SimpleProto3, _impl_.int32_field_)}},&#x0A; }}, {{&#x0A; 65535, 65535&#x0A; }}, {{&#x0A;- // optional int32 int32_field = 1;&#x0A;+ // int32 int32_field = 1;&#x0A; {PROTOBUF_FIELD_OFFSET(SimpleProto3, _impl_.int32_field_), _Internal::kHasBitsOffset + 0, 0,&#x0A; (0 | ::_fl::kFcOptional | ::_fl::kInt32)},&#x0A; }},&#x0A;@@ @@&#x0A; (void)cached_has_bits;&#x0A; &#x0A; cached_has_bits = _impl_._has_bits_[0];&#x0A;- // optional int32 int32_field = 1;&#x0A;+ // int32 int32_field = 1;&#x0A; if (cached_has_bits &amp; 0x00000001u) {&#x0A; target = ::proto2::internal::WireFormatLite::&#x0A; WriteInt32ToArrayWithField&lt;1&gt;(&#x0A;@@ @@&#x0A; (void)cached_has_bits;&#x0A; &#x0A; {&#x0A;- // optional int32 int32_field = 1;&#x0A;+ // int32 int32_field = 1;&#x0A; cached_has_bits = _impl_._has_bits_[0];&#x0A; if (cached_has_bits &amp; 0x00000001u) {&#x0A; total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(" type=""></failure> <failure message="Value of: third_party/protobuf/editions/golden/simple_proto3.pb.cc&#x0A;Expected: &#x0A;// Generated by the protocol buffer compiler. DO NOT EDIT!&#x0A;// NO CHECKED-IN PROTOBUF GENCODE&#x0A;// source: third_party/protobuf/editions/golden/simple_proto3.proto&#x0A;// Protobuf C++ Version: 0.20240709.0&#x0A;&#x0A;#include &quot;third_party/protobuf/editions/golden/simple_proto3.pb.h&quot;&#x0A;&#x0A;#include &lt;algorithm&gt;&#x0A;#include &lt;type_traits&gt;&#x0A;#include &quot;third_party/protobuf/io/coded_stream.h&quot;&#x0A;#include &quot;third_party/protobuf/generated_message_tctable_impl.h&quot;&#x0A;#include &quot;third_party/protobuf/extension_set.h&quot;&#x0A;#include &quot;third_party/protobuf/wire_format_lite.h&quot;&#x0A;#include &quot;third_party/protobuf/io/zero_copy_stream_impl_lite.h&quot;&#x0A;// @@protoc_insertion_point(includes)&#x0A;&#x0A;// Must be included last.&#x0A;, with the difference:&#x0A;@@ @@&#x0A; ::_pbi::TcParser::GetTable&lt;::protobuf_editions_test::golden::SimpleProto3&gt;(), // to_prefetch&#x0A; #endif // PROTOBUF_PREFETCH_PARSE_TABLE&#x0A; }, {{&#x0A;- // optional int32 int32_field = 1;&#x0A;+ // int32 int32_field = 1;&#x0A; {::_pbi::TcParser::FastV32S1,&#x0A; {8, 0, 0, PROTOBUF_FIELD_OFFSET(SimpleProto3, _impl_.int32_field_)}},&#x0A; }}, {{&#x0A; 65535, 65535&#x0A; }}, {{&#x0A;- // optional int32 int32_field = 1;&#x0A;+ // int32 int32_field = 1;&#x0A; {PROTOBUF_FIELD_OFFSET(SimpleProto3, _impl_.int32_field_), _Internal::kHasBitsOffset + 0, 0,&#x0A; (0 | ::_fl::kFcOptional | ::_fl::kInt32)},&#x0A; }},&#x0A;@@ @@&#x0A; (void)cached_has_bits;&#x0A; &#x0A; cached_has_bits = this_._impl_._has_bits_[0];&#x0A;- // optional int32 int32_field = 1;&#x0A;+ // int32 int32_field = 1;&#x0A; if (cached_has_bits &amp; 0x00000001u) {&#x0A; target = ::proto2::internal::WireFormatLite::&#x0A; WriteInt32ToArrayWithField&lt;1&gt;(&#x0A;@@ @@&#x0A; (void)cached_has_bits;&#x0A; &#x0A; {&#x0A;- // optional int32 int32_field = 1;&#x0A;+ // int32 int32_field = 1;&#x0A; cached_has_bits =&#x0A; this_._impl_._has_bits_[0];&#x0A; if (cached_has_bits &amp; 0x00000001u) {" type=""></failure>
</testcase> </testcase>
<testcase name="third_party/protobuf/editions/golden/simple_proto3.pb.h" status="run" result="completed" classname="DiffTest"> <testcase name="third_party/protobuf/editions/golden/simple_proto3.pb.h" status="run" result="completed" classname="DiffTest">
<failure message="Value of: third_party/protobuf/editions/golden/simple_proto3.pb.h&#x0A;Expected: &#x0A;// Generated by the protocol buffer compiler. DO NOT EDIT!&#x0A;// NO CHECKED-IN PROTOBUF GENCODE&#x0A;// source: third_party/protobuf/editions/golden/simple_proto3.proto&#x0A;// Protobuf C++ Version: 0.20240709.0&#x0A;&#x0A;#ifndef GOOGLE_PROTOBUF_INCLUDED_third_5fparty_2fprotobuf_2feditions_2fgolden_2fsimple_5fproto3_2eproto_2epb_2eh&#x0A;#define GOOGLE_PROTOBUF_INCLUDED_third_5fparty_2fprotobuf_2feditions_2fgolden_2fsimple_5fproto3_2eproto_2epb_2eh&#x0A;&#x0A;#include &lt;limits&gt;&#x0A;#include &lt;string&gt;&#x0A;#include &lt;type_traits&gt;&#x0A;#include &lt;utility&gt;&#x0A;&#x0A;#include &quot;third_party/protobuf/runtime_version.h&quot;&#x0A;#if PROTOBUF_VERSION != 20240709&#x0A;#error &quot;Protobuf C++ gencode is built with an incompatible version of&quot;&#x0A;#error &quot;Protobuf C++ headers/runtime. See&quot;&#x0A;#error &quot;https://protobuf.dev/support/cross-version-runtime-guarantee/#cpp&quot;&#x0A;#endif&#x0A;#include &quot;third_party/protobuf/io/coded_stream.h&quot;&#x0A;#include &quot;third_party/protobuf/arena.h&quot;&#x0A;#include &quot;third_party/protobuf/arenastring.h&quot;&#x0A;#include &quot;third_party/protobuf/generated_message_tctable_decl.h&quot;&#x0A;#include &quot;third_party/protobuf/generated_message_util.h&quot;&#x0A;#include &quot;third_party/protobuf/metadata_lite.h&quot;&#x0A;#include &quot;third_party/protobuf/message_lite.h&quot;&#x0A;// @@protoc_insertion_point(includes)&#x0A;&#x0A;// Must be included last.&#x0A;&#x0A;#endif // GOOGLE_PROTOBUF_INCLUDED_third_5fparty_2fprotobuf_2feditions_2fgolden_2fsimple_5fproto3_2eproto_2epb_2eh&#x0A;, with the difference:&#x0A;@@ @@&#x0A; enum : int {&#x0A; kInt32FieldFieldNumber = 1,&#x0A; };&#x0A;- // optional int32 int32_field = 1;&#x0A;+ // int32 int32_field = 1;&#x0A; bool has_int32_field() const;&#x0A; void clear_int32_field() ;&#x0A; ::int32_t int32_field() const;&#x0A;@@ @@&#x0A; &#x0A; // SimpleProto3&#x0A; &#x0A;-// optional int32 int32_field = 1;&#x0A;+// int32 int32_field = 1;&#x0A; inline bool SimpleProto3::has_int32_field() const {&#x0A; bool value = (_impl_._has_bits_[0] &amp; 0x00000001u) != 0;&#x0A; return value;" type=""></failure> <failure message="Value of: third_party/protobuf/editions/golden/simple_proto3.pb.h&#x0A;Expected: &#x0A;// Generated by the protocol buffer compiler. DO NOT EDIT!&#x0A;// NO CHECKED-IN PROTOBUF GENCODE&#x0A;// source: third_party/protobuf/editions/golden/simple_proto3.proto&#x0A;// Protobuf C++ Version: 0.20240709.0&#x0A;&#x0A;#ifndef GOOGLE_PROTOBUF_INCLUDED_third_5fparty_2fprotobuf_2feditions_2fgolden_2fsimple_5fproto3_2eproto_2epb_2eh&#x0A;#define GOOGLE_PROTOBUF_INCLUDED_third_5fparty_2fprotobuf_2feditions_2fgolden_2fsimple_5fproto3_2eproto_2epb_2eh&#x0A;&#x0A;#include &lt;limits&gt;&#x0A;#include &lt;string&gt;&#x0A;#include &lt;type_traits&gt;&#x0A;#include &lt;utility&gt;&#x0A;&#x0A;#include &quot;third_party/protobuf/runtime_version.h&quot;&#x0A;#if PROTOBUF_VERSION != 20240709&#x0A;#error &quot;Protobuf C++ gencode is built with an incompatible version of&quot;&#x0A;#error &quot;Protobuf C++ headers/runtime. See&quot;&#x0A;#error &quot;https://protobuf.dev/support/cross-version-runtime-guarantee/#cpp&quot;&#x0A;#endif&#x0A;#include &quot;third_party/protobuf/io/coded_stream.h&quot;&#x0A;#include &quot;third_party/protobuf/arena.h&quot;&#x0A;#include &quot;third_party/protobuf/arenastring.h&quot;&#x0A;#include &quot;third_party/protobuf/generated_message_tctable_decl.h&quot;&#x0A;#include &quot;third_party/protobuf/generated_message_util.h&quot;&#x0A;#include &quot;third_party/protobuf/metadata_lite.h&quot;&#x0A;#include &quot;third_party/protobuf/message_lite.h&quot;&#x0A;// @@protoc_insertion_point(includes)&#x0A;&#x0A;// Must be included last.&#x0A;&#x0A;#endif // GOOGLE_PROTOBUF_INCLUDED_third_5fparty_2fprotobuf_2feditions_2fgolden_2fsimple_5fproto3_2eproto_2epb_2eh&#x0A;, with the difference:&#x0A;@@ @@&#x0A; enum : int {&#x0A; kInt32FieldFieldNumber = 1,&#x0A; };&#x0A;- // optional int32 int32_field = 1;&#x0A;+ // int32 int32_field = 1;&#x0A; bool has_int32_field() const;&#x0A; void clear_int32_field() ;&#x0A; ::int32_t int32_field() const;&#x0A;@@ @@&#x0A; &#x0A; // SimpleProto3&#x0A; &#x0A;-// optional int32 int32_field = 1;&#x0A;+// int32 int32_field = 1;&#x0A; inline bool SimpleProto3::has_int32_field() const {&#x0A; bool value = (_impl_._has_bits_[0] &amp; 0x00000001u) != 0;&#x0A; return value;" type=""></failure>

@ -262,12 +262,12 @@ void CordFieldGenerator::GenerateSerializeWithCachedSizesToArray(
if (field_->type() == FieldDescriptor::TYPE_STRING) { if (field_->type() == FieldDescriptor::TYPE_STRING) {
GenerateUtf8CheckCodeForCord( GenerateUtf8CheckCodeForCord(
field_, options_, false, field_, options_, false,
absl::Substitute("this->_internal_$0(), ", printer->LookupVar("name")), absl::Substitute("this_._internal_$0(), ", printer->LookupVar("name")),
format); format);
} }
format( format(
"target = stream->Write$declared_type$($number$, " "target = stream->Write$declared_type$($number$, "
"this->_internal_$name$(), " "this_._internal_$name$(), "
"target);\n"); "target);\n");
} }
@ -276,7 +276,7 @@ void CordFieldGenerator::GenerateByteSize(io::Printer* printer) const {
format( format(
"total_size += $tag_size$ +\n" "total_size += $tag_size$ +\n"
" ::$proto_ns$::internal::WireFormatLite::$declared_type$Size(\n" " ::$proto_ns$::internal::WireFormatLite::$declared_type$Size(\n"
" this->_internal_$name$());\n"); " this_._internal_$name$());\n");
} }
void CordFieldGenerator::GenerateConstexprAggregateInitializer( void CordFieldGenerator::GenerateConstexprAggregateInitializer(

@ -103,14 +103,14 @@ class SingularEnum : public FieldGeneratorBase {
p->Emit(R"cc( p->Emit(R"cc(
target = stream->EnsureSpace(target); target = stream->EnsureSpace(target);
target = ::_pbi::WireFormatLite::WriteEnumToArray( target = ::_pbi::WireFormatLite::WriteEnumToArray(
$number$, this->_internal_$name$(), target); $number$, this_._internal_$name$(), target);
)cc"); )cc");
} }
void GenerateByteSize(io::Printer* p) const override { void GenerateByteSize(io::Printer* p) const override {
p->Emit(R"cc( p->Emit(R"cc(
total_size += $kTagBytes$ + total_size += $kTagBytes$ +
::_pbi::WireFormatLite::EnumSize(this->_internal_$name$()); ::_pbi::WireFormatLite::EnumSize(this_._internal_$name$());
)cc"); )cc");
} }
@ -481,16 +481,16 @@ void RepeatedEnum::GenerateSerializeWithCachedSizesToArray(
{"byte_size", {"byte_size",
[&] { [&] {
if (has_cached_size_) { if (has_cached_size_) {
p->Emit( p->Emit(R"cc(std::size_t byte_size =
R"cc(std::size_t byte_size = $cached_size_$.Get();)cc"); this_.$cached_size_$.Get();)cc");
} else { } else {
p->Emit(R"cc( p->Emit(R"cc(
std::size_t byte_size = 0; std::size_t byte_size = 0;
auto count = static_cast<std::size_t>(this->_internal_$name$_size()); auto count = static_cast<std::size_t>(this_._internal_$name$_size());
for (std::size_t i = 0; i < count; ++i) { for (std::size_t i = 0; i < count; ++i) {
byte_size += ::_pbi::WireFormatLite::EnumSize( byte_size += ::_pbi::WireFormatLite::EnumSize(
this->_internal_$name$().Get(static_cast<int>(i))); this_._internal_$name$().Get(static_cast<int>(i)));
} }
)cc"); )cc");
} }
@ -500,18 +500,18 @@ void RepeatedEnum::GenerateSerializeWithCachedSizesToArray(
{ {
$byte_size$; $byte_size$;
if (byte_size > 0) { if (byte_size > 0) {
target = stream->WriteEnumPacked($number$, _internal_$name$(), target = stream->WriteEnumPacked(
byte_size, target); $number$, this_._internal_$name$(), byte_size, target);
} }
} }
)cc"); )cc");
return; return;
} }
p->Emit(R"cc( p->Emit(R"cc(
for (int i = 0, n = this->_internal_$name$_size(); i < n; ++i) { for (int i = 0, n = this_._internal_$name$_size(); i < n; ++i) {
target = stream->EnsureSpace(target); target = stream->EnsureSpace(target);
target = ::_pbi::WireFormatLite::WriteEnumToArray( target = ::_pbi::WireFormatLite::WriteEnumToArray(
$number$, static_cast<$Enum$>(this->_internal_$name$().Get(i)), $number$, static_cast<$Enum$>(this_._internal_$name$().Get(i)),
target); target);
} }
)cc"); )cc");
@ -538,18 +538,18 @@ void RepeatedEnum::GenerateByteSize(io::Printer* p) const {
)cc"); )cc");
if (has_cached_size_) { if (has_cached_size_) {
p->Emit(R"cc( p->Emit(R"cc(
$cached_size_$.Set(::_pbi::ToCachedSize(data_size)); this_.$cached_size_$.Set(::_pbi::ToCachedSize(data_size));
)cc"); )cc");
} }
}}, }},
}, },
R"cc( R"cc(
std::size_t data_size = 0; std::size_t data_size = 0;
auto count = static_cast<std::size_t>(this->_internal_$name$_size()); auto count = static_cast<std::size_t>(this_._internal_$name$_size());
for (std::size_t i = 0; i < count; ++i) { for (std::size_t i = 0; i < count; ++i) {
data_size += ::_pbi::WireFormatLite::EnumSize( data_size += ::_pbi::WireFormatLite::EnumSize(
this->_internal_$name$().Get(static_cast<int>(i))); this_._internal_$name$().Get(static_cast<int>(i)));
} }
total_size += data_size; total_size += data_size;
$add_to_size$; $add_to_size$;

@ -276,10 +276,10 @@ void Map::GenerateSerializeWithCachedSizesToArray(io::Printer* p) const {
}}, }},
}, },
R"cc( R"cc(
if (!_internal_$name$().empty()) { if (!this_._internal_$name$().empty()) {
using MapType = $Map$; using MapType = $Map$;
using WireHelper = $Funcs$; using WireHelper = $Funcs$;
const auto& field = _internal_$name$(); const auto& field = this_._internal_$name$();
if (stream->IsSerializationDeterministic() && field.size() > 1) { if (stream->IsSerializationDeterministic() && field.size() > 1) {
for (const auto& entry : $pbi$::$Sorter$<MapType>(field)) { for (const auto& entry : $pbi$::$Sorter$<MapType>(field)) {
@ -304,8 +304,9 @@ void Map::GenerateByteSize(io::Printer* p) const {
{"Funcs", [&] { EmitFuncs(field_, p); }}, {"Funcs", [&] { EmitFuncs(field_, p); }},
}, },
R"cc( R"cc(
total_size += $kTagBytes$ * $pbi$::FromIntSize(_internal_$name$_size()); total_size +=
for (const auto& entry : _internal_$name$()) { $kTagBytes$ * $pbi$::FromIntSize(this_._internal_$name$_size());
for (const auto& entry : this_._internal_$name$()) {
total_size += $Funcs$::ByteSizeLong(entry.first, entry.second); total_size += $Funcs$::ByteSizeLong(entry.first, entry.second);
} }
)cc"); )cc");

@ -400,21 +400,22 @@ void SingularMessage::GenerateSerializeWithCachedSizesToArray(
if (!is_group()) { if (!is_group()) {
p->Emit(R"cc( p->Emit(R"cc(
target = $pbi$::WireFormatLite::InternalWrite$declared_type$( target = $pbi$::WireFormatLite::InternalWrite$declared_type$(
$number$, *$field_$, $field_$->GetCachedSize(), target, stream); $number$, *this_.$field_$, this_.$field_$->GetCachedSize(), target,
stream);
)cc"); )cc");
} else { } else {
p->Emit(R"cc( p->Emit(R"cc(
target = stream->EnsureSpace(target); target = stream->EnsureSpace(target);
target = $pbi$::WireFormatLite::InternalWrite$declared_type$( target = $pbi$::WireFormatLite::InternalWrite$declared_type$(
$number$, *$field_$, target, stream); $number$, *this_.$field_$, target, stream);
)cc"); )cc");
} }
} }
void SingularMessage::GenerateByteSize(io::Printer* p) const { void SingularMessage::GenerateByteSize(io::Printer* p) const {
p->Emit(R"cc( p->Emit(R"cc(
total_size += total_size += $tag_size$ +
$tag_size$ + $pbi$::WireFormatLite::$declared_type$Size(*$field_$); $pbi$::WireFormatLite::$declared_type$Size(*this_.$field_$);
)cc"); )cc");
} }
@ -953,8 +954,8 @@ void RepeatedMessage::GenerateSerializeWithCachedSizesToArray(
} }
}}}, }}},
R"cc( R"cc(
for (auto it = this->$field_$.pointer_begin(), for (auto it = this_.$field_$.pointer_begin(),
end = this->$field_$.pointer_end(); end = this_.$field_$.pointer_end();
it < end; ++it) { it < end; ++it) {
$serialize_field$; $serialize_field$;
} }
@ -965,7 +966,7 @@ void RepeatedMessage::GenerateSerializeWithCachedSizesToArray(
if (field_->type() == FieldDescriptor::TYPE_MESSAGE) { if (field_->type() == FieldDescriptor::TYPE_MESSAGE) {
p->Emit( p->Emit(
R"cc( R"cc(
const auto& repfield = this->_internal_$name$().Get(i); const auto& repfield = this_._internal_$name$().Get(i);
target = target =
$pbi$::WireFormatLite::InternalWrite$declared_type$( $pbi$::WireFormatLite::InternalWrite$declared_type$(
$number$, repfield, repfield.GetCachedSize(), $number$, repfield, repfield.GetCachedSize(),
@ -977,14 +978,14 @@ void RepeatedMessage::GenerateSerializeWithCachedSizesToArray(
target = stream->EnsureSpace(target); target = stream->EnsureSpace(target);
target = target =
$pbi$::WireFormatLite::InternalWrite$declared_type$( $pbi$::WireFormatLite::InternalWrite$declared_type$(
$number$, this->_internal_$name$().Get(i), $number$, this_._internal_$name$().Get(i),
target, stream); target, stream);
)cc"); )cc");
} }
}}}, }}},
R"cc( R"cc(
for (unsigned i = 0, n = static_cast<unsigned>( for (unsigned i = 0, n = static_cast<unsigned>(
this->_internal_$name$_size()); this_._internal_$name$_size());
i < n; i++) { i < n; i++) {
$serialize_field$; $serialize_field$;
} }
@ -995,8 +996,8 @@ void RepeatedMessage::GenerateSerializeWithCachedSizesToArray(
void RepeatedMessage::GenerateByteSize(io::Printer* p) const { void RepeatedMessage::GenerateByteSize(io::Printer* p) const {
p->Emit( p->Emit(
R"cc( R"cc(
total_size += $tag_size$UL * this->_internal_$name$_size(); total_size += $tag_size$UL * this_._internal_$name$_size();
for (const auto& msg : this->_internal$_weak$_$name$()) { for (const auto& msg : this_._internal$_weak$_$name$()) {
total_size += $pbi$::WireFormatLite::$declared_type$Size(msg); total_size += $pbi$::WireFormatLite::$declared_type$Size(msg);
} }
)cc"); )cc");

@ -248,13 +248,13 @@ void SingularPrimitive::GenerateSerializeWithCachedSizesToArray(
p->Emit(R"cc( p->Emit(R"cc(
target = ::$proto_ns$::internal::WireFormatLite:: target = ::$proto_ns$::internal::WireFormatLite::
Write$declared_type$ToArrayWithField<$number$>( Write$declared_type$ToArrayWithField<$number$>(
stream, this->_internal_$name$(), target); stream, this_._internal_$name$(), target);
)cc"); )cc");
} else { } else {
p->Emit(R"cc( p->Emit(R"cc(
target = stream->EnsureSpace(target); target = stream->EnsureSpace(target);
target = ::_pbi::WireFormatLite::Write$DeclaredType$ToArray( target = ::_pbi::WireFormatLite::Write$DeclaredType$ToArray(
$number$, this->_internal_$name$(), target); $number$, this_._internal_$name$(), target);
)cc"); )cc");
} }
} }
@ -275,14 +275,14 @@ void SingularPrimitive::GenerateByteSize(io::Printer* p) const {
if (tag_size == 1) { if (tag_size == 1) {
p->Emit(R"cc( p->Emit(R"cc(
total_size += ::_pbi::WireFormatLite::$DeclaredType$SizePlusOne( total_size += ::_pbi::WireFormatLite::$DeclaredType$SizePlusOne(
this->_internal_$name$()); this_._internal_$name$());
)cc"); )cc");
return; return;
} }
p->Emit(R"cc( p->Emit(R"cc(
total_size += $kTagBytes$ + ::_pbi::WireFormatLite::$DeclaredType$Size( total_size += $kTagBytes$ + ::_pbi::WireFormatLite::$DeclaredType$Size(
this->_internal_$name$()); this_._internal_$name$());
)cc"); )cc");
} }
@ -546,10 +546,10 @@ void RepeatedPrimitive::GenerateSerializeWithCachedSizesToArray(
io::Printer* p) const { io::Printer* p) const {
if (!field_->is_packed()) { if (!field_->is_packed()) {
p->Emit(R"cc( p->Emit(R"cc(
for (int i = 0, n = this->_internal_$name$_size(); i < n; ++i) { for (int i = 0, n = this_._internal_$name$_size(); i < n; ++i) {
target = stream->EnsureSpace(target); target = stream->EnsureSpace(target);
target = ::_pbi::WireFormatLite::Write$DeclaredType$ToArray( target = ::_pbi::WireFormatLite::Write$DeclaredType$ToArray(
$number$, this->_internal_$name$().Get(i), target); $number$, this_._internal_$name$().Get(i), target);
} }
)cc"); )cc");
return; return;
@ -557,8 +557,8 @@ void RepeatedPrimitive::GenerateSerializeWithCachedSizesToArray(
if (FixedSize(field_->type()).has_value()) { if (FixedSize(field_->type()).has_value()) {
p->Emit(R"cc( p->Emit(R"cc(
if (this->_internal_$name$_size() > 0) { if (this_._internal_$name$_size() > 0) {
target = stream->WriteFixedPacked($number$, _internal_$name$(), target); target = stream->WriteFixedPacked($number$, this_._internal_$name$(), target);
} }
)cc"); )cc");
return; return;
@ -569,11 +569,11 @@ void RepeatedPrimitive::GenerateSerializeWithCachedSizesToArray(
{"byte_size", {"byte_size",
[&] { [&] {
if (HasCachedSize()) { if (HasCachedSize()) {
p->Emit(R"cc($_field_cached_byte_size_$.Get();)cc"); p->Emit(R"cc(this_.$_field_cached_byte_size_$.Get();)cc");
} else { } else {
p->Emit(R"cc( p->Emit(R"cc(
::_pbi::WireFormatLite::$DeclaredType$Size( ::_pbi::WireFormatLite::$DeclaredType$Size(
this->_internal_$name$()); this_._internal_$name$());
)cc"); )cc");
} }
}}, }},
@ -583,7 +583,7 @@ void RepeatedPrimitive::GenerateSerializeWithCachedSizesToArray(
int byte_size = $byte_size$; int byte_size = $byte_size$;
if (byte_size > 0) { if (byte_size > 0) {
target = stream->Write$DeclaredType$Packed( target = stream->Write$DeclaredType$Packed(
$number$, _internal_$name$(), byte_size, target); $number$, this_._internal_$name$(), byte_size, target);
} }
} }
)cc"); )cc");
@ -598,12 +598,12 @@ void RepeatedPrimitive::GenerateByteSize(io::Printer* p) const {
if (fixed_size.has_value()) { if (fixed_size.has_value()) {
p->Emit({{"kFixed", *fixed_size}}, R"cc( p->Emit({{"kFixed", *fixed_size}}, R"cc(
std::size_t{$kFixed$} * std::size_t{$kFixed$} *
::_pbi::FromIntSize(this->_internal_$name$_size()) ::_pbi::FromIntSize(this_._internal_$name$_size())
)cc"); )cc");
} else { } else {
p->Emit(R"cc( p->Emit(R"cc(
::_pbi::WireFormatLite::$DeclaredType$Size( ::_pbi::WireFormatLite::$DeclaredType$Size(
this->_internal_$name$()) this_._internal_$name$())
)cc"); )cc");
} }
}} // Here and below, we need to disable the default ;-chomping }} // Here and below, we need to disable the default ;-chomping
@ -613,7 +613,8 @@ void RepeatedPrimitive::GenerateByteSize(io::Printer* p) const {
[&] { [&] {
if (!HasCachedSize()) return; if (!HasCachedSize()) return;
p->Emit(R"cc( p->Emit(R"cc(
$_field_cached_byte_size_$.Set(::_pbi::ToCachedSize(data_size)); this_.$_field_cached_byte_size_$.Set(
::_pbi::ToCachedSize(data_size));
)cc"); )cc");
}}, }},
Sub{"tag_size", Sub{"tag_size",
@ -628,7 +629,7 @@ void RepeatedPrimitive::GenerateByteSize(io::Printer* p) const {
} else { } else {
p->Emit(R"cc( p->Emit(R"cc(
std::size_t{$kTagBytes$} * std::size_t{$kTagBytes$} *
::_pbi::FromIntSize(this->_internal_$name$_size()); ::_pbi::FromIntSize(this_._internal_$name$_size());
)cc"); )cc");
} }
}} }}

@ -133,7 +133,7 @@ class SingularString : public FieldGeneratorBase {
void GenerateByteSize(io::Printer* p) const override { void GenerateByteSize(io::Printer* p) const override {
p->Emit(R"cc( p->Emit(R"cc(
total_size += $kTagBytes$ + $pbi$::WireFormatLite::$DeclaredType$Size( total_size += $kTagBytes$ + $pbi$::WireFormatLite::$DeclaredType$Size(
this->_internal_$name$()); this_._internal_$name$());
)cc"); )cc");
} }
@ -688,7 +688,7 @@ void SingularString::GenerateSerializeWithCachedSizesToArray(
"static_cast<int>(_s.length()),"); "static_cast<int>(_s.length()),");
}}}, }}},
R"cc( R"cc(
const std::string& _s = this->_internal_$name$(); const std::string& _s = this_._internal_$name$();
$utf8_check$; $utf8_check$;
target = stream->Write$DeclaredType$MaybeAliased($number$, _s, target); target = stream->Write$DeclaredType$MaybeAliased($number$, _s, target);
)cc"); )cc");
@ -804,10 +804,11 @@ class RepeatedString : public FieldGeneratorBase {
void GenerateByteSize(io::Printer* p) const override { void GenerateByteSize(io::Printer* p) const override {
p->Emit(R"cc( p->Emit(R"cc(
total_size += $kTagBytes$ * $pbi$::FromIntSize(_internal_$name$().size()); total_size +=
for (int i = 0, n = _internal_$name$().size(); i < n; ++i) { $kTagBytes$ * $pbi$::FromIntSize(this_._internal_$name$().size());
for (int i = 0, n = this_._internal_$name$().size(); i < n; ++i) {
total_size += $pbi$::WireFormatLite::$DeclaredType$Size( total_size += $pbi$::WireFormatLite::$DeclaredType$Size(
_internal_$name$().Get(i)); this_._internal_$name$().Get(i));
} }
)cc"); )cc");
} }
@ -974,8 +975,8 @@ void RepeatedString::GenerateSerializeWithCachedSizesToArray(
"s.data(), static_cast<int>(s.length()),"); "s.data(), static_cast<int>(s.length()),");
}}}, }}},
R"cc( R"cc(
for (int i = 0, n = this->_internal_$name$_size(); i < n; ++i) { for (int i = 0, n = this_._internal_$name$_size(); i < n; ++i) {
const auto& s = this->_internal_$name$().Get(i); const auto& s = this_._internal_$name$().Get(i);
$utf8_check$; $utf8_check$;
target = stream->Write$DeclaredType$($number$, s, target); target = stream->Write$DeclaredType$($number$, s, target);
} }

@ -133,7 +133,7 @@ class SingularStringView : public FieldGeneratorBase {
void GenerateByteSize(io::Printer* p) const override { void GenerateByteSize(io::Printer* p) const override {
p->Emit(R"cc( p->Emit(R"cc(
total_size += $kTagBytes$ + $pbi$::WireFormatLite::$DeclaredType$Size( total_size += $kTagBytes$ + $pbi$::WireFormatLite::$DeclaredType$Size(
this->_internal_$name$()); this_._internal_$name$());
)cc"); )cc");
} }
@ -515,7 +515,7 @@ void SingularStringView::GenerateSerializeWithCachedSizesToArray(
"static_cast<int>(_s.length()),"); "static_cast<int>(_s.length()),");
}}}, }}},
R"cc( R"cc(
const std::string& _s = this->_internal_$name$(); const std::string& _s = this_._internal_$name$();
$utf8_check$; $utf8_check$;
target = stream->Write$DeclaredType$MaybeAliased($number$, _s, target); target = stream->Write$DeclaredType$MaybeAliased($number$, _s, target);
)cc"); )cc");
@ -631,10 +631,11 @@ class RepeatedStringView : public FieldGeneratorBase {
void GenerateByteSize(io::Printer* p) const override { void GenerateByteSize(io::Printer* p) const override {
p->Emit(R"cc( p->Emit(R"cc(
total_size += $kTagBytes$ * $pbi$::FromIntSize(_internal_$name$().size()); total_size +=
for (int i = 0, n = _internal_$name$().size(); i < n; ++i) { $kTagBytes$ * $pbi$::FromIntSize(this_._internal_$name$().size());
for (int i = 0, n = this_._internal_$name$().size(); i < n; ++i) {
total_size += $pbi$::WireFormatLite::$DeclaredType$Size( total_size += $pbi$::WireFormatLite::$DeclaredType$Size(
_internal_$name$().Get(i)); this_._internal_$name$().Get(i));
} }
)cc"); )cc");
} }
@ -816,8 +817,8 @@ void RepeatedStringView::GenerateSerializeWithCachedSizesToArray(
"s.data(), static_cast<int>(s.length()),"); "s.data(), static_cast<int>(s.length()),");
}}}, }}},
R"cc( R"cc(
for (int i = 0, n = this->_internal_$name$_size(); i < n; ++i) { for (int i = 0, n = this_._internal_$name$_size(); i < n; ++i) {
const auto& s = this->_internal_$name$().Get(i); const auto& s = this_._internal_$name$().Get(i);
$utf8_check$; $utf8_check$;
target = stream->Write$DeclaredType$($number$, s, target); target = stream->Write$DeclaredType$($number$, s, target);
} }

@ -209,7 +209,7 @@ void EmitNonDefaultCheck(io::Printer* p, const std::string& prefix,
p->Emit("$prefix$_internal_$name$() != 0"); p->Emit("$prefix$_internal_$name$() != 0");
} }
} else if (field->real_containing_oneof()) { } else if (field->real_containing_oneof()) {
p->Emit("$has_field$"); p->Emit("$prefix$$has_field$");
} }
} }
@ -1760,12 +1760,34 @@ void MessageGenerator::GenerateClassDefinition(io::Printer* p) {
} }
if (!HasSimpleBaseClass(descriptor_, options_)) { if (!HasSimpleBaseClass(descriptor_, options_)) {
// In custom vtable mode, the functions are implemented as static
// functions, which are the ones we put in the custom vtable. The
// non-static functions are small trampolines. In normal mode, the
// functions implemented are the non-static members which are a
// virtual overrides. This reduces the number of functions in the
// binary in both modes.
p->Emit(R"cc( p->Emit(R"cc(
ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL;
::size_t ByteSizeLong() const PROTOBUF_FINAL; #if defined(PROTOBUF_CUSTOM_VTABLE)
$uint8$* _InternalSerialize($uint8$* target, private:
::$proto_ns$::io::EpsCopyOutputStream* static ::size_t ByteSizeLong(const ::$proto_ns$::MessageLite& msg);
stream) const PROTOBUF_FINAL; static $uint8$* _InternalSerialize(
const MessageLite& msg, $uint8$* target,
::$proto_ns$::io::EpsCopyOutputStream* stream);
public:
::size_t ByteSizeLong() const { return ByteSizeLong(*this); }
$uint8$* _InternalSerialize(
$uint8$* target,
::$proto_ns$::io::EpsCopyOutputStream* stream) const {
return _InternalSerialize(*this, target, stream);
}
#else // PROTOBUF_CUSTOM_VTABLE
::size_t ByteSizeLong() const final;
$uint8$* _InternalSerialize(
$uint8$* target,
::$proto_ns$::io::EpsCopyOutputStream* stream) const final;
#endif // PROTOBUF_CUSTOM_VTABLE
)cc"); )cc");
} }
}}, }},
@ -3711,9 +3733,8 @@ void MessageGenerator::GenerateClassData(io::Printer* p) {
if (HasGeneratedMethods(descriptor_->file(), options_) && if (HasGeneratedMethods(descriptor_->file(), options_) &&
!IsMapEntryMessage(descriptor_)) { !IsMapEntryMessage(descriptor_)) {
p->Emit(R"cc( p->Emit(R"cc(
$superclass$::GetClearImpl<$classname$>(), $superclass$::GetClearImpl<$classname$>(), &$classname$::ByteSizeLong,
$superclass$::GetByteSizeLongImpl<$classname$>(), &$classname$::_InternalSerialize,
$superclass$::GetSerializeImpl<$classname$>(),
)cc"); )cc");
} else { } else {
p->Emit(R"cc( p->Emit(R"cc(
@ -4158,7 +4179,7 @@ void MessageGenerator::GenerateSerializeOneofFields(
} }
}}}, }}},
R"cc( R"cc(
switch ($name$_case()) { switch (this_.$name$_case()) {
$cases$; $cases$;
default: default:
break; break;
@ -4193,7 +4214,8 @@ void MessageGenerator::GenerateSerializeOneField(io::Printer* p,
if (cached_has_bits_index == has_bit_index / 32) { if (cached_has_bits_index == has_bit_index / 32) {
p->Emit("cached_has_bits & $has_mask$"); p->Emit("cached_has_bits & $has_mask$");
} else { } else {
p->Emit("($has_bits$[$has_array_index$] & $has_mask$) != 0"); p->Emit(
"(this_.$has_bits$[$has_array_index$] & $has_mask$) != 0");
} }
}}, }},
}, },
@ -4203,7 +4225,7 @@ void MessageGenerator::GenerateSerializeOneField(io::Printer* p,
} }
)cc"); )cc");
} else if (field->is_optional()) { } else if (field->is_optional()) {
bool have_enclosing_if = MayEmitIfNonDefaultCheck(p, "this->", field); bool have_enclosing_if = MayEmitIfNonDefaultCheck(p, "this_.", field);
if (have_enclosing_if) p->Indent(); if (have_enclosing_if) p->Indent();
emit_body(); emit_body();
if (have_enclosing_if) { if (have_enclosing_if) {
@ -4224,7 +4246,7 @@ void MessageGenerator::GenerateSerializeOneExtensionRange(io::Printer* p,
p->Emit({{"start", start}, {"end", end}}, p->Emit({{"start", start}, {"end", end}},
R"cc( R"cc(
// Extension range [$start$, $end$) // Extension range [$start$, $end$)
target = $extensions$._InternalSerialize( target = this_.$extensions$._InternalSerialize(
internal_default_instance(), $start$, $end$, target, stream); internal_default_instance(), $start$, $end$, target, stream);
)cc"); )cc");
} }
@ -4234,14 +4256,23 @@ void MessageGenerator::GenerateSerializeWithCachedSizesToArray(io::Printer* p) {
if (descriptor_->options().message_set_wire_format()) { if (descriptor_->options().message_set_wire_format()) {
// Special-case MessageSet. // Special-case MessageSet.
p->Emit(R"cc( p->Emit(R"cc(
#if defined(PROTOBUF_CUSTOM_VTABLE)
$uint8$* $classname$::_InternalSerialize(
const MessageLite& base, $uint8$* target,
::$proto_ns$::io::EpsCopyOutputStream* stream) {
const $classname$& this_ = static_cast<const $classname$&>(base);
#else // PROTOBUF_CUSTOM_VTABLE
$uint8$* $classname$::_InternalSerialize( $uint8$* $classname$::_InternalSerialize(
$uint8$* target, $uint8$* target,
::$proto_ns$::io::EpsCopyOutputStream* stream) const { ::$proto_ns$::io::EpsCopyOutputStream* stream) const {
const $classname$& this_ = *this;
#endif // PROTOBUF_CUSTOM_VTABLE
$annotate_serialize$ target = $annotate_serialize$ target =
$extensions$.InternalSerializeMessageSetWithCachedSizesToArray( this_.$extensions$
internal_default_instance(), target, stream); .InternalSerializeMessageSetWithCachedSizesToArray(
internal_default_instance(), target, stream);
target = ::_pbi::InternalSerializeUnknownMessageSetItemsToArray( target = ::_pbi::InternalSerializeUnknownMessageSetItemsToArray(
$unknown_fields$, target, stream); this_.$unknown_fields$, target, stream);
return target; return target;
} }
)cc"); )cc");
@ -4272,9 +4303,17 @@ void MessageGenerator::GenerateSerializeWithCachedSizesToArray(io::Printer* p) {
}}, }},
}, },
R"cc( R"cc(
#if defined(PROTOBUF_CUSTOM_VTABLE)
$uint8$* $classname$::_InternalSerialize(
const MessageLite& base, $uint8$* target,
::$proto_ns$::io::EpsCopyOutputStream* stream) {
const $classname$& this_ = static_cast<const $classname$&>(base);
#else // PROTOBUF_CUSTOM_VTABLE
$uint8$* $classname$::_InternalSerialize( $uint8$* $classname$::_InternalSerialize(
$uint8$* target, $uint8$* target,
::$proto_ns$::io::EpsCopyOutputStream* stream) const { ::$proto_ns$::io::EpsCopyOutputStream* stream) const {
const $classname$& this_ = *this;
#endif // PROTOBUF_CUSTOM_VTABLE
$annotate_serialize$; $annotate_serialize$;
// @@protoc_insertion_point(serialize_to_array_start:$full_name$) // @@protoc_insertion_point(serialize_to_array_start:$full_name$)
$ifdef$; $ifdef$;
@ -4318,7 +4357,7 @@ void MessageGenerator::GenerateSerializeWithCachedSizesBody(io::Printer* p) {
int new_index = has_bit_index / 32; int new_index = has_bit_index / 32;
p_->Emit({{"index", new_index}}, p_->Emit({{"index", new_index}},
R"cc( R"cc(
cached_has_bits = _impl_._has_bits_[$index$]; cached_has_bits = this_._impl_._has_bits_[$index$];
)cc"); )cc");
cached_has_bit_index_ = new_index; cached_has_bit_index_ = new_index;
} }
@ -4429,7 +4468,8 @@ void MessageGenerator::GenerateSerializeWithCachedSizesBody(io::Printer* p) {
[&] { [&] {
if (num_weak_fields_ == 0) return; if (num_weak_fields_ == 0) return;
p->Emit(R"cc( p->Emit(R"cc(
::_pbi::WeakFieldMap::FieldWriter field_writer($weak_field_map$); ::_pbi::WeakFieldMap::FieldWriter field_writer(
this_.$weak_field_map$);
)cc"); )cc");
}}, }},
{"handle_lazy_fields", {"handle_lazy_fields",
@ -4469,13 +4509,13 @@ void MessageGenerator::GenerateSerializeWithCachedSizesBody(io::Printer* p) {
p->Emit(R"cc( p->Emit(R"cc(
target = target =
::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
$unknown_fields$, target, stream); this_.$unknown_fields$, target, stream);
)cc"); )cc");
} else { } else {
p->Emit(R"cc( p->Emit(R"cc(
target = stream->WriteRaw( target = stream->WriteRaw(
$unknown_fields$.data(), this_.$unknown_fields$.data(),
static_cast<int>($unknown_fields$.size()), target); static_cast<int>(this_.$unknown_fields$.size()), target);
)cc"); )cc");
} }
}}, }},
@ -4486,7 +4526,7 @@ void MessageGenerator::GenerateSerializeWithCachedSizesBody(io::Printer* p) {
(void)cached_has_bits; (void)cached_has_bits;
$handle_lazy_fields$; $handle_lazy_fields$;
if (PROTOBUF_PREDICT_FALSE($have_unknown_fields$)) { if (PROTOBUF_PREDICT_FALSE(this_.$have_unknown_fields$)) {
$handle_unknown_fields$; $handle_unknown_fields$;
} }
)cc"); )cc");
@ -4517,7 +4557,8 @@ void MessageGenerator::GenerateSerializeWithCachedSizesBodyShuffled(
[&] { [&] {
if (num_weak_fields_ == 0) return; if (num_weak_fields_ == 0) return;
p->Emit(R"cc( p->Emit(R"cc(
::_pbi::WeakFieldMap::FieldWriter field_writer($weak_field_map$); ::_pbi::WeakFieldMap::FieldWriter field_writer(
this_.$weak_field_map$);
)cc"); )cc");
}}, }},
{"ordered_cases", {"ordered_cases",
@ -4558,13 +4599,13 @@ void MessageGenerator::GenerateSerializeWithCachedSizesBodyShuffled(
p->Emit(R"cc( p->Emit(R"cc(
target = target =
::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
$unknown_fields$, target, stream); this_.$unknown_fields$, target, stream);
)cc"); )cc");
} else { } else {
p->Emit(R"cc( p->Emit(R"cc(
target = stream->WriteRaw( target = stream->WriteRaw(
$unknown_fields$.data(), this_.$unknown_fields$.data(),
static_cast<int>($unknown_fields$.size()), target); static_cast<int>(this_.$unknown_fields$.size()), target);
)cc"); )cc");
} }
}}, }},
@ -4580,7 +4621,7 @@ void MessageGenerator::GenerateSerializeWithCachedSizesBodyShuffled(
} }
} }
} }
if (PROTOBUF_PREDICT_FALSE($have_unknown_fields$)) { if (PROTOBUF_PREDICT_FALSE(this_.$have_unknown_fields$)) {
$handle_unknown_fields$; $handle_unknown_fields$;
} }
)cc"); )cc");
@ -4609,15 +4650,22 @@ void MessageGenerator::GenerateByteSize(io::Printer* p) {
// Special-case MessageSet. // Special-case MessageSet.
p->Emit( p->Emit(
R"cc( R"cc(
PROTOBUF_NOINLINE ::size_t $classname$::ByteSizeLong() const { #if defined(PROTOBUF_CUSTOM_VTABLE)
::size_t $classname$::ByteSizeLong(const MessageLite& base) {
const $classname$& this_ = static_cast<const $classname$&>(base);
#else // PROTOBUF_CUSTOM_VTABLE
::size_t $classname$::ByteSizeLong() const {
const $classname$& this_ = *this;
#endif // PROTOBUF_CUSTOM_VTABLE
$WeakDescriptorSelfPin$; $WeakDescriptorSelfPin$;
$annotate_bytesize$; $annotate_bytesize$;
// @@protoc_insertion_point(message_set_byte_size_start:$full_name$) // @@protoc_insertion_point(message_set_byte_size_start:$full_name$)
::size_t total_size = $extensions$.MessageSetByteSize(); ::size_t total_size = this_.$extensions$.MessageSetByteSize();
if ($have_unknown_fields$) { if (this_.$have_unknown_fields$) {
total_size += ::_pbi::ComputeUnknownMessageSetItemsSize($unknown_fields$); total_size += ::_pbi::ComputeUnknownMessageSetItemsSize(
this_.$unknown_fields$);
} }
$cached_size$.Set(::_pbi::ToCachedSize(total_size)); this_.$cached_size$.Set(::_pbi::ToCachedSize(total_size));
return total_size; return total_size;
} }
)cc"); )cc");
@ -4637,7 +4685,7 @@ void MessageGenerator::GenerateByteSize(io::Printer* p) {
[&] { [&] {
if (descriptor_->extension_range_count() == 0) return; if (descriptor_->extension_range_count() == 0) return;
p->Emit(R"cc( p->Emit(R"cc(
total_size += $extensions$.ByteSize(); total_size += this_.$extensions$.ByteSize();
)cc"); )cc");
}}, }},
{"prefetch", {"prefetch",
@ -4663,8 +4711,7 @@ void MessageGenerator::GenerateByteSize(io::Printer* p) {
return; return;
} }
p->Emit(R"cc( p->Emit(R"cc(
::_pbi::Prefetch5LinesFrom7Lines( ::_pbi::Prefetch5LinesFrom7Lines(&this_);
reinterpret_cast<const void*>(this));
)cc"); )cc");
}}, }},
{"handle_fields", {"handle_fields",
@ -4678,7 +4725,7 @@ void MessageGenerator::GenerateByteSize(io::Printer* p) {
FindNextUnequalChunk(it, end, MayGroupChunksForHaswordsCheck); FindNextUnequalChunk(it, end, MayGroupChunksForHaswordsCheck);
bool has_haswords_check = bool has_haswords_check =
MaybeEmitHaswordsCheck(it, next, options_, has_bit_indices_, MaybeEmitHaswordsCheck(it, next, options_, has_bit_indices_,
cached_has_word_index, "", p); cached_has_word_index, "this_.", p);
while (it != next) { while (it != next) {
const auto& fields = it->fields; const auto& fields = it->fields;
@ -4715,7 +4762,8 @@ void MessageGenerator::GenerateByteSize(io::Printer* p) {
cached_has_word_index = (has_bit_index / 32); cached_has_word_index = (has_bit_index / 32);
p->Emit({{"index", cached_has_word_index}}, p->Emit({{"index", cached_has_word_index}},
R"cc( R"cc(
cached_has_bits = $has_bits$[$index$]; cached_has_bits =
this_.$has_bits$[$index$];
)cc"); )cc");
}}, }},
{"check_if_field_present", {"check_if_field_present",
@ -4739,7 +4787,7 @@ void MessageGenerator::GenerateByteSize(io::Printer* p) {
// value. // value.
p->Emit({{"non_default_check", p->Emit({{"non_default_check",
[&] { [&] {
EmitNonDefaultCheck(p, "this->", EmitNonDefaultCheck(p, "this_.",
field); field);
}}}, }}},
"if ($non_default_check$)"); "if ($non_default_check$)");
@ -4764,7 +4812,7 @@ void MessageGenerator::GenerateByteSize(io::Printer* p) {
cached_has_word_index = HasWordIndex(fields.front()); cached_has_word_index = HasWordIndex(fields.front());
p->Emit({{"index", cached_has_word_index}}, p->Emit({{"index", cached_has_word_index}},
R"cc( R"cc(
cached_has_bits = $has_bits$[$index$]; cached_has_bits = this_.$has_bits$[$index$];
)cc"); )cc");
}}, }},
{"check_if_chunk_present", {"check_if_chunk_present",
@ -4840,7 +4888,7 @@ void MessageGenerator::GenerateByteSize(io::Printer* p) {
} }
}}}, }}},
R"cc( R"cc(
switch ($oneof_name$_case()) { switch (this_.$oneof_name$_case()) {
$case_per_field$; $case_per_field$;
case $oneof_case_name$_NOT_SET: { case $oneof_case_name$_NOT_SET: {
break; break;
@ -4854,7 +4902,7 @@ void MessageGenerator::GenerateByteSize(io::Printer* p) {
if (num_weak_fields_ == 0) return; if (num_weak_fields_ == 0) return;
// TagSize + MessageSize // TagSize + MessageSize
p->Emit(R"cc( p->Emit(R"cc(
total_size += $weak_field_map$.ByteSizeLong(); total_size += this_.$weak_field_map$.ByteSizeLong();
)cc"); )cc");
}}, }},
{"handle_unknown_fields", {"handle_unknown_fields",
@ -4864,7 +4912,8 @@ void MessageGenerator::GenerateByteSize(io::Printer* p) {
// path of unknown fields in tail position. This allows for // path of unknown fields in tail position. This allows for
// better code generation of this function for simple protos. // better code generation of this function for simple protos.
p->Emit(R"cc( p->Emit(R"cc(
return MaybeComputeUnknownFieldsSize(total_size, &$cached_size$); return this_.MaybeComputeUnknownFieldsSize(total_size,
&this_.$cached_size$);
)cc"); )cc");
} else { } else {
// We update _cached_size_ even though this is a const method. // We update _cached_size_ even though this is a const method.
@ -4877,16 +4926,22 @@ void MessageGenerator::GenerateByteSize(io::Printer* p) {
// even relaxed memory order might have perf impact to replace it // even relaxed memory order might have perf impact to replace it
// with ordinary loads and stores. // with ordinary loads and stores.
p->Emit(R"cc( p->Emit(R"cc(
if (PROTOBUF_PREDICT_FALSE($have_unknown_fields$)) { if (PROTOBUF_PREDICT_FALSE(this_.$have_unknown_fields$)) {
total_size += $unknown_fields$.size(); total_size += this_.$unknown_fields$.size();
} }
$cached_size$.Set(::_pbi::ToCachedSize(total_size)); this_.$cached_size$.Set(::_pbi::ToCachedSize(total_size));
return total_size; return total_size;
)cc"); )cc");
} }
}}}, }}},
R"cc( R"cc(
#if defined(PROTOBUF_CUSTOM_VTABLE)
::size_t $classname$::ByteSizeLong(const MessageLite& base) {
const $classname$& this_ = static_cast<const $classname$&>(base);
#else // PROTOBUF_CUSTOM_VTABLE
::size_t $classname$::ByteSizeLong() const { ::size_t $classname$::ByteSizeLong() const {
const $classname$& this_ = *this;
#endif // PROTOBUF_CUSTOM_VTABLE
$WeakDescriptorSelfPin$; $WeakDescriptorSelfPin$;
$annotate_bytesize$; $annotate_bytesize$;
// @@protoc_insertion_point(message_byte_size_start:$full_name$) // @@protoc_insertion_point(message_byte_size_start:$full_name$)

@ -148,14 +148,14 @@ std::vector<Sub> MakeTrackerCalls(const Descriptor* message,
return GenerateTrackerCalls( return GenerateTrackerCalls(
opts, message, absl::nullopt, opts, message, absl::nullopt,
{ {
Call("serialize", "OnSerialize"), Call("serialize", "OnSerialize").This("&this_"),
Call("deserialize", "OnDeserialize").This("_this"), Call("deserialize", "OnDeserialize").This("_this"),
// TODO: Ideally annotate_reflection should not exist and we // TODO: Ideally annotate_reflection should not exist and we
// need to annotate all reflective calls on our own, however, as this // need to annotate all reflective calls on our own, however, as this
// is a cause for side effects, i.e. reading values dynamically, we // is a cause for side effects, i.e. reading values dynamically, we
// want the users know that dynamic access can happen. // want the users know that dynamic access can happen.
Call("reflection", "OnGetMetadata").This(absl::nullopt), Call("reflection", "OnGetMetadata").This(absl::nullopt),
Call("bytesize", "OnByteSize"), Call("bytesize", "OnByteSize").This("&this_"),
Call("mergefrom", "OnMergeFrom").This("_this").Arg("&from"), Call("mergefrom", "OnMergeFrom").This("_this").Arg("&from"),
Call("unknown_fields", "OnUnknownFields"), Call("unknown_fields", "OnUnknownFields"),
Call("mutable_unknown_fields", "OnMutableUnknownFields"), Call("mutable_unknown_fields", "OnMutableUnknownFields"),

@ -206,9 +206,8 @@ const ::google::protobuf::MessageLite::ClassDataFull
#if defined(PROTOBUF_CUSTOM_VTABLE) #if defined(PROTOBUF_CUSTOM_VTABLE)
::google::protobuf::Message::GetDeleteImpl<JavaFeatures>(), ::google::protobuf::Message::GetDeleteImpl<JavaFeatures>(),
::google::protobuf::Message::GetNewImpl<JavaFeatures>(), ::google::protobuf::Message::GetNewImpl<JavaFeatures>(),
::google::protobuf::Message::GetClearImpl<JavaFeatures>(), ::google::protobuf::Message::GetClearImpl<JavaFeatures>(), &JavaFeatures::ByteSizeLong,
::google::protobuf::Message::GetByteSizeLongImpl<JavaFeatures>(), &JavaFeatures::_InternalSerialize,
::google::protobuf::Message::GetSerializeImpl<JavaFeatures>(),
#endif // PROTOBUF_CUSTOM_VTABLE #endif // PROTOBUF_CUSTOM_VTABLE
PROTOBUF_FIELD_OFFSET(JavaFeatures, _impl_._cached_size_), PROTOBUF_FIELD_OFFSET(JavaFeatures, _impl_._cached_size_),
false, false,
@ -279,61 +278,75 @@ PROTOBUF_NOINLINE void JavaFeatures::Clear() {
_internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>();
} }
::uint8_t* JavaFeatures::_InternalSerialize( #if defined(PROTOBUF_CUSTOM_VTABLE)
::uint8_t* target, ::uint8_t* JavaFeatures::_InternalSerialize(
::google::protobuf::io::EpsCopyOutputStream* stream) const { const MessageLite& base, ::uint8_t* target,
// @@protoc_insertion_point(serialize_to_array_start:pb.JavaFeatures) ::google::protobuf::io::EpsCopyOutputStream* stream) {
::uint32_t cached_has_bits = 0; const JavaFeatures& this_ = static_cast<const JavaFeatures&>(base);
(void)cached_has_bits; #else // PROTOBUF_CUSTOM_VTABLE
::uint8_t* JavaFeatures::_InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const {
const JavaFeatures& this_ = *this;
#endif // PROTOBUF_CUSTOM_VTABLE
// @@protoc_insertion_point(serialize_to_array_start:pb.JavaFeatures)
::uint32_t cached_has_bits = 0;
(void)cached_has_bits;
cached_has_bits = _impl_._has_bits_[0]; cached_has_bits = this_._impl_._has_bits_[0];
// optional bool legacy_closed_enum = 1 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = { // optional bool legacy_closed_enum = 1 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = {
if (cached_has_bits & 0x00000001u) { if (cached_has_bits & 0x00000001u) {
target = stream->EnsureSpace(target); target = stream->EnsureSpace(target);
target = ::_pbi::WireFormatLite::WriteBoolToArray( target = ::_pbi::WireFormatLite::WriteBoolToArray(
1, this->_internal_legacy_closed_enum(), target); 1, this_._internal_legacy_closed_enum(), target);
} }
// optional .pb.JavaFeatures.Utf8Validation utf8_validation = 2 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = { // optional .pb.JavaFeatures.Utf8Validation utf8_validation = 2 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = {
if (cached_has_bits & 0x00000002u) { if (cached_has_bits & 0x00000002u) {
target = stream->EnsureSpace(target); target = stream->EnsureSpace(target);
target = ::_pbi::WireFormatLite::WriteEnumToArray( target = ::_pbi::WireFormatLite::WriteEnumToArray(
2, this->_internal_utf8_validation(), target); 2, this_._internal_utf8_validation(), target);
} }
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { if (PROTOBUF_PREDICT_FALSE(this_._internal_metadata_.have_unknown_fields())) {
target = target =
::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); this_._internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream);
} }
// @@protoc_insertion_point(serialize_to_array_end:pb.JavaFeatures) // @@protoc_insertion_point(serialize_to_array_end:pb.JavaFeatures)
return target; return target;
} }
::size_t JavaFeatures::ByteSizeLong() const { #if defined(PROTOBUF_CUSTOM_VTABLE)
// @@protoc_insertion_point(message_byte_size_start:pb.JavaFeatures) ::size_t JavaFeatures::ByteSizeLong(const MessageLite& base) {
::size_t total_size = 0; const JavaFeatures& this_ = static_cast<const JavaFeatures&>(base);
#else // PROTOBUF_CUSTOM_VTABLE
::size_t JavaFeatures::ByteSizeLong() const {
const JavaFeatures& this_ = *this;
#endif // PROTOBUF_CUSTOM_VTABLE
// @@protoc_insertion_point(message_byte_size_start:pb.JavaFeatures)
::size_t total_size = 0;
::uint32_t cached_has_bits = 0; ::uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused // Prevent compiler warnings about cached_has_bits being unused
(void)cached_has_bits; (void)cached_has_bits;
::_pbi::Prefetch5LinesFrom7Lines( ::_pbi::Prefetch5LinesFrom7Lines(&this_);
reinterpret_cast<const void*>(this)); cached_has_bits = this_._impl_._has_bits_[0];
cached_has_bits = _impl_._has_bits_[0]; if (cached_has_bits & 0x00000003u) {
if (cached_has_bits & 0x00000003u) { // optional bool legacy_closed_enum = 1 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = {
// optional bool legacy_closed_enum = 1 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = { if (cached_has_bits & 0x00000001u) {
if (cached_has_bits & 0x00000001u) { total_size += 2;
total_size += 2; }
} // optional .pb.JavaFeatures.Utf8Validation utf8_validation = 2 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = {
// optional .pb.JavaFeatures.Utf8Validation utf8_validation = 2 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = { if (cached_has_bits & 0x00000002u) {
if (cached_has_bits & 0x00000002u) { total_size += 1 +
total_size += 1 + ::_pbi::WireFormatLite::EnumSize(this_._internal_utf8_validation());
::_pbi::WireFormatLite::EnumSize(this->_internal_utf8_validation()); }
} }
} return this_.MaybeComputeUnknownFieldsSize(total_size,
return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); &this_._impl_._cached_size_);
} }
void JavaFeatures::MergeImpl(::google::protobuf::MessageLite& to_msg, const ::google::protobuf::MessageLite& from_msg) { void JavaFeatures::MergeImpl(::google::protobuf::MessageLite& to_msg, const ::google::protobuf::MessageLite& from_msg) {
auto* const _this = static_cast<JavaFeatures*>(&to_msg); auto* const _this = static_cast<JavaFeatures*>(&to_msg);

@ -193,10 +193,26 @@ class PROTOC_EXPORT JavaFeatures final : public ::google::protobuf::Message
return true; return true;
} }
ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL;
::size_t ByteSizeLong() const PROTOBUF_FINAL; #if defined(PROTOBUF_CUSTOM_VTABLE)
::uint8_t* _InternalSerialize(::uint8_t* target, private:
::google::protobuf::io::EpsCopyOutputStream* static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg);
stream) const PROTOBUF_FINAL; static ::uint8_t* _InternalSerialize(
const MessageLite& msg, ::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream);
public:
::size_t ByteSizeLong() const { return ByteSizeLong(*this); }
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const {
return _InternalSerialize(*this, target, stream);
}
#else // PROTOBUF_CUSTOM_VTABLE
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const final;
#endif // PROTOBUF_CUSTOM_VTABLE
int GetCachedSize() const { return _impl_._cached_size_.Get(); } int GetCachedSize() const { return _impl_._cached_size_.Get(); }
private: private:

@ -404,9 +404,8 @@ const ::google::protobuf::MessageLite::ClassDataFull
#if defined(PROTOBUF_CUSTOM_VTABLE) #if defined(PROTOBUF_CUSTOM_VTABLE)
::google::protobuf::Message::GetDeleteImpl<Version>(), ::google::protobuf::Message::GetDeleteImpl<Version>(),
::google::protobuf::Message::GetNewImpl<Version>(), ::google::protobuf::Message::GetNewImpl<Version>(),
::google::protobuf::Message::GetClearImpl<Version>(), ::google::protobuf::Message::GetClearImpl<Version>(), &Version::ByteSizeLong,
::google::protobuf::Message::GetByteSizeLongImpl<Version>(), &Version::_InternalSerialize,
::google::protobuf::Message::GetSerializeImpl<Version>(),
#endif // PROTOBUF_CUSTOM_VTABLE #endif // PROTOBUF_CUSTOM_VTABLE
PROTOBUF_FIELD_OFFSET(Version, _impl_._cached_size_), PROTOBUF_FIELD_OFFSET(Version, _impl_._cached_size_),
false, false,
@ -495,87 +494,101 @@ PROTOBUF_NOINLINE void Version::Clear() {
_internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>();
} }
::uint8_t* Version::_InternalSerialize( #if defined(PROTOBUF_CUSTOM_VTABLE)
::uint8_t* target, ::uint8_t* Version::_InternalSerialize(
::google::protobuf::io::EpsCopyOutputStream* stream) const { const MessageLite& base, ::uint8_t* target,
// @@protoc_insertion_point(serialize_to_array_start:google.protobuf.compiler.Version) ::google::protobuf::io::EpsCopyOutputStream* stream) {
::uint32_t cached_has_bits = 0; const Version& this_ = static_cast<const Version&>(base);
(void)cached_has_bits; #else // PROTOBUF_CUSTOM_VTABLE
::uint8_t* Version::_InternalSerialize(
cached_has_bits = _impl_._has_bits_[0]; ::uint8_t* target,
// optional int32 major = 1; ::google::protobuf::io::EpsCopyOutputStream* stream) const {
if (cached_has_bits & 0x00000002u) { const Version& this_ = *this;
target = ::google::protobuf::internal::WireFormatLite:: #endif // PROTOBUF_CUSTOM_VTABLE
WriteInt32ToArrayWithField<1>( // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.compiler.Version)
stream, this->_internal_major(), target); ::uint32_t cached_has_bits = 0;
} (void)cached_has_bits;
// optional int32 minor = 2; cached_has_bits = this_._impl_._has_bits_[0];
if (cached_has_bits & 0x00000004u) { // optional int32 major = 1;
target = ::google::protobuf::internal::WireFormatLite:: if (cached_has_bits & 0x00000002u) {
WriteInt32ToArrayWithField<2>( target = ::google::protobuf::internal::WireFormatLite::
stream, this->_internal_minor(), target); WriteInt32ToArrayWithField<1>(
} stream, this_._internal_major(), target);
}
// optional int32 patch = 3;
if (cached_has_bits & 0x00000008u) { // optional int32 minor = 2;
target = ::google::protobuf::internal::WireFormatLite:: if (cached_has_bits & 0x00000004u) {
WriteInt32ToArrayWithField<3>( target = ::google::protobuf::internal::WireFormatLite::
stream, this->_internal_patch(), target); WriteInt32ToArrayWithField<2>(
} stream, this_._internal_minor(), target);
}
// optional string suffix = 4;
if (cached_has_bits & 0x00000001u) { // optional int32 patch = 3;
const std::string& _s = this->_internal_suffix(); if (cached_has_bits & 0x00000008u) {
::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(_s.data(), static_cast<int>(_s.length()), ::google::protobuf::internal::WireFormat::SERIALIZE, target = ::google::protobuf::internal::WireFormatLite::
"google.protobuf.compiler.Version.suffix"); WriteInt32ToArrayWithField<3>(
target = stream->WriteStringMaybeAliased(4, _s, target); stream, this_._internal_patch(), target);
} }
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { // optional string suffix = 4;
target = if (cached_has_bits & 0x00000001u) {
::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( const std::string& _s = this_._internal_suffix();
_internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(_s.data(), static_cast<int>(_s.length()), ::google::protobuf::internal::WireFormat::SERIALIZE,
} "google.protobuf.compiler.Version.suffix");
// @@protoc_insertion_point(serialize_to_array_end:google.protobuf.compiler.Version) target = stream->WriteStringMaybeAliased(4, _s, target);
return target; }
}
if (PROTOBUF_PREDICT_FALSE(this_._internal_metadata_.have_unknown_fields())) {
::size_t Version::ByteSizeLong() const { target =
// @@protoc_insertion_point(message_byte_size_start:google.protobuf.compiler.Version) ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
::size_t total_size = 0; this_._internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream);
}
::uint32_t cached_has_bits = 0; // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.compiler.Version)
// Prevent compiler warnings about cached_has_bits being unused return target;
(void)cached_has_bits; }
::_pbi::Prefetch5LinesFrom7Lines( #if defined(PROTOBUF_CUSTOM_VTABLE)
reinterpret_cast<const void*>(this)); ::size_t Version::ByteSizeLong(const MessageLite& base) {
cached_has_bits = _impl_._has_bits_[0]; const Version& this_ = static_cast<const Version&>(base);
if (cached_has_bits & 0x0000000fu) { #else // PROTOBUF_CUSTOM_VTABLE
// optional string suffix = 4; ::size_t Version::ByteSizeLong() const {
if (cached_has_bits & 0x00000001u) { const Version& this_ = *this;
total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( #endif // PROTOBUF_CUSTOM_VTABLE
this->_internal_suffix()); // @@protoc_insertion_point(message_byte_size_start:google.protobuf.compiler.Version)
} ::size_t total_size = 0;
// optional int32 major = 1;
if (cached_has_bits & 0x00000002u) { ::uint32_t cached_has_bits = 0;
total_size += ::_pbi::WireFormatLite::Int32SizePlusOne( // Prevent compiler warnings about cached_has_bits being unused
this->_internal_major()); (void)cached_has_bits;
}
// optional int32 minor = 2; ::_pbi::Prefetch5LinesFrom7Lines(&this_);
if (cached_has_bits & 0x00000004u) { cached_has_bits = this_._impl_._has_bits_[0];
total_size += ::_pbi::WireFormatLite::Int32SizePlusOne( if (cached_has_bits & 0x0000000fu) {
this->_internal_minor()); // optional string suffix = 4;
} if (cached_has_bits & 0x00000001u) {
// optional int32 patch = 3; total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize(
if (cached_has_bits & 0x00000008u) { this_._internal_suffix());
total_size += ::_pbi::WireFormatLite::Int32SizePlusOne( }
this->_internal_patch()); // optional int32 major = 1;
} if (cached_has_bits & 0x00000002u) {
} total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(
return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); this_._internal_major());
} }
// optional int32 minor = 2;
if (cached_has_bits & 0x00000004u) {
total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(
this_._internal_minor());
}
// optional int32 patch = 3;
if (cached_has_bits & 0x00000008u) {
total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(
this_._internal_patch());
}
}
return this_.MaybeComputeUnknownFieldsSize(total_size,
&this_._impl_._cached_size_);
}
void Version::MergeImpl(::google::protobuf::MessageLite& to_msg, const ::google::protobuf::MessageLite& from_msg) { void Version::MergeImpl(::google::protobuf::MessageLite& to_msg, const ::google::protobuf::MessageLite& from_msg) {
auto* const _this = static_cast<Version*>(&to_msg); auto* const _this = static_cast<Version*>(&to_msg);
@ -725,9 +738,8 @@ const ::google::protobuf::MessageLite::ClassDataFull
#if defined(PROTOBUF_CUSTOM_VTABLE) #if defined(PROTOBUF_CUSTOM_VTABLE)
::google::protobuf::Message::GetDeleteImpl<CodeGeneratorRequest>(), ::google::protobuf::Message::GetDeleteImpl<CodeGeneratorRequest>(),
::google::protobuf::Message::GetNewImpl<CodeGeneratorRequest>(), ::google::protobuf::Message::GetNewImpl<CodeGeneratorRequest>(),
::google::protobuf::Message::GetClearImpl<CodeGeneratorRequest>(), ::google::protobuf::Message::GetClearImpl<CodeGeneratorRequest>(), &CodeGeneratorRequest::ByteSizeLong,
::google::protobuf::Message::GetByteSizeLongImpl<CodeGeneratorRequest>(), &CodeGeneratorRequest::_InternalSerialize,
::google::protobuf::Message::GetSerializeImpl<CodeGeneratorRequest>(),
#endif // PROTOBUF_CUSTOM_VTABLE #endif // PROTOBUF_CUSTOM_VTABLE
PROTOBUF_FIELD_OFFSET(CodeGeneratorRequest, _impl_._cached_size_), PROTOBUF_FIELD_OFFSET(CodeGeneratorRequest, _impl_._cached_size_),
false, false,
@ -830,116 +842,132 @@ PROTOBUF_NOINLINE void CodeGeneratorRequest::Clear() {
_internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>();
} }
::uint8_t* CodeGeneratorRequest::_InternalSerialize( #if defined(PROTOBUF_CUSTOM_VTABLE)
::uint8_t* target, ::uint8_t* CodeGeneratorRequest::_InternalSerialize(
::google::protobuf::io::EpsCopyOutputStream* stream) const { const MessageLite& base, ::uint8_t* target,
// @@protoc_insertion_point(serialize_to_array_start:google.protobuf.compiler.CodeGeneratorRequest) ::google::protobuf::io::EpsCopyOutputStream* stream) {
::uint32_t cached_has_bits = 0; const CodeGeneratorRequest& this_ = static_cast<const CodeGeneratorRequest&>(base);
(void)cached_has_bits; #else // PROTOBUF_CUSTOM_VTABLE
::uint8_t* CodeGeneratorRequest::_InternalSerialize(
// repeated string file_to_generate = 1; ::uint8_t* target,
for (int i = 0, n = this->_internal_file_to_generate_size(); i < n; ++i) { ::google::protobuf::io::EpsCopyOutputStream* stream) const {
const auto& s = this->_internal_file_to_generate().Get(i); const CodeGeneratorRequest& this_ = *this;
::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(s.data(), static_cast<int>(s.length()), ::google::protobuf::internal::WireFormat::SERIALIZE, #endif // PROTOBUF_CUSTOM_VTABLE
"google.protobuf.compiler.CodeGeneratorRequest.file_to_generate"); // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.compiler.CodeGeneratorRequest)
target = stream->WriteString(1, s, target); ::uint32_t cached_has_bits = 0;
} (void)cached_has_bits;
cached_has_bits = _impl_._has_bits_[0]; // repeated string file_to_generate = 1;
// optional string parameter = 2; for (int i = 0, n = this_._internal_file_to_generate_size(); i < n; ++i) {
if (cached_has_bits & 0x00000001u) { const auto& s = this_._internal_file_to_generate().Get(i);
const std::string& _s = this->_internal_parameter(); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(s.data(), static_cast<int>(s.length()), ::google::protobuf::internal::WireFormat::SERIALIZE,
::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(_s.data(), static_cast<int>(_s.length()), ::google::protobuf::internal::WireFormat::SERIALIZE, "google.protobuf.compiler.CodeGeneratorRequest.file_to_generate");
"google.protobuf.compiler.CodeGeneratorRequest.parameter"); target = stream->WriteString(1, s, target);
target = stream->WriteStringMaybeAliased(2, _s, target); }
}
cached_has_bits = this_._impl_._has_bits_[0];
// optional .google.protobuf.compiler.Version compiler_version = 3; // optional string parameter = 2;
if (cached_has_bits & 0x00000002u) { if (cached_has_bits & 0x00000001u) {
target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( const std::string& _s = this_._internal_parameter();
3, *_impl_.compiler_version_, _impl_.compiler_version_->GetCachedSize(), target, stream); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(_s.data(), static_cast<int>(_s.length()), ::google::protobuf::internal::WireFormat::SERIALIZE,
} "google.protobuf.compiler.CodeGeneratorRequest.parameter");
target = stream->WriteStringMaybeAliased(2, _s, target);
// repeated .google.protobuf.FileDescriptorProto proto_file = 15; }
for (unsigned i = 0, n = static_cast<unsigned>(
this->_internal_proto_file_size()); // optional .google.protobuf.compiler.Version compiler_version = 3;
i < n; i++) { if (cached_has_bits & 0x00000002u) {
const auto& repfield = this->_internal_proto_file().Get(i); target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage(
target = 3, *this_._impl_.compiler_version_, this_._impl_.compiler_version_->GetCachedSize(), target,
::google::protobuf::internal::WireFormatLite::InternalWriteMessage( stream);
15, repfield, repfield.GetCachedSize(), }
target, stream);
} // repeated .google.protobuf.FileDescriptorProto proto_file = 15;
for (unsigned i = 0, n = static_cast<unsigned>(
// repeated .google.protobuf.FileDescriptorProto source_file_descriptors = 17; this_._internal_proto_file_size());
for (unsigned i = 0, n = static_cast<unsigned>( i < n; i++) {
this->_internal_source_file_descriptors_size()); const auto& repfield = this_._internal_proto_file().Get(i);
i < n; i++) { target =
const auto& repfield = this->_internal_source_file_descriptors().Get(i); ::google::protobuf::internal::WireFormatLite::InternalWriteMessage(
target = 15, repfield, repfield.GetCachedSize(),
::google::protobuf::internal::WireFormatLite::InternalWriteMessage( target, stream);
17, repfield, repfield.GetCachedSize(), }
target, stream);
} // repeated .google.protobuf.FileDescriptorProto source_file_descriptors = 17;
for (unsigned i = 0, n = static_cast<unsigned>(
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { this_._internal_source_file_descriptors_size());
target = i < n; i++) {
::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( const auto& repfield = this_._internal_source_file_descriptors().Get(i);
_internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); target =
} ::google::protobuf::internal::WireFormatLite::InternalWriteMessage(
// @@protoc_insertion_point(serialize_to_array_end:google.protobuf.compiler.CodeGeneratorRequest) 17, repfield, repfield.GetCachedSize(),
return target; target, stream);
} }
::size_t CodeGeneratorRequest::ByteSizeLong() const { if (PROTOBUF_PREDICT_FALSE(this_._internal_metadata_.have_unknown_fields())) {
// @@protoc_insertion_point(message_byte_size_start:google.protobuf.compiler.CodeGeneratorRequest) target =
::size_t total_size = 0; ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
this_._internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream);
::uint32_t cached_has_bits = 0; }
// Prevent compiler warnings about cached_has_bits being unused // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.compiler.CodeGeneratorRequest)
(void)cached_has_bits; return target;
}
::_pbi::Prefetch5LinesFrom7Lines( #if defined(PROTOBUF_CUSTOM_VTABLE)
reinterpret_cast<const void*>(this)); ::size_t CodeGeneratorRequest::ByteSizeLong(const MessageLite& base) {
{ const CodeGeneratorRequest& this_ = static_cast<const CodeGeneratorRequest&>(base);
// repeated string file_to_generate = 1; #else // PROTOBUF_CUSTOM_VTABLE
{ ::size_t CodeGeneratorRequest::ByteSizeLong() const {
total_size += 1 * ::google::protobuf::internal::FromIntSize(_internal_file_to_generate().size()); const CodeGeneratorRequest& this_ = *this;
for (int i = 0, n = _internal_file_to_generate().size(); i < n; ++i) { #endif // PROTOBUF_CUSTOM_VTABLE
total_size += ::google::protobuf::internal::WireFormatLite::StringSize( // @@protoc_insertion_point(message_byte_size_start:google.protobuf.compiler.CodeGeneratorRequest)
_internal_file_to_generate().Get(i)); ::size_t total_size = 0;
}
} ::uint32_t cached_has_bits = 0;
// repeated .google.protobuf.FileDescriptorProto proto_file = 15; // Prevent compiler warnings about cached_has_bits being unused
{ (void)cached_has_bits;
total_size += 1UL * this->_internal_proto_file_size();
for (const auto& msg : this->_internal_proto_file()) { ::_pbi::Prefetch5LinesFrom7Lines(&this_);
total_size += ::google::protobuf::internal::WireFormatLite::MessageSize(msg); {
} // repeated string file_to_generate = 1;
} {
// repeated .google.protobuf.FileDescriptorProto source_file_descriptors = 17; total_size +=
{ 1 * ::google::protobuf::internal::FromIntSize(this_._internal_file_to_generate().size());
total_size += 2UL * this->_internal_source_file_descriptors_size(); for (int i = 0, n = this_._internal_file_to_generate().size(); i < n; ++i) {
for (const auto& msg : this->_internal_source_file_descriptors()) { total_size += ::google::protobuf::internal::WireFormatLite::StringSize(
total_size += ::google::protobuf::internal::WireFormatLite::MessageSize(msg); this_._internal_file_to_generate().Get(i));
} }
} }
} // repeated .google.protobuf.FileDescriptorProto proto_file = 15;
cached_has_bits = _impl_._has_bits_[0]; {
if (cached_has_bits & 0x00000003u) { total_size += 1UL * this_._internal_proto_file_size();
// optional string parameter = 2; for (const auto& msg : this_._internal_proto_file()) {
if (cached_has_bits & 0x00000001u) { total_size += ::google::protobuf::internal::WireFormatLite::MessageSize(msg);
total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( }
this->_internal_parameter()); }
} // repeated .google.protobuf.FileDescriptorProto source_file_descriptors = 17;
// optional .google.protobuf.compiler.Version compiler_version = 3; {
if (cached_has_bits & 0x00000002u) { total_size += 2UL * this_._internal_source_file_descriptors_size();
total_size += for (const auto& msg : this_._internal_source_file_descriptors()) {
1 + ::google::protobuf::internal::WireFormatLite::MessageSize(*_impl_.compiler_version_); total_size += ::google::protobuf::internal::WireFormatLite::MessageSize(msg);
} }
} }
return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); }
} cached_has_bits = this_._impl_._has_bits_[0];
if (cached_has_bits & 0x00000003u) {
// optional string parameter = 2;
if (cached_has_bits & 0x00000001u) {
total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize(
this_._internal_parameter());
}
// optional .google.protobuf.compiler.Version compiler_version = 3;
if (cached_has_bits & 0x00000002u) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::MessageSize(*this_._impl_.compiler_version_);
}
}
return this_.MaybeComputeUnknownFieldsSize(total_size,
&this_._impl_._cached_size_);
}
void CodeGeneratorRequest::MergeImpl(::google::protobuf::MessageLite& to_msg, const ::google::protobuf::MessageLite& from_msg) { void CodeGeneratorRequest::MergeImpl(::google::protobuf::MessageLite& to_msg, const ::google::protobuf::MessageLite& from_msg) {
auto* const _this = static_cast<CodeGeneratorRequest*>(&to_msg); auto* const _this = static_cast<CodeGeneratorRequest*>(&to_msg);
@ -1099,9 +1127,8 @@ const ::google::protobuf::MessageLite::ClassDataFull
#if defined(PROTOBUF_CUSTOM_VTABLE) #if defined(PROTOBUF_CUSTOM_VTABLE)
::google::protobuf::Message::GetDeleteImpl<CodeGeneratorResponse_File>(), ::google::protobuf::Message::GetDeleteImpl<CodeGeneratorResponse_File>(),
::google::protobuf::Message::GetNewImpl<CodeGeneratorResponse_File>(), ::google::protobuf::Message::GetNewImpl<CodeGeneratorResponse_File>(),
::google::protobuf::Message::GetClearImpl<CodeGeneratorResponse_File>(), ::google::protobuf::Message::GetClearImpl<CodeGeneratorResponse_File>(), &CodeGeneratorResponse_File::ByteSizeLong,
::google::protobuf::Message::GetByteSizeLongImpl<CodeGeneratorResponse_File>(), &CodeGeneratorResponse_File::_InternalSerialize,
::google::protobuf::Message::GetSerializeImpl<CodeGeneratorResponse_File>(),
#endif // PROTOBUF_CUSTOM_VTABLE #endif // PROTOBUF_CUSTOM_VTABLE
PROTOBUF_FIELD_OFFSET(CodeGeneratorResponse_File, _impl_._cached_size_), PROTOBUF_FIELD_OFFSET(CodeGeneratorResponse_File, _impl_._cached_size_),
false, false,
@ -1199,88 +1226,103 @@ PROTOBUF_NOINLINE void CodeGeneratorResponse_File::Clear() {
_internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>();
} }
::uint8_t* CodeGeneratorResponse_File::_InternalSerialize( #if defined(PROTOBUF_CUSTOM_VTABLE)
::uint8_t* target, ::uint8_t* CodeGeneratorResponse_File::_InternalSerialize(
::google::protobuf::io::EpsCopyOutputStream* stream) const { const MessageLite& base, ::uint8_t* target,
// @@protoc_insertion_point(serialize_to_array_start:google.protobuf.compiler.CodeGeneratorResponse.File) ::google::protobuf::io::EpsCopyOutputStream* stream) {
::uint32_t cached_has_bits = 0; const CodeGeneratorResponse_File& this_ = static_cast<const CodeGeneratorResponse_File&>(base);
(void)cached_has_bits; #else // PROTOBUF_CUSTOM_VTABLE
::uint8_t* CodeGeneratorResponse_File::_InternalSerialize(
cached_has_bits = _impl_._has_bits_[0]; ::uint8_t* target,
// optional string name = 1; ::google::protobuf::io::EpsCopyOutputStream* stream) const {
if (cached_has_bits & 0x00000001u) { const CodeGeneratorResponse_File& this_ = *this;
const std::string& _s = this->_internal_name(); #endif // PROTOBUF_CUSTOM_VTABLE
::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(_s.data(), static_cast<int>(_s.length()), ::google::protobuf::internal::WireFormat::SERIALIZE, // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.compiler.CodeGeneratorResponse.File)
"google.protobuf.compiler.CodeGeneratorResponse.File.name"); ::uint32_t cached_has_bits = 0;
target = stream->WriteStringMaybeAliased(1, _s, target); (void)cached_has_bits;
}
cached_has_bits = this_._impl_._has_bits_[0];
// optional string insertion_point = 2; // optional string name = 1;
if (cached_has_bits & 0x00000002u) { if (cached_has_bits & 0x00000001u) {
const std::string& _s = this->_internal_insertion_point(); const std::string& _s = this_._internal_name();
::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(_s.data(), static_cast<int>(_s.length()), ::google::protobuf::internal::WireFormat::SERIALIZE, ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(_s.data(), static_cast<int>(_s.length()), ::google::protobuf::internal::WireFormat::SERIALIZE,
"google.protobuf.compiler.CodeGeneratorResponse.File.insertion_point"); "google.protobuf.compiler.CodeGeneratorResponse.File.name");
target = stream->WriteStringMaybeAliased(2, _s, target); target = stream->WriteStringMaybeAliased(1, _s, target);
} }
// optional string content = 15; // optional string insertion_point = 2;
if (cached_has_bits & 0x00000004u) { if (cached_has_bits & 0x00000002u) {
const std::string& _s = this->_internal_content(); const std::string& _s = this_._internal_insertion_point();
::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(_s.data(), static_cast<int>(_s.length()), ::google::protobuf::internal::WireFormat::SERIALIZE, ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(_s.data(), static_cast<int>(_s.length()), ::google::protobuf::internal::WireFormat::SERIALIZE,
"google.protobuf.compiler.CodeGeneratorResponse.File.content"); "google.protobuf.compiler.CodeGeneratorResponse.File.insertion_point");
target = stream->WriteStringMaybeAliased(15, _s, target); target = stream->WriteStringMaybeAliased(2, _s, target);
} }
// optional .google.protobuf.GeneratedCodeInfo generated_code_info = 16; // optional string content = 15;
if (cached_has_bits & 0x00000008u) { if (cached_has_bits & 0x00000004u) {
target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( const std::string& _s = this_._internal_content();
16, *_impl_.generated_code_info_, _impl_.generated_code_info_->GetCachedSize(), target, stream); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(_s.data(), static_cast<int>(_s.length()), ::google::protobuf::internal::WireFormat::SERIALIZE,
} "google.protobuf.compiler.CodeGeneratorResponse.File.content");
target = stream->WriteStringMaybeAliased(15, _s, target);
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { }
target =
::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( // optional .google.protobuf.GeneratedCodeInfo generated_code_info = 16;
_internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); if (cached_has_bits & 0x00000008u) {
} target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage(
// @@protoc_insertion_point(serialize_to_array_end:google.protobuf.compiler.CodeGeneratorResponse.File) 16, *this_._impl_.generated_code_info_, this_._impl_.generated_code_info_->GetCachedSize(), target,
return target; stream);
} }
::size_t CodeGeneratorResponse_File::ByteSizeLong() const { if (PROTOBUF_PREDICT_FALSE(this_._internal_metadata_.have_unknown_fields())) {
// @@protoc_insertion_point(message_byte_size_start:google.protobuf.compiler.CodeGeneratorResponse.File) target =
::size_t total_size = 0; ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
this_._internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream);
::uint32_t cached_has_bits = 0; }
// Prevent compiler warnings about cached_has_bits being unused // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.compiler.CodeGeneratorResponse.File)
(void)cached_has_bits; return target;
}
::_pbi::Prefetch5LinesFrom7Lines( #if defined(PROTOBUF_CUSTOM_VTABLE)
reinterpret_cast<const void*>(this)); ::size_t CodeGeneratorResponse_File::ByteSizeLong(const MessageLite& base) {
cached_has_bits = _impl_._has_bits_[0]; const CodeGeneratorResponse_File& this_ = static_cast<const CodeGeneratorResponse_File&>(base);
if (cached_has_bits & 0x0000000fu) { #else // PROTOBUF_CUSTOM_VTABLE
// optional string name = 1; ::size_t CodeGeneratorResponse_File::ByteSizeLong() const {
if (cached_has_bits & 0x00000001u) { const CodeGeneratorResponse_File& this_ = *this;
total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( #endif // PROTOBUF_CUSTOM_VTABLE
this->_internal_name()); // @@protoc_insertion_point(message_byte_size_start:google.protobuf.compiler.CodeGeneratorResponse.File)
} ::size_t total_size = 0;
// optional string insertion_point = 2;
if (cached_has_bits & 0x00000002u) { ::uint32_t cached_has_bits = 0;
total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( // Prevent compiler warnings about cached_has_bits being unused
this->_internal_insertion_point()); (void)cached_has_bits;
}
// optional string content = 15; ::_pbi::Prefetch5LinesFrom7Lines(&this_);
if (cached_has_bits & 0x00000004u) { cached_has_bits = this_._impl_._has_bits_[0];
total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( if (cached_has_bits & 0x0000000fu) {
this->_internal_content()); // optional string name = 1;
} if (cached_has_bits & 0x00000001u) {
// optional .google.protobuf.GeneratedCodeInfo generated_code_info = 16; total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize(
if (cached_has_bits & 0x00000008u) { this_._internal_name());
total_size += }
2 + ::google::protobuf::internal::WireFormatLite::MessageSize(*_impl_.generated_code_info_); // optional string insertion_point = 2;
} if (cached_has_bits & 0x00000002u) {
} total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize(
return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); this_._internal_insertion_point());
} }
// optional string content = 15;
if (cached_has_bits & 0x00000004u) {
total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize(
this_._internal_content());
}
// optional .google.protobuf.GeneratedCodeInfo generated_code_info = 16;
if (cached_has_bits & 0x00000008u) {
total_size += 2 +
::google::protobuf::internal::WireFormatLite::MessageSize(*this_._impl_.generated_code_info_);
}
}
return this_.MaybeComputeUnknownFieldsSize(total_size,
&this_._impl_._cached_size_);
}
void CodeGeneratorResponse_File::MergeImpl(::google::protobuf::MessageLite& to_msg, const ::google::protobuf::MessageLite& from_msg) { void CodeGeneratorResponse_File::MergeImpl(::google::protobuf::MessageLite& to_msg, const ::google::protobuf::MessageLite& from_msg) {
auto* const _this = static_cast<CodeGeneratorResponse_File*>(&to_msg); auto* const _this = static_cast<CodeGeneratorResponse_File*>(&to_msg);
@ -1429,9 +1471,8 @@ const ::google::protobuf::MessageLite::ClassDataFull
#if defined(PROTOBUF_CUSTOM_VTABLE) #if defined(PROTOBUF_CUSTOM_VTABLE)
::google::protobuf::Message::GetDeleteImpl<CodeGeneratorResponse>(), ::google::protobuf::Message::GetDeleteImpl<CodeGeneratorResponse>(),
::google::protobuf::Message::GetNewImpl<CodeGeneratorResponse>(), ::google::protobuf::Message::GetNewImpl<CodeGeneratorResponse>(),
::google::protobuf::Message::GetClearImpl<CodeGeneratorResponse>(), ::google::protobuf::Message::GetClearImpl<CodeGeneratorResponse>(), &CodeGeneratorResponse::ByteSizeLong,
::google::protobuf::Message::GetByteSizeLongImpl<CodeGeneratorResponse>(), &CodeGeneratorResponse::_InternalSerialize,
::google::protobuf::Message::GetSerializeImpl<CodeGeneratorResponse>(),
#endif // PROTOBUF_CUSTOM_VTABLE #endif // PROTOBUF_CUSTOM_VTABLE
PROTOBUF_FIELD_OFFSET(CodeGeneratorResponse, _impl_._cached_size_), PROTOBUF_FIELD_OFFSET(CodeGeneratorResponse, _impl_._cached_size_),
false, false,
@ -1530,107 +1571,121 @@ PROTOBUF_NOINLINE void CodeGeneratorResponse::Clear() {
_internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>();
} }
::uint8_t* CodeGeneratorResponse::_InternalSerialize( #if defined(PROTOBUF_CUSTOM_VTABLE)
::uint8_t* target, ::uint8_t* CodeGeneratorResponse::_InternalSerialize(
::google::protobuf::io::EpsCopyOutputStream* stream) const { const MessageLite& base, ::uint8_t* target,
// @@protoc_insertion_point(serialize_to_array_start:google.protobuf.compiler.CodeGeneratorResponse) ::google::protobuf::io::EpsCopyOutputStream* stream) {
::uint32_t cached_has_bits = 0; const CodeGeneratorResponse& this_ = static_cast<const CodeGeneratorResponse&>(base);
(void)cached_has_bits; #else // PROTOBUF_CUSTOM_VTABLE
::uint8_t* CodeGeneratorResponse::_InternalSerialize(
cached_has_bits = _impl_._has_bits_[0]; ::uint8_t* target,
// optional string error = 1; ::google::protobuf::io::EpsCopyOutputStream* stream) const {
if (cached_has_bits & 0x00000001u) { const CodeGeneratorResponse& this_ = *this;
const std::string& _s = this->_internal_error(); #endif // PROTOBUF_CUSTOM_VTABLE
::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(_s.data(), static_cast<int>(_s.length()), ::google::protobuf::internal::WireFormat::SERIALIZE, // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.compiler.CodeGeneratorResponse)
"google.protobuf.compiler.CodeGeneratorResponse.error"); ::uint32_t cached_has_bits = 0;
target = stream->WriteStringMaybeAliased(1, _s, target); (void)cached_has_bits;
}
cached_has_bits = this_._impl_._has_bits_[0];
// optional uint64 supported_features = 2; // optional string error = 1;
if (cached_has_bits & 0x00000002u) { if (cached_has_bits & 0x00000001u) {
target = stream->EnsureSpace(target); const std::string& _s = this_._internal_error();
target = ::_pbi::WireFormatLite::WriteUInt64ToArray( ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(_s.data(), static_cast<int>(_s.length()), ::google::protobuf::internal::WireFormat::SERIALIZE,
2, this->_internal_supported_features(), target); "google.protobuf.compiler.CodeGeneratorResponse.error");
} target = stream->WriteStringMaybeAliased(1, _s, target);
}
// optional int32 minimum_edition = 3;
if (cached_has_bits & 0x00000004u) { // optional uint64 supported_features = 2;
target = ::google::protobuf::internal::WireFormatLite:: if (cached_has_bits & 0x00000002u) {
WriteInt32ToArrayWithField<3>( target = stream->EnsureSpace(target);
stream, this->_internal_minimum_edition(), target); target = ::_pbi::WireFormatLite::WriteUInt64ToArray(
} 2, this_._internal_supported_features(), target);
}
// optional int32 maximum_edition = 4;
if (cached_has_bits & 0x00000008u) { // optional int32 minimum_edition = 3;
target = ::google::protobuf::internal::WireFormatLite:: if (cached_has_bits & 0x00000004u) {
WriteInt32ToArrayWithField<4>( target = ::google::protobuf::internal::WireFormatLite::
stream, this->_internal_maximum_edition(), target); WriteInt32ToArrayWithField<3>(
} stream, this_._internal_minimum_edition(), target);
}
// repeated .google.protobuf.compiler.CodeGeneratorResponse.File file = 15;
for (unsigned i = 0, n = static_cast<unsigned>( // optional int32 maximum_edition = 4;
this->_internal_file_size()); if (cached_has_bits & 0x00000008u) {
i < n; i++) { target = ::google::protobuf::internal::WireFormatLite::
const auto& repfield = this->_internal_file().Get(i); WriteInt32ToArrayWithField<4>(
target = stream, this_._internal_maximum_edition(), target);
::google::protobuf::internal::WireFormatLite::InternalWriteMessage( }
15, repfield, repfield.GetCachedSize(),
target, stream); // repeated .google.protobuf.compiler.CodeGeneratorResponse.File file = 15;
} for (unsigned i = 0, n = static_cast<unsigned>(
this_._internal_file_size());
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { i < n; i++) {
target = const auto& repfield = this_._internal_file().Get(i);
::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( target =
_internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); ::google::protobuf::internal::WireFormatLite::InternalWriteMessage(
} 15, repfield, repfield.GetCachedSize(),
// @@protoc_insertion_point(serialize_to_array_end:google.protobuf.compiler.CodeGeneratorResponse) target, stream);
return target; }
}
if (PROTOBUF_PREDICT_FALSE(this_._internal_metadata_.have_unknown_fields())) {
::size_t CodeGeneratorResponse::ByteSizeLong() const { target =
// @@protoc_insertion_point(message_byte_size_start:google.protobuf.compiler.CodeGeneratorResponse) ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
::size_t total_size = 0; this_._internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream);
}
::uint32_t cached_has_bits = 0; // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.compiler.CodeGeneratorResponse)
// Prevent compiler warnings about cached_has_bits being unused return target;
(void)cached_has_bits; }
::_pbi::Prefetch5LinesFrom7Lines( #if defined(PROTOBUF_CUSTOM_VTABLE)
reinterpret_cast<const void*>(this)); ::size_t CodeGeneratorResponse::ByteSizeLong(const MessageLite& base) {
{ const CodeGeneratorResponse& this_ = static_cast<const CodeGeneratorResponse&>(base);
// repeated .google.protobuf.compiler.CodeGeneratorResponse.File file = 15; #else // PROTOBUF_CUSTOM_VTABLE
{ ::size_t CodeGeneratorResponse::ByteSizeLong() const {
total_size += 1UL * this->_internal_file_size(); const CodeGeneratorResponse& this_ = *this;
for (const auto& msg : this->_internal_file()) { #endif // PROTOBUF_CUSTOM_VTABLE
total_size += ::google::protobuf::internal::WireFormatLite::MessageSize(msg); // @@protoc_insertion_point(message_byte_size_start:google.protobuf.compiler.CodeGeneratorResponse)
} ::size_t total_size = 0;
}
} ::uint32_t cached_has_bits = 0;
cached_has_bits = _impl_._has_bits_[0]; // Prevent compiler warnings about cached_has_bits being unused
if (cached_has_bits & 0x0000000fu) { (void)cached_has_bits;
// optional string error = 1;
if (cached_has_bits & 0x00000001u) { ::_pbi::Prefetch5LinesFrom7Lines(&this_);
total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( {
this->_internal_error()); // repeated .google.protobuf.compiler.CodeGeneratorResponse.File file = 15;
} {
// optional uint64 supported_features = 2; total_size += 1UL * this_._internal_file_size();
if (cached_has_bits & 0x00000002u) { for (const auto& msg : this_._internal_file()) {
total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne( total_size += ::google::protobuf::internal::WireFormatLite::MessageSize(msg);
this->_internal_supported_features()); }
} }
// optional int32 minimum_edition = 3; }
if (cached_has_bits & 0x00000004u) { cached_has_bits = this_._impl_._has_bits_[0];
total_size += ::_pbi::WireFormatLite::Int32SizePlusOne( if (cached_has_bits & 0x0000000fu) {
this->_internal_minimum_edition()); // optional string error = 1;
} if (cached_has_bits & 0x00000001u) {
// optional int32 maximum_edition = 4; total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize(
if (cached_has_bits & 0x00000008u) { this_._internal_error());
total_size += ::_pbi::WireFormatLite::Int32SizePlusOne( }
this->_internal_maximum_edition()); // optional uint64 supported_features = 2;
} if (cached_has_bits & 0x00000002u) {
} total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(
return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); this_._internal_supported_features());
} }
// optional int32 minimum_edition = 3;
if (cached_has_bits & 0x00000004u) {
total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(
this_._internal_minimum_edition());
}
// optional int32 maximum_edition = 4;
if (cached_has_bits & 0x00000008u) {
total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(
this_._internal_maximum_edition());
}
}
return this_.MaybeComputeUnknownFieldsSize(total_size,
&this_._impl_._cached_size_);
}
void CodeGeneratorResponse::MergeImpl(::google::protobuf::MessageLite& to_msg, const ::google::protobuf::MessageLite& from_msg) { void CodeGeneratorResponse::MergeImpl(::google::protobuf::MessageLite& to_msg, const ::google::protobuf::MessageLite& from_msg) {
auto* const _this = static_cast<CodeGeneratorResponse*>(&to_msg); auto* const _this = static_cast<CodeGeneratorResponse*>(&to_msg);

@ -210,10 +210,26 @@ class PROTOC_EXPORT Version final : public ::google::protobuf::Message
return true; return true;
} }
ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL;
::size_t ByteSizeLong() const PROTOBUF_FINAL; #if defined(PROTOBUF_CUSTOM_VTABLE)
::uint8_t* _InternalSerialize(::uint8_t* target, private:
::google::protobuf::io::EpsCopyOutputStream* static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg);
stream) const PROTOBUF_FINAL; static ::uint8_t* _InternalSerialize(
const MessageLite& msg, ::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream);
public:
::size_t ByteSizeLong() const { return ByteSizeLong(*this); }
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const {
return _InternalSerialize(*this, target, stream);
}
#else // PROTOBUF_CUSTOM_VTABLE
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const final;
#endif // PROTOBUF_CUSTOM_VTABLE
int GetCachedSize() const { return _impl_._cached_size_.Get(); } int GetCachedSize() const { return _impl_._cached_size_.Get(); }
private: private:
@ -427,10 +443,26 @@ class PROTOC_EXPORT CodeGeneratorResponse_File final : public ::google::protobuf
return true; return true;
} }
ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL;
::size_t ByteSizeLong() const PROTOBUF_FINAL; #if defined(PROTOBUF_CUSTOM_VTABLE)
::uint8_t* _InternalSerialize(::uint8_t* target, private:
::google::protobuf::io::EpsCopyOutputStream* static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg);
stream) const PROTOBUF_FINAL; static ::uint8_t* _InternalSerialize(
const MessageLite& msg, ::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream);
public:
::size_t ByteSizeLong() const { return ByteSizeLong(*this); }
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const {
return _InternalSerialize(*this, target, stream);
}
#else // PROTOBUF_CUSTOM_VTABLE
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const final;
#endif // PROTOBUF_CUSTOM_VTABLE
int GetCachedSize() const { return _impl_._cached_size_.Get(); } int GetCachedSize() const { return _impl_._cached_size_.Get(); }
private: private:
@ -660,10 +692,26 @@ class PROTOC_EXPORT CodeGeneratorResponse final : public ::google::protobuf::Mes
return true; return true;
} }
ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL;
::size_t ByteSizeLong() const PROTOBUF_FINAL; #if defined(PROTOBUF_CUSTOM_VTABLE)
::uint8_t* _InternalSerialize(::uint8_t* target, private:
::google::protobuf::io::EpsCopyOutputStream* static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg);
stream) const PROTOBUF_FINAL; static ::uint8_t* _InternalSerialize(
const MessageLite& msg, ::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream);
public:
::size_t ByteSizeLong() const { return ByteSizeLong(*this); }
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const {
return _InternalSerialize(*this, target, stream);
}
#else // PROTOBUF_CUSTOM_VTABLE
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const final;
#endif // PROTOBUF_CUSTOM_VTABLE
int GetCachedSize() const { return _impl_._cached_size_.Get(); } int GetCachedSize() const { return _impl_._cached_size_.Get(); }
private: private:
@ -922,10 +970,26 @@ class PROTOC_EXPORT CodeGeneratorRequest final : public ::google::protobuf::Mess
public: public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL;
::size_t ByteSizeLong() const PROTOBUF_FINAL; #if defined(PROTOBUF_CUSTOM_VTABLE)
::uint8_t* _InternalSerialize(::uint8_t* target, private:
::google::protobuf::io::EpsCopyOutputStream* static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg);
stream) const PROTOBUF_FINAL; static ::uint8_t* _InternalSerialize(
const MessageLite& msg, ::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream);
public:
::size_t ByteSizeLong() const { return ByteSizeLong(*this); }
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const {
return _InternalSerialize(*this, target, stream);
}
#else // PROTOBUF_CUSTOM_VTABLE
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const final;
#endif // PROTOBUF_CUSTOM_VTABLE
int GetCachedSize() const { return _impl_._cached_size_.Get(); } int GetCachedSize() const { return _impl_._cached_size_.Get(); }
private: private:

@ -201,9 +201,8 @@ const ::google::protobuf::MessageLite::ClassDataFull
#if defined(PROTOBUF_CUSTOM_VTABLE) #if defined(PROTOBUF_CUSTOM_VTABLE)
::google::protobuf::Message::GetDeleteImpl<CppFeatures>(), ::google::protobuf::Message::GetDeleteImpl<CppFeatures>(),
::google::protobuf::Message::GetNewImpl<CppFeatures>(), ::google::protobuf::Message::GetNewImpl<CppFeatures>(),
::google::protobuf::Message::GetClearImpl<CppFeatures>(), ::google::protobuf::Message::GetClearImpl<CppFeatures>(), &CppFeatures::ByteSizeLong,
::google::protobuf::Message::GetByteSizeLongImpl<CppFeatures>(), &CppFeatures::_InternalSerialize,
::google::protobuf::Message::GetSerializeImpl<CppFeatures>(),
#endif // PROTOBUF_CUSTOM_VTABLE #endif // PROTOBUF_CUSTOM_VTABLE
PROTOBUF_FIELD_OFFSET(CppFeatures, _impl_._cached_size_), PROTOBUF_FIELD_OFFSET(CppFeatures, _impl_._cached_size_),
false, false,
@ -274,61 +273,75 @@ PROTOBUF_NOINLINE void CppFeatures::Clear() {
_internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>();
} }
::uint8_t* CppFeatures::_InternalSerialize( #if defined(PROTOBUF_CUSTOM_VTABLE)
::uint8_t* target, ::uint8_t* CppFeatures::_InternalSerialize(
::google::protobuf::io::EpsCopyOutputStream* stream) const { const MessageLite& base, ::uint8_t* target,
// @@protoc_insertion_point(serialize_to_array_start:pb.CppFeatures) ::google::protobuf::io::EpsCopyOutputStream* stream) {
::uint32_t cached_has_bits = 0; const CppFeatures& this_ = static_cast<const CppFeatures&>(base);
(void)cached_has_bits; #else // PROTOBUF_CUSTOM_VTABLE
::uint8_t* CppFeatures::_InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const {
const CppFeatures& this_ = *this;
#endif // PROTOBUF_CUSTOM_VTABLE
// @@protoc_insertion_point(serialize_to_array_start:pb.CppFeatures)
::uint32_t cached_has_bits = 0;
(void)cached_has_bits;
cached_has_bits = _impl_._has_bits_[0]; cached_has_bits = this_._impl_._has_bits_[0];
// optional bool legacy_closed_enum = 1 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = { // optional bool legacy_closed_enum = 1 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = {
if (cached_has_bits & 0x00000001u) { if (cached_has_bits & 0x00000001u) {
target = stream->EnsureSpace(target); target = stream->EnsureSpace(target);
target = ::_pbi::WireFormatLite::WriteBoolToArray( target = ::_pbi::WireFormatLite::WriteBoolToArray(
1, this->_internal_legacy_closed_enum(), target); 1, this_._internal_legacy_closed_enum(), target);
} }
// optional .pb.CppFeatures.StringType string_type = 2 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = { // optional .pb.CppFeatures.StringType string_type = 2 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = {
if (cached_has_bits & 0x00000002u) { if (cached_has_bits & 0x00000002u) {
target = stream->EnsureSpace(target); target = stream->EnsureSpace(target);
target = ::_pbi::WireFormatLite::WriteEnumToArray( target = ::_pbi::WireFormatLite::WriteEnumToArray(
2, this->_internal_string_type(), target); 2, this_._internal_string_type(), target);
} }
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { if (PROTOBUF_PREDICT_FALSE(this_._internal_metadata_.have_unknown_fields())) {
target = target =
::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); this_._internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream);
} }
// @@protoc_insertion_point(serialize_to_array_end:pb.CppFeatures) // @@protoc_insertion_point(serialize_to_array_end:pb.CppFeatures)
return target; return target;
} }
::size_t CppFeatures::ByteSizeLong() const { #if defined(PROTOBUF_CUSTOM_VTABLE)
// @@protoc_insertion_point(message_byte_size_start:pb.CppFeatures) ::size_t CppFeatures::ByteSizeLong(const MessageLite& base) {
::size_t total_size = 0; const CppFeatures& this_ = static_cast<const CppFeatures&>(base);
#else // PROTOBUF_CUSTOM_VTABLE
::size_t CppFeatures::ByteSizeLong() const {
const CppFeatures& this_ = *this;
#endif // PROTOBUF_CUSTOM_VTABLE
// @@protoc_insertion_point(message_byte_size_start:pb.CppFeatures)
::size_t total_size = 0;
::uint32_t cached_has_bits = 0; ::uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused // Prevent compiler warnings about cached_has_bits being unused
(void)cached_has_bits; (void)cached_has_bits;
::_pbi::Prefetch5LinesFrom7Lines( ::_pbi::Prefetch5LinesFrom7Lines(&this_);
reinterpret_cast<const void*>(this)); cached_has_bits = this_._impl_._has_bits_[0];
cached_has_bits = _impl_._has_bits_[0]; if (cached_has_bits & 0x00000003u) {
if (cached_has_bits & 0x00000003u) { // optional bool legacy_closed_enum = 1 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = {
// optional bool legacy_closed_enum = 1 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = { if (cached_has_bits & 0x00000001u) {
if (cached_has_bits & 0x00000001u) { total_size += 2;
total_size += 2; }
} // optional .pb.CppFeatures.StringType string_type = 2 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = {
// optional .pb.CppFeatures.StringType string_type = 2 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = { if (cached_has_bits & 0x00000002u) {
if (cached_has_bits & 0x00000002u) { total_size += 1 +
total_size += 1 + ::_pbi::WireFormatLite::EnumSize(this_._internal_string_type());
::_pbi::WireFormatLite::EnumSize(this->_internal_string_type()); }
} }
} return this_.MaybeComputeUnknownFieldsSize(total_size,
return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); &this_._impl_._cached_size_);
} }
void CppFeatures::MergeImpl(::google::protobuf::MessageLite& to_msg, const ::google::protobuf::MessageLite& from_msg) { void CppFeatures::MergeImpl(::google::protobuf::MessageLite& to_msg, const ::google::protobuf::MessageLite& from_msg) {
auto* const _this = static_cast<CppFeatures*>(&to_msg); auto* const _this = static_cast<CppFeatures*>(&to_msg);

@ -194,10 +194,26 @@ class PROTOBUF_EXPORT CppFeatures final : public ::google::protobuf::Message
return true; return true;
} }
ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL;
::size_t ByteSizeLong() const PROTOBUF_FINAL; #if defined(PROTOBUF_CUSTOM_VTABLE)
::uint8_t* _InternalSerialize(::uint8_t* target, private:
::google::protobuf::io::EpsCopyOutputStream* static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg);
stream) const PROTOBUF_FINAL; static ::uint8_t* _InternalSerialize(
const MessageLite& msg, ::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream);
public:
::size_t ByteSizeLong() const { return ByteSizeLong(*this); }
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const {
return _InternalSerialize(*this, target, stream);
}
#else // PROTOBUF_CUSTOM_VTABLE
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const final;
#endif // PROTOBUF_CUSTOM_VTABLE
int GetCachedSize() const { return _impl_._cached_size_.Get(); } int GetCachedSize() const { return _impl_._cached_size_.Get(); }
private: private:

File diff suppressed because it is too large Load Diff

@ -801,10 +801,26 @@ class PROTOBUF_EXPORT UninterpretedOption_NamePart final : public ::google::prot
public: public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL;
::size_t ByteSizeLong() const PROTOBUF_FINAL; #if defined(PROTOBUF_CUSTOM_VTABLE)
::uint8_t* _InternalSerialize(::uint8_t* target, private:
::google::protobuf::io::EpsCopyOutputStream* static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg);
stream) const PROTOBUF_FINAL; static ::uint8_t* _InternalSerialize(
const MessageLite& msg, ::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream);
public:
::size_t ByteSizeLong() const { return ByteSizeLong(*this); }
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const {
return _InternalSerialize(*this, target, stream);
}
#else // PROTOBUF_CUSTOM_VTABLE
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const final;
#endif // PROTOBUF_CUSTOM_VTABLE
int GetCachedSize() const { return _impl_._cached_size_.Get(); } int GetCachedSize() const { return _impl_._cached_size_.Get(); }
private: private:
@ -992,10 +1008,26 @@ class PROTOBUF_EXPORT SourceCodeInfo_Location final : public ::google::protobuf:
return true; return true;
} }
ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL;
::size_t ByteSizeLong() const PROTOBUF_FINAL; #if defined(PROTOBUF_CUSTOM_VTABLE)
::uint8_t* _InternalSerialize(::uint8_t* target, private:
::google::protobuf::io::EpsCopyOutputStream* static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg);
stream) const PROTOBUF_FINAL; static ::uint8_t* _InternalSerialize(
const MessageLite& msg, ::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream);
public:
::size_t ByteSizeLong() const { return ByteSizeLong(*this); }
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const {
return _InternalSerialize(*this, target, stream);
}
#else // PROTOBUF_CUSTOM_VTABLE
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const final;
#endif // PROTOBUF_CUSTOM_VTABLE
int GetCachedSize() const { return _impl_._cached_size_.Get(); } int GetCachedSize() const { return _impl_._cached_size_.Get(); }
private: private:
@ -1255,10 +1287,26 @@ class PROTOBUF_EXPORT GeneratedCodeInfo_Annotation final : public ::google::prot
return true; return true;
} }
ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL;
::size_t ByteSizeLong() const PROTOBUF_FINAL; #if defined(PROTOBUF_CUSTOM_VTABLE)
::uint8_t* _InternalSerialize(::uint8_t* target, private:
::google::protobuf::io::EpsCopyOutputStream* static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg);
stream) const PROTOBUF_FINAL; static ::uint8_t* _InternalSerialize(
const MessageLite& msg, ::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream);
public:
::size_t ByteSizeLong() const { return ByteSizeLong(*this); }
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const {
return _InternalSerialize(*this, target, stream);
}
#else // PROTOBUF_CUSTOM_VTABLE
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const final;
#endif // PROTOBUF_CUSTOM_VTABLE
int GetCachedSize() const { return _impl_._cached_size_.Get(); } int GetCachedSize() const { return _impl_._cached_size_.Get(); }
private: private:
@ -1513,10 +1561,26 @@ class PROTOBUF_EXPORT FieldOptions_FeatureSupport final : public ::google::proto
return true; return true;
} }
ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL;
::size_t ByteSizeLong() const PROTOBUF_FINAL; #if defined(PROTOBUF_CUSTOM_VTABLE)
::uint8_t* _InternalSerialize(::uint8_t* target, private:
::google::protobuf::io::EpsCopyOutputStream* static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg);
stream) const PROTOBUF_FINAL; static ::uint8_t* _InternalSerialize(
const MessageLite& msg, ::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream);
public:
::size_t ByteSizeLong() const { return ByteSizeLong(*this); }
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const {
return _InternalSerialize(*this, target, stream);
}
#else // PROTOBUF_CUSTOM_VTABLE
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const final;
#endif // PROTOBUF_CUSTOM_VTABLE
int GetCachedSize() const { return _impl_._cached_size_.Get(); } int GetCachedSize() const { return _impl_._cached_size_.Get(); }
private: private:
@ -1730,10 +1794,26 @@ class PROTOBUF_EXPORT FieldOptions_EditionDefault final : public ::google::proto
return true; return true;
} }
ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL;
::size_t ByteSizeLong() const PROTOBUF_FINAL; #if defined(PROTOBUF_CUSTOM_VTABLE)
::uint8_t* _InternalSerialize(::uint8_t* target, private:
::google::protobuf::io::EpsCopyOutputStream* static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg);
stream) const PROTOBUF_FINAL; static ::uint8_t* _InternalSerialize(
const MessageLite& msg, ::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream);
public:
::size_t ByteSizeLong() const { return ByteSizeLong(*this); }
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const {
return _InternalSerialize(*this, target, stream);
}
#else // PROTOBUF_CUSTOM_VTABLE
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const final;
#endif // PROTOBUF_CUSTOM_VTABLE
int GetCachedSize() const { return _impl_._cached_size_.Get(); } int GetCachedSize() const { return _impl_._cached_size_.Get(); }
private: private:
@ -1926,10 +2006,26 @@ class PROTOBUF_EXPORT FeatureSet final : public ::google::protobuf::Message
public: public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL;
::size_t ByteSizeLong() const PROTOBUF_FINAL; #if defined(PROTOBUF_CUSTOM_VTABLE)
::uint8_t* _InternalSerialize(::uint8_t* target, private:
::google::protobuf::io::EpsCopyOutputStream* static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg);
stream) const PROTOBUF_FINAL; static ::uint8_t* _InternalSerialize(
const MessageLite& msg, ::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream);
public:
::size_t ByteSizeLong() const { return ByteSizeLong(*this); }
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const {
return _InternalSerialize(*this, target, stream);
}
#else // PROTOBUF_CUSTOM_VTABLE
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const final;
#endif // PROTOBUF_CUSTOM_VTABLE
int GetCachedSize() const { return _impl_._cached_size_.Get(); } int GetCachedSize() const { return _impl_._cached_size_.Get(); }
private: private:
@ -2464,10 +2560,26 @@ class PROTOBUF_EXPORT ExtensionRangeOptions_Declaration final : public ::google:
return true; return true;
} }
ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL;
::size_t ByteSizeLong() const PROTOBUF_FINAL; #if defined(PROTOBUF_CUSTOM_VTABLE)
::uint8_t* _InternalSerialize(::uint8_t* target, private:
::google::protobuf::io::EpsCopyOutputStream* static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg);
stream) const PROTOBUF_FINAL; static ::uint8_t* _InternalSerialize(
const MessageLite& msg, ::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream);
public:
::size_t ByteSizeLong() const { return ByteSizeLong(*this); }
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const {
return _InternalSerialize(*this, target, stream);
}
#else // PROTOBUF_CUSTOM_VTABLE
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const final;
#endif // PROTOBUF_CUSTOM_VTABLE
int GetCachedSize() const { return _impl_._cached_size_.Get(); } int GetCachedSize() const { return _impl_._cached_size_.Get(); }
private: private:
@ -2700,10 +2812,26 @@ class PROTOBUF_EXPORT EnumDescriptorProto_EnumReservedRange final : public ::goo
return true; return true;
} }
ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL;
::size_t ByteSizeLong() const PROTOBUF_FINAL; #if defined(PROTOBUF_CUSTOM_VTABLE)
::uint8_t* _InternalSerialize(::uint8_t* target, private:
::google::protobuf::io::EpsCopyOutputStream* static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg);
stream) const PROTOBUF_FINAL; static ::uint8_t* _InternalSerialize(
const MessageLite& msg, ::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream);
public:
::size_t ByteSizeLong() const { return ByteSizeLong(*this); }
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const {
return _InternalSerialize(*this, target, stream);
}
#else // PROTOBUF_CUSTOM_VTABLE
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const final;
#endif // PROTOBUF_CUSTOM_VTABLE
int GetCachedSize() const { return _impl_._cached_size_.Get(); } int GetCachedSize() const { return _impl_._cached_size_.Get(); }
private: private:
@ -2885,10 +3013,26 @@ class PROTOBUF_EXPORT DescriptorProto_ReservedRange final : public ::google::pro
return true; return true;
} }
ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL;
::size_t ByteSizeLong() const PROTOBUF_FINAL; #if defined(PROTOBUF_CUSTOM_VTABLE)
::uint8_t* _InternalSerialize(::uint8_t* target, private:
::google::protobuf::io::EpsCopyOutputStream* static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg);
stream) const PROTOBUF_FINAL; static ::uint8_t* _InternalSerialize(
const MessageLite& msg, ::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream);
public:
::size_t ByteSizeLong() const { return ByteSizeLong(*this); }
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const {
return _InternalSerialize(*this, target, stream);
}
#else // PROTOBUF_CUSTOM_VTABLE
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const final;
#endif // PROTOBUF_CUSTOM_VTABLE
int GetCachedSize() const { return _impl_._cached_size_.Get(); } int GetCachedSize() const { return _impl_._cached_size_.Get(); }
private: private:
@ -3075,10 +3219,26 @@ class PROTOBUF_EXPORT UninterpretedOption final : public ::google::protobuf::Mes
public: public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL;
::size_t ByteSizeLong() const PROTOBUF_FINAL; #if defined(PROTOBUF_CUSTOM_VTABLE)
::uint8_t* _InternalSerialize(::uint8_t* target, private:
::google::protobuf::io::EpsCopyOutputStream* static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg);
stream) const PROTOBUF_FINAL; static ::uint8_t* _InternalSerialize(
const MessageLite& msg, ::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream);
public:
::size_t ByteSizeLong() const { return ByteSizeLong(*this); }
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const {
return _InternalSerialize(*this, target, stream);
}
#else // PROTOBUF_CUSTOM_VTABLE
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const final;
#endif // PROTOBUF_CUSTOM_VTABLE
int GetCachedSize() const { return _impl_._cached_size_.Get(); } int GetCachedSize() const { return _impl_._cached_size_.Get(); }
private: private:
@ -3350,10 +3510,26 @@ class PROTOBUF_EXPORT SourceCodeInfo final : public ::google::protobuf::Message
return true; return true;
} }
ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL;
::size_t ByteSizeLong() const PROTOBUF_FINAL; #if defined(PROTOBUF_CUSTOM_VTABLE)
::uint8_t* _InternalSerialize(::uint8_t* target, private:
::google::protobuf::io::EpsCopyOutputStream* static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg);
stream) const PROTOBUF_FINAL; static ::uint8_t* _InternalSerialize(
const MessageLite& msg, ::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream);
public:
::size_t ByteSizeLong() const { return ByteSizeLong(*this); }
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const {
return _InternalSerialize(*this, target, stream);
}
#else // PROTOBUF_CUSTOM_VTABLE
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const final;
#endif // PROTOBUF_CUSTOM_VTABLE
int GetCachedSize() const { return _impl_._cached_size_.Get(); } int GetCachedSize() const { return _impl_._cached_size_.Get(); }
private: private:
@ -3528,10 +3704,26 @@ class PROTOBUF_EXPORT GeneratedCodeInfo final : public ::google::protobuf::Messa
return true; return true;
} }
ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL;
::size_t ByteSizeLong() const PROTOBUF_FINAL; #if defined(PROTOBUF_CUSTOM_VTABLE)
::uint8_t* _InternalSerialize(::uint8_t* target, private:
::google::protobuf::io::EpsCopyOutputStream* static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg);
stream) const PROTOBUF_FINAL; static ::uint8_t* _InternalSerialize(
const MessageLite& msg, ::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream);
public:
::size_t ByteSizeLong() const { return ByteSizeLong(*this); }
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const {
return _InternalSerialize(*this, target, stream);
}
#else // PROTOBUF_CUSTOM_VTABLE
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const final;
#endif // PROTOBUF_CUSTOM_VTABLE
int GetCachedSize() const { return _impl_._cached_size_.Get(); } int GetCachedSize() const { return _impl_._cached_size_.Get(); }
private: private:
@ -3711,10 +3903,26 @@ class PROTOBUF_EXPORT FeatureSetDefaults_FeatureSetEditionDefault final : public
public: public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL;
::size_t ByteSizeLong() const PROTOBUF_FINAL; #if defined(PROTOBUF_CUSTOM_VTABLE)
::uint8_t* _InternalSerialize(::uint8_t* target, private:
::google::protobuf::io::EpsCopyOutputStream* static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg);
stream) const PROTOBUF_FINAL; static ::uint8_t* _InternalSerialize(
const MessageLite& msg, ::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream);
public:
::size_t ByteSizeLong() const { return ByteSizeLong(*this); }
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const {
return _InternalSerialize(*this, target, stream);
}
#else // PROTOBUF_CUSTOM_VTABLE
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const final;
#endif // PROTOBUF_CUSTOM_VTABLE
int GetCachedSize() const { return _impl_._cached_size_.Get(); } int GetCachedSize() const { return _impl_._cached_size_.Get(); }
private: private:
@ -3922,10 +4130,26 @@ class PROTOBUF_EXPORT ServiceOptions final : public ::google::protobuf::Message
public: public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL;
::size_t ByteSizeLong() const PROTOBUF_FINAL; #if defined(PROTOBUF_CUSTOM_VTABLE)
::uint8_t* _InternalSerialize(::uint8_t* target, private:
::google::protobuf::io::EpsCopyOutputStream* static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg);
stream) const PROTOBUF_FINAL; static ::uint8_t* _InternalSerialize(
const MessageLite& msg, ::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream);
public:
::size_t ByteSizeLong() const { return ByteSizeLong(*this); }
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const {
return _InternalSerialize(*this, target, stream);
}
#else // PROTOBUF_CUSTOM_VTABLE
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const final;
#endif // PROTOBUF_CUSTOM_VTABLE
int GetCachedSize() const { return _impl_._cached_size_.Get(); } int GetCachedSize() const { return _impl_._cached_size_.Get(); }
private: private:
@ -4315,10 +4539,26 @@ class PROTOBUF_EXPORT OneofOptions final : public ::google::protobuf::Message
public: public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL;
::size_t ByteSizeLong() const PROTOBUF_FINAL; #if defined(PROTOBUF_CUSTOM_VTABLE)
::uint8_t* _InternalSerialize(::uint8_t* target, private:
::google::protobuf::io::EpsCopyOutputStream* static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg);
stream) const PROTOBUF_FINAL; static ::uint8_t* _InternalSerialize(
const MessageLite& msg, ::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream);
public:
::size_t ByteSizeLong() const { return ByteSizeLong(*this); }
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const {
return _InternalSerialize(*this, target, stream);
}
#else // PROTOBUF_CUSTOM_VTABLE
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const final;
#endif // PROTOBUF_CUSTOM_VTABLE
int GetCachedSize() const { return _impl_._cached_size_.Get(); } int GetCachedSize() const { return _impl_._cached_size_.Get(); }
private: private:
@ -4695,10 +4935,26 @@ class PROTOBUF_EXPORT MethodOptions final : public ::google::protobuf::Message
public: public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL;
::size_t ByteSizeLong() const PROTOBUF_FINAL; #if defined(PROTOBUF_CUSTOM_VTABLE)
::uint8_t* _InternalSerialize(::uint8_t* target, private:
::google::protobuf::io::EpsCopyOutputStream* static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg);
stream) const PROTOBUF_FINAL; static ::uint8_t* _InternalSerialize(
const MessageLite& msg, ::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream);
public:
::size_t ByteSizeLong() const { return ByteSizeLong(*this); }
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const {
return _InternalSerialize(*this, target, stream);
}
#else // PROTOBUF_CUSTOM_VTABLE
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const final;
#endif // PROTOBUF_CUSTOM_VTABLE
int GetCachedSize() const { return _impl_._cached_size_.Get(); } int GetCachedSize() const { return _impl_._cached_size_.Get(); }
private: private:
@ -5121,10 +5377,26 @@ class PROTOBUF_EXPORT MessageOptions final : public ::google::protobuf::Message
public: public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL;
::size_t ByteSizeLong() const PROTOBUF_FINAL; #if defined(PROTOBUF_CUSTOM_VTABLE)
::uint8_t* _InternalSerialize(::uint8_t* target, private:
::google::protobuf::io::EpsCopyOutputStream* static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg);
stream) const PROTOBUF_FINAL; static ::uint8_t* _InternalSerialize(
const MessageLite& msg, ::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream);
public:
::size_t ByteSizeLong() const { return ByteSizeLong(*this); }
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const {
return _InternalSerialize(*this, target, stream);
}
#else // PROTOBUF_CUSTOM_VTABLE
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const final;
#endif // PROTOBUF_CUSTOM_VTABLE
int GetCachedSize() const { return _impl_._cached_size_.Get(); } int GetCachedSize() const { return _impl_._cached_size_.Get(); }
private: private:
@ -5566,10 +5838,26 @@ class PROTOBUF_EXPORT FileOptions final : public ::google::protobuf::Message
public: public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL;
::size_t ByteSizeLong() const PROTOBUF_FINAL; #if defined(PROTOBUF_CUSTOM_VTABLE)
::uint8_t* _InternalSerialize(::uint8_t* target, private:
::google::protobuf::io::EpsCopyOutputStream* static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg);
stream) const PROTOBUF_FINAL; static ::uint8_t* _InternalSerialize(
const MessageLite& msg, ::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream);
public:
::size_t ByteSizeLong() const { return ByteSizeLong(*this); }
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const {
return _InternalSerialize(*this, target, stream);
}
#else // PROTOBUF_CUSTOM_VTABLE
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const final;
#endif // PROTOBUF_CUSTOM_VTABLE
int GetCachedSize() const { return _impl_._cached_size_.Get(); } int GetCachedSize() const { return _impl_._cached_size_.Get(); }
private: private:
@ -6273,10 +6561,26 @@ class PROTOBUF_EXPORT FieldOptions final : public ::google::protobuf::Message
public: public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL;
::size_t ByteSizeLong() const PROTOBUF_FINAL; #if defined(PROTOBUF_CUSTOM_VTABLE)
::uint8_t* _InternalSerialize(::uint8_t* target, private:
::google::protobuf::io::EpsCopyOutputStream* static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg);
stream) const PROTOBUF_FINAL; static ::uint8_t* _InternalSerialize(
const MessageLite& msg, ::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream);
public:
::size_t ByteSizeLong() const { return ByteSizeLong(*this); }
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const {
return _InternalSerialize(*this, target, stream);
}
#else // PROTOBUF_CUSTOM_VTABLE
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const final;
#endif // PROTOBUF_CUSTOM_VTABLE
int GetCachedSize() const { return _impl_._cached_size_.Get(); } int GetCachedSize() const { return _impl_._cached_size_.Get(); }
private: private:
@ -6916,10 +7220,26 @@ class PROTOBUF_EXPORT FeatureSetDefaults final : public ::google::protobuf::Mess
public: public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL;
::size_t ByteSizeLong() const PROTOBUF_FINAL; #if defined(PROTOBUF_CUSTOM_VTABLE)
::uint8_t* _InternalSerialize(::uint8_t* target, private:
::google::protobuf::io::EpsCopyOutputStream* static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg);
stream) const PROTOBUF_FINAL; static ::uint8_t* _InternalSerialize(
const MessageLite& msg, ::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream);
public:
::size_t ByteSizeLong() const { return ByteSizeLong(*this); }
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const {
return _InternalSerialize(*this, target, stream);
}
#else // PROTOBUF_CUSTOM_VTABLE
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const final;
#endif // PROTOBUF_CUSTOM_VTABLE
int GetCachedSize() const { return _impl_._cached_size_.Get(); } int GetCachedSize() const { return _impl_._cached_size_.Get(); }
private: private:
@ -7126,10 +7446,26 @@ class PROTOBUF_EXPORT ExtensionRangeOptions final : public ::google::protobuf::M
public: public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL;
::size_t ByteSizeLong() const PROTOBUF_FINAL; #if defined(PROTOBUF_CUSTOM_VTABLE)
::uint8_t* _InternalSerialize(::uint8_t* target, private:
::google::protobuf::io::EpsCopyOutputStream* static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg);
stream) const PROTOBUF_FINAL; static ::uint8_t* _InternalSerialize(
const MessageLite& msg, ::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream);
public:
::size_t ByteSizeLong() const { return ByteSizeLong(*this); }
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const {
return _InternalSerialize(*this, target, stream);
}
#else // PROTOBUF_CUSTOM_VTABLE
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const final;
#endif // PROTOBUF_CUSTOM_VTABLE
int GetCachedSize() const { return _impl_._cached_size_.Get(); } int GetCachedSize() const { return _impl_._cached_size_.Get(); }
private: private:
@ -7558,10 +7894,26 @@ class PROTOBUF_EXPORT EnumValueOptions final : public ::google::protobuf::Messag
public: public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL;
::size_t ByteSizeLong() const PROTOBUF_FINAL; #if defined(PROTOBUF_CUSTOM_VTABLE)
::uint8_t* _InternalSerialize(::uint8_t* target, private:
::google::protobuf::io::EpsCopyOutputStream* static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg);
stream) const PROTOBUF_FINAL; static ::uint8_t* _InternalSerialize(
const MessageLite& msg, ::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream);
public:
::size_t ByteSizeLong() const { return ByteSizeLong(*this); }
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const {
return _InternalSerialize(*this, target, stream);
}
#else // PROTOBUF_CUSTOM_VTABLE
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const final;
#endif // PROTOBUF_CUSTOM_VTABLE
int GetCachedSize() const { return _impl_._cached_size_.Get(); } int GetCachedSize() const { return _impl_._cached_size_.Get(); }
private: private:
@ -7981,10 +8333,26 @@ class PROTOBUF_EXPORT EnumOptions final : public ::google::protobuf::Message
public: public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL;
::size_t ByteSizeLong() const PROTOBUF_FINAL; #if defined(PROTOBUF_CUSTOM_VTABLE)
::uint8_t* _InternalSerialize(::uint8_t* target, private:
::google::protobuf::io::EpsCopyOutputStream* static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg);
stream) const PROTOBUF_FINAL; static ::uint8_t* _InternalSerialize(
const MessageLite& msg, ::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream);
public:
::size_t ByteSizeLong() const { return ByteSizeLong(*this); }
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const {
return _InternalSerialize(*this, target, stream);
}
#else // PROTOBUF_CUSTOM_VTABLE
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const final;
#endif // PROTOBUF_CUSTOM_VTABLE
int GetCachedSize() const { return _impl_._cached_size_.Get(); } int GetCachedSize() const { return _impl_._cached_size_.Get(); }
private: private:
@ -8400,10 +8768,26 @@ class PROTOBUF_EXPORT OneofDescriptorProto final : public ::google::protobuf::Me
public: public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL;
::size_t ByteSizeLong() const PROTOBUF_FINAL; #if defined(PROTOBUF_CUSTOM_VTABLE)
::uint8_t* _InternalSerialize(::uint8_t* target, private:
::google::protobuf::io::EpsCopyOutputStream* static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg);
stream) const PROTOBUF_FINAL; static ::uint8_t* _InternalSerialize(
const MessageLite& msg, ::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream);
public:
::size_t ByteSizeLong() const { return ByteSizeLong(*this); }
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const {
return _InternalSerialize(*this, target, stream);
}
#else // PROTOBUF_CUSTOM_VTABLE
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const final;
#endif // PROTOBUF_CUSTOM_VTABLE
int GetCachedSize() const { return _impl_._cached_size_.Get(); } int GetCachedSize() const { return _impl_._cached_size_.Get(); }
private: private:
@ -8600,10 +8984,26 @@ class PROTOBUF_EXPORT MethodDescriptorProto final : public ::google::protobuf::M
public: public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL;
::size_t ByteSizeLong() const PROTOBUF_FINAL; #if defined(PROTOBUF_CUSTOM_VTABLE)
::uint8_t* _InternalSerialize(::uint8_t* target, private:
::google::protobuf::io::EpsCopyOutputStream* static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg);
stream) const PROTOBUF_FINAL; static ::uint8_t* _InternalSerialize(
const MessageLite& msg, ::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream);
public:
::size_t ByteSizeLong() const { return ByteSizeLong(*this); }
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const {
return _InternalSerialize(*this, target, stream);
}
#else // PROTOBUF_CUSTOM_VTABLE
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const final;
#endif // PROTOBUF_CUSTOM_VTABLE
int GetCachedSize() const { return _impl_._cached_size_.Get(); } int GetCachedSize() const { return _impl_._cached_size_.Get(); }
private: private:
@ -8864,10 +9264,26 @@ class PROTOBUF_EXPORT FieldDescriptorProto final : public ::google::protobuf::Me
public: public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL;
::size_t ByteSizeLong() const PROTOBUF_FINAL; #if defined(PROTOBUF_CUSTOM_VTABLE)
::uint8_t* _InternalSerialize(::uint8_t* target, private:
::google::protobuf::io::EpsCopyOutputStream* static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg);
stream) const PROTOBUF_FINAL; static ::uint8_t* _InternalSerialize(
const MessageLite& msg, ::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream);
public:
::size_t ByteSizeLong() const { return ByteSizeLong(*this); }
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const {
return _InternalSerialize(*this, target, stream);
}
#else // PROTOBUF_CUSTOM_VTABLE
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const final;
#endif // PROTOBUF_CUSTOM_VTABLE
int GetCachedSize() const { return _impl_._cached_size_.Get(); } int GetCachedSize() const { return _impl_._cached_size_.Get(); }
private: private:
@ -9260,10 +9676,26 @@ class PROTOBUF_EXPORT EnumValueDescriptorProto final : public ::google::protobuf
public: public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL;
::size_t ByteSizeLong() const PROTOBUF_FINAL; #if defined(PROTOBUF_CUSTOM_VTABLE)
::uint8_t* _InternalSerialize(::uint8_t* target, private:
::google::protobuf::io::EpsCopyOutputStream* static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg);
stream) const PROTOBUF_FINAL; static ::uint8_t* _InternalSerialize(
const MessageLite& msg, ::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream);
public:
::size_t ByteSizeLong() const { return ByteSizeLong(*this); }
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const {
return _InternalSerialize(*this, target, stream);
}
#else // PROTOBUF_CUSTOM_VTABLE
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const final;
#endif // PROTOBUF_CUSTOM_VTABLE
int GetCachedSize() const { return _impl_._cached_size_.Get(); } int GetCachedSize() const { return _impl_._cached_size_.Get(); }
private: private:
@ -9473,10 +9905,26 @@ class PROTOBUF_EXPORT DescriptorProto_ExtensionRange final : public ::google::pr
public: public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL;
::size_t ByteSizeLong() const PROTOBUF_FINAL; #if defined(PROTOBUF_CUSTOM_VTABLE)
::uint8_t* _InternalSerialize(::uint8_t* target, private:
::google::protobuf::io::EpsCopyOutputStream* static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg);
stream) const PROTOBUF_FINAL; static ::uint8_t* _InternalSerialize(
const MessageLite& msg, ::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream);
public:
::size_t ByteSizeLong() const { return ByteSizeLong(*this); }
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const {
return _InternalSerialize(*this, target, stream);
}
#else // PROTOBUF_CUSTOM_VTABLE
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const final;
#endif // PROTOBUF_CUSTOM_VTABLE
int GetCachedSize() const { return _impl_._cached_size_.Get(); } int GetCachedSize() const { return _impl_._cached_size_.Get(); }
private: private:
@ -9680,10 +10128,26 @@ class PROTOBUF_EXPORT ServiceDescriptorProto final : public ::google::protobuf::
public: public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL;
::size_t ByteSizeLong() const PROTOBUF_FINAL; #if defined(PROTOBUF_CUSTOM_VTABLE)
::uint8_t* _InternalSerialize(::uint8_t* target, private:
::google::protobuf::io::EpsCopyOutputStream* static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg);
stream) const PROTOBUF_FINAL; static ::uint8_t* _InternalSerialize(
const MessageLite& msg, ::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream);
public:
::size_t ByteSizeLong() const { return ByteSizeLong(*this); }
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const {
return _InternalSerialize(*this, target, stream);
}
#else // PROTOBUF_CUSTOM_VTABLE
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const final;
#endif // PROTOBUF_CUSTOM_VTABLE
int GetCachedSize() const { return _impl_._cached_size_.Get(); } int GetCachedSize() const { return _impl_._cached_size_.Get(); }
private: private:
@ -9899,10 +10363,26 @@ class PROTOBUF_EXPORT EnumDescriptorProto final : public ::google::protobuf::Mes
public: public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL;
::size_t ByteSizeLong() const PROTOBUF_FINAL; #if defined(PROTOBUF_CUSTOM_VTABLE)
::uint8_t* _InternalSerialize(::uint8_t* target, private:
::google::protobuf::io::EpsCopyOutputStream* static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg);
stream) const PROTOBUF_FINAL; static ::uint8_t* _InternalSerialize(
const MessageLite& msg, ::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream);
public:
::size_t ByteSizeLong() const { return ByteSizeLong(*this); }
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const {
return _InternalSerialize(*this, target, stream);
}
#else // PROTOBUF_CUSTOM_VTABLE
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const final;
#endif // PROTOBUF_CUSTOM_VTABLE
int GetCachedSize() const { return _impl_._cached_size_.Get(); } int GetCachedSize() const { return _impl_._cached_size_.Get(); }
private: private:
@ -10162,10 +10642,26 @@ class PROTOBUF_EXPORT DescriptorProto final : public ::google::protobuf::Message
public: public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL;
::size_t ByteSizeLong() const PROTOBUF_FINAL; #if defined(PROTOBUF_CUSTOM_VTABLE)
::uint8_t* _InternalSerialize(::uint8_t* target, private:
::google::protobuf::io::EpsCopyOutputStream* static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg);
stream) const PROTOBUF_FINAL; static ::uint8_t* _InternalSerialize(
const MessageLite& msg, ::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream);
public:
::size_t ByteSizeLong() const { return ByteSizeLong(*this); }
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const {
return _InternalSerialize(*this, target, stream);
}
#else // PROTOBUF_CUSTOM_VTABLE
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const final;
#endif // PROTOBUF_CUSTOM_VTABLE
int GetCachedSize() const { return _impl_._cached_size_.Get(); } int GetCachedSize() const { return _impl_._cached_size_.Get(); }
private: private:
@ -10521,10 +11017,26 @@ class PROTOBUF_EXPORT FileDescriptorProto final : public ::google::protobuf::Mes
public: public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL;
::size_t ByteSizeLong() const PROTOBUF_FINAL; #if defined(PROTOBUF_CUSTOM_VTABLE)
::uint8_t* _InternalSerialize(::uint8_t* target, private:
::google::protobuf::io::EpsCopyOutputStream* static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg);
stream) const PROTOBUF_FINAL; static ::uint8_t* _InternalSerialize(
const MessageLite& msg, ::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream);
public:
::size_t ByteSizeLong() const { return ByteSizeLong(*this); }
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const {
return _InternalSerialize(*this, target, stream);
}
#else // PROTOBUF_CUSTOM_VTABLE
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const final;
#endif // PROTOBUF_CUSTOM_VTABLE
int GetCachedSize() const { return _impl_._cached_size_.Get(); } int GetCachedSize() const { return _impl_._cached_size_.Get(); }
private: private:
@ -10929,10 +11441,26 @@ class PROTOBUF_EXPORT FileDescriptorSet final : public ::google::protobuf::Messa
public: public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL;
::size_t ByteSizeLong() const PROTOBUF_FINAL; #if defined(PROTOBUF_CUSTOM_VTABLE)
::uint8_t* _InternalSerialize(::uint8_t* target, private:
::google::protobuf::io::EpsCopyOutputStream* static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg);
stream) const PROTOBUF_FINAL; static ::uint8_t* _InternalSerialize(
const MessageLite& msg, ::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream);
public:
::size_t ByteSizeLong() const { return ByteSizeLong(*this); }
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const {
return _InternalSerialize(*this, target, stream);
}
#else // PROTOBUF_CUSTOM_VTABLE
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const final;
#endif // PROTOBUF_CUSTOM_VTABLE
int GetCachedSize() const { return _impl_._cached_size_.Get(); } int GetCachedSize() const { return _impl_._cached_size_.Get(); }
private: private:

@ -7,6 +7,8 @@
#include "google/protobuf/generated_message_bases.h" #include "google/protobuf/generated_message_bases.h"
#include <cstddef>
#include "google/protobuf/generated_message_reflection.h" #include "google/protobuf/generated_message_reflection.h"
#include "google/protobuf/io/coded_stream.h" #include "google/protobuf/io/coded_stream.h"
#include "google/protobuf/io/zero_copy_stream_impl.h" #include "google/protobuf/io/zero_copy_stream_impl.h"
@ -26,23 +28,27 @@ namespace internal {
// ============================================================================= // =============================================================================
// ZeroFieldsBase // ZeroFieldsBase
void ZeroFieldsBase::Clear() { void ZeroFieldsBase::Clear(MessageLite& msg) {
_internal_metadata_.Clear<UnknownFieldSet>(); // static_cast<ZeroFieldsBase&>(msg)
._internal_metadata_.Clear<UnknownFieldSet>();
} }
ZeroFieldsBase::~ZeroFieldsBase() { ZeroFieldsBase::~ZeroFieldsBase() {
_internal_metadata_.Delete<UnknownFieldSet>(); _internal_metadata_.Delete<UnknownFieldSet>();
} }
size_t ZeroFieldsBase::ByteSizeLong() const { size_t ZeroFieldsBase::ByteSizeLong(const MessageLite& base) {
return MaybeComputeUnknownFieldsSize(0, &_impl_._cached_size_); auto& msg = static_cast<const ZeroFieldsBase&>(base);
return msg.MaybeComputeUnknownFieldsSize(0, &msg._impl_._cached_size_);
} }
::uint8_t* ZeroFieldsBase::_InternalSerialize( ::uint8_t* ZeroFieldsBase::_InternalSerialize(const MessageLite& msg,
::uint8_t* target, io::EpsCopyOutputStream* stream) const { ::uint8_t* target,
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { io::EpsCopyOutputStream* stream) {
auto& this_ = static_cast<const ZeroFieldsBase&>(msg);
if (PROTOBUF_PREDICT_FALSE(this_._internal_metadata_.have_unknown_fields())) {
target = internal::WireFormat::InternalSerializeUnknownFieldsToArray( target = internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields<UnknownFieldSet>( this_._internal_metadata_.unknown_fields<UnknownFieldSet>(
UnknownFieldSet::default_instance), UnknownFieldSet::default_instance),
target, stream); target, stream);
} }

@ -29,11 +29,13 @@ namespace internal {
// rather than Message. // rather than Message.
class PROTOBUF_EXPORT ZeroFieldsBase : public Message { class PROTOBUF_EXPORT ZeroFieldsBase : public Message {
public: public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL { Clear(*this); }
size_t ByteSizeLong() const PROTOBUF_FINAL; size_t ByteSizeLong() const PROTOBUF_FINAL { return ByteSizeLong(*this); }
int GetCachedSize() const { return _impl_._cached_size_.Get(); } int GetCachedSize() const { return _impl_._cached_size_.Get(); }
::uint8_t* _InternalSerialize( ::uint8_t* _InternalSerialize(
::uint8_t* target, io::EpsCopyOutputStream* stream) const PROTOBUF_FINAL; ::uint8_t* target, io::EpsCopyOutputStream* stream) const PROTOBUF_FINAL {
return _InternalSerialize(*this, target, stream);
}
protected: protected:
using Message::Message; using Message::Message;
@ -42,6 +44,11 @@ class PROTOBUF_EXPORT ZeroFieldsBase : public Message {
static void MergeImpl(MessageLite& to, const MessageLite& from); static void MergeImpl(MessageLite& to, const MessageLite& from);
static void CopyImpl(Message& to, const Message& from); static void CopyImpl(Message& to, const Message& from);
void InternalSwap(ZeroFieldsBase* other); void InternalSwap(ZeroFieldsBase* other);
static void Clear(MessageLite& msg);
static size_t ByteSizeLong(const MessageLite& msg);
static ::uint8_t* _InternalSerialize(const MessageLite& msg,
::uint8_t* target,
io::EpsCopyOutputStream* stream);
struct { struct {
mutable internal::CachedSize _cached_size_; mutable internal::CachedSize _cached_size_;

@ -71,9 +71,9 @@ constexpr MessageLite::ClassDataLite<1> ImplicitWeakMessage::class_data_ = {
MergeImpl, MergeImpl,
GetDeleteImpl<ImplicitWeakMessage>(), GetDeleteImpl<ImplicitWeakMessage>(),
GetNewImpl<ImplicitWeakMessage>(), GetNewImpl<ImplicitWeakMessage>(),
GetClearImpl<ImplicitWeakMessage>(), &ClearImpl,
GetByteSizeLongImpl<ImplicitWeakMessage>(), &ByteSizeLongImpl,
GetSerializeImpl<ImplicitWeakMessage>(), &_InternalSerializeImpl,
PROTOBUF_FIELD_OFFSET(ImplicitWeakMessage, cached_size_), PROTOBUF_FIELD_OFFSET(ImplicitWeakMessage, cached_size_),
true, true,
}, },

@ -91,6 +91,21 @@ class PROTOBUF_EXPORT ImplicitWeakMessage final : public MessageLite {
static void MergeImpl(MessageLite&, const MessageLite&); static void MergeImpl(MessageLite&, const MessageLite&);
static void ClearImpl(MessageLite& msg) {
static_cast<ImplicitWeakMessage&>(msg).Clear();
}
static size_t ByteSizeLongImpl(const MessageLite& msg) {
return static_cast<const ImplicitWeakMessage&>(msg).ByteSizeLong();
}
static uint8_t* _InternalSerializeImpl(const MessageLite& msg,
uint8_t* target,
io::EpsCopyOutputStream* stream) {
return static_cast<const ImplicitWeakMessage&>(msg)._InternalSerialize(
target, stream);
}
// This std::string is allocated on the heap, but we use a raw pointer so that // This std::string is allocated on the heap, but we use a raw pointer so that
// the default instance can be constant-initialized. In the const methods, we // the default instance can be constant-initialized. In the const methods, we
// have to handle the possibility of data_ being null. // have to handle the possibility of data_ being null.

@ -557,25 +557,6 @@ class PROTOBUF_EXPORT MessageLite {
static constexpr auto GetClearImpl() { static constexpr auto GetClearImpl() {
return ClearImpl<T>; return ClearImpl<T>;
} }
template <typename T>
static auto ByteSizeLongImpl(const MessageLite& msg) {
return static_cast<const T&>(msg).ByteSizeLong();
}
template <typename T>
static constexpr auto GetByteSizeLongImpl() {
return ByteSizeLongImpl<T>;
}
template <typename T>
static uint8_t* SerializeImpl(const MessageLite& msg, uint8_t* target,
io::EpsCopyOutputStream* stream) {
return static_cast<const T&>(msg)._InternalSerialize(target, stream);
}
template <typename T>
static constexpr auto GetSerializeImpl() {
return SerializeImpl<T>;
}
#else // PROTOBUF_CUSTOM_VTABLE #else // PROTOBUF_CUSTOM_VTABLE
// When custom vtables are off we avoid instantiating the functions because we // When custom vtables are off we avoid instantiating the functions because we
// will not use them anyway. Less work for the compiler. // will not use them anyway. Less work for the compiler.
@ -585,10 +566,6 @@ class PROTOBUF_EXPORT MessageLite {
using GetDeleteImpl = std::nullptr_t; using GetDeleteImpl = std::nullptr_t;
template <typename T> template <typename T>
using GetClearImpl = std::nullptr_t; using GetClearImpl = std::nullptr_t;
template <typename T>
using GetByteSizeLongImpl = std::nullptr_t;
template <typename T>
using GetSerializeImpl = std::nullptr_t;
#endif // PROTOBUF_CUSTOM_VTABLE #endif // PROTOBUF_CUSTOM_VTABLE
template <typename T> template <typename T>

Loading…
Cancel
Save