Convert about a third of message_field.cc to use multi-line string literals.

PiperOrigin-RevId: 528628217
pull/12614/head
Matt Kulukundis 2 years ago committed by Copybara-Service
parent 7c95aacc18
commit 110616cf10
  1. 464
      src/google/protobuf/compiler/cpp/field_generators/message_field.cc
  2. 17
      src/google/protobuf/compiler/cpp/field_generators/primitive_field.cc
  3. 9
      src/google/protobuf/compiler/plugin.pb.cc
  4. 145
      src/google/protobuf/compiler/plugin.pb.h
  5. 39
      src/google/protobuf/descriptor.pb.cc
  6. 756
      src/google/protobuf/descriptor.pb.h
  7. 7
      src/google/protobuf/io/printer.cc

@ -38,6 +38,7 @@
#include <vector>
#include "absl/memory/memory.h"
#include "absl/strings/string_view.h"
#include "absl/strings/substitute.h"
#include "google/protobuf/compiler/cpp/field.h"
#include "google/protobuf/compiler/cpp/field_generators/generators.h"
@ -54,35 +55,41 @@ namespace cpp {
namespace {
using ::google::protobuf::internal::cpp::HasHasbit;
using Sub = ::google::protobuf::io::Printer::Sub;
using ::google::protobuf::io::AnnotationCollector;
std::vector<Sub> Vars(const FieldDescriptor* field, const Options& opts,
bool weak) {
bool split = ShouldSplit(field, opts);
bool is_foreign = IsCrossFileMessage(field);
std::string field_name = FieldMemberName(field, split);
std::string type = FieldMessageTypeName(field, opts);
std::string default_ref =
QualifiedDefaultInstanceName(field->message_type(), opts);
std::string default_ptr =
QualifiedDefaultInstancePtr(field->message_type(), opts);
absl::string_view base = "::PROTOBUF_NAMESPACE_ID::MessageLite";
return {
{"Submsg", type},
{"MemberType", !weak ? type : base},
{"CompleteType", !is_foreign ? type : base},
{"kDefault", default_ref},
{"kDefaultPtr", !weak
? default_ptr
: absl::Substitute("reinterpret_cast<const $0*>($1)",
base, default_ptr)},
{"base_cast", absl::Substitute("reinterpret_cast<$0*>",
!is_foreign && !weak ? type : base)},
{"cast_field_",
!weak ? field_name
: absl::Substitute("reinterpret_cast<$0*>($1)", type, field_name)},
{"kDefault", default_ref},
{"kDefaultPtr",
!weak ? default_ptr
: absl::Substitute("reinterpret_cast<const "
"::PROTOBUF_NAMESPACE_ID::MessageLite*>($0)",
default_ptr)},
{"Weak", weak ? "Weak" : ""},
{".weak", weak ? ".weak" : ""},
Sub("StrongRef",
!weak ? ""
: absl::Substitute(
" ::PROTOBUF_NAMESPACE_ID::internal::StrongReference("
" "
"::PROTOBUF_NAMESPACE_ID::internal::StrongReference("
"reinterpret_cast<const $0&>($1));\n",
type, default_ref))
.WithSuffix(";"),
@ -108,10 +115,16 @@ class SingularMessage : public FieldGeneratorBase {
return Vars(field_, *opts_, weak_);
}
void GeneratePrivateMembers(io::Printer* p) const override;
void GeneratePrivateMembers(io::Printer* p) const override {
p->Emit(R"cc(
$MemberType$* $name$_;
)cc");
}
void GenerateNonInlineAccessorDefinitions(io::Printer* p) const override {}
void GenerateAccessorDeclarations(io::Printer* p) const override;
void GenerateInlineAccessorDefinitions(io::Printer* p) const override;
void GenerateNonInlineAccessorDefinitions(io::Printer* p) const override;
void GenerateInternalAccessorDeclarations(io::Printer* p) const override;
void GenerateInternalAccessorDefinitions(io::Printer* p) const override;
void GenerateClearingCode(io::Printer* p) const override;
@ -140,208 +153,169 @@ class SingularMessage : public FieldGeneratorBase {
bool is_foreign_;
};
void SingularMessage::GeneratePrivateMembers(io::Printer* p) const {
if (weak_) {
p->Emit("$pb$::MessageLite* $name$_;\n");
} else {
p->Emit("$Submsg$* $name$_;\n");
void SingularMessage::GenerateAccessorDeclarations(io::Printer* p) const {
auto vars = AnnotatedAccessors(
field_, {"", "set_allocated_", "unsafe_arena_set_allocated_",
"unsafe_arena_release_"});
vars.push_back(Sub{
"release_name",
SafeFunctionName(field_->containing_type(), field_, "release_"),
}
}
.AnnotatedAs(field_));
auto v1 = p->WithVars(vars);
auto v2 = p->WithVars(
AnnotatedAccessors(field_, {"mutable_"}, AnnotationCollector::kAlias));
void SingularMessage::GenerateAccessorDeclarations(io::Printer* p) const {
auto v =
p->WithVars({{"release_name", SafeFunctionName(field_->containing_type(),
field_, "release_")}});
Formatter format(p);
format(
"$DEPRECATED$ const $Submsg$& ${1$$name$$}$() const;\n"
"$DEPRECATED$ PROTOBUF_NODISCARD $Submsg$* "
"${1$$release_name$$}$();\n",
field_);
format("$DEPRECATED$ $Submsg$* ${1$mutable_$name$$}$();\n",
std::make_tuple(field_, GeneratedCodeInfo::Annotation::ALIAS));
format(
"$DEPRECATED$ void ${1$set_allocated_$name$$}$"
"($Submsg$* $name$);\n"
"private:\n"
"const $Submsg$& ${1$_internal_$name$$}$() const;\n"
"$Submsg$* ${1$_internal_mutable_$name$$}$();\n"
"public:\n",
field_);
format(
"$DEPRECATED$ void "
"${1$unsafe_arena_set_allocated_$name$$}$(\n"
" $Submsg$* $name$);\n"
"$DEPRECATED$ $Submsg$* ${1$unsafe_arena_release_$name$$}$();\n",
field_);
}
p->Emit(R"cc(
$DEPRECATED$ const $Submsg$& $name$() const;
$DEPRECATED$ PROTOBUF_NODISCARD $Submsg$* $release_name$();
$DEPRECATED$ $Submsg$* $mutable_name$();
$DEPRECATED$ void $set_allocated_name$($Submsg$* value);
$DEPRECATED$ void $unsafe_arena_set_allocated_name$($Submsg$* value);
$DEPRECATED$ $Submsg$* $unsafe_arena_release_name$();
private:
const $Submsg$& _internal_$name$() const;
$Submsg$* _internal_mutable_$name$();
void SingularMessage::GenerateNonInlineAccessorDefinitions(
io::Printer* p) const {}
public:
)cc");
}
void SingularMessage::GenerateInlineAccessorDefinitions(io::Printer* p) const {
auto v =
p->WithVars({{"release_name", SafeFunctionName(field_->containing_type(),
field_, "release_")}});
p->Emit(
"inline const $Submsg$& $Msg$::_internal_$name$() const {\n"
"$StrongRef$;"
" const $Submsg$* p = $cast_field_$;\n"
" return p != nullptr ? *p : reinterpret_cast<const $Submsg$&>(\n"
" $kDefault$);\n"
"}\n"
"inline const $Submsg$& $Msg$::$name$() const {\n"
"$annotate_get$"
" // @@protoc_insertion_point(field_get:$pkg.Msg.field$)\n"
" return _internal_$name$();\n"
"}\n");
p->Emit(
"inline void $Msg$::unsafe_arena_set_allocated_$name$(\n"
" $Submsg$* $name$) {\n"
"$PrepareSplitMessageForWrite$"
// If we're not on an arena, free whatever we were holding before.
// (If we are on arena, we can just forget the earlier pointer.)
" if (GetArenaForAllocation() == nullptr) {\n"
" delete reinterpret_cast<$pb$::MessageLite*>($field_$);\n"
" }\n");
if (weak_) {
p->Emit(" $field_$ = reinterpret_cast<$pb$::MessageLite*>($name$);\n");
} else {
p->Emit(" $field_$ = $name$;\n");
}
if (has_hasbit_) {
p->Emit(
" if ($name$) {\n"
" $set_hasbit$\n"
" } else {\n"
" $clear_hasbit$\n"
" }\n");
}
p->Emit(
"$annotate_set$"
" // @@protoc_insertion_point(field_unsafe_arena_set_allocated"
":$pkg.Msg.field$)\n"
"}\n");
p->Emit(
"inline $Submsg$* $Msg$::$release_name$() {\n"
"$StrongRef$;"
"$annotate_release$"
"$PrepareSplitMessageForWrite$"
" $clear_hasbit$\n"
" $Submsg$* temp = $cast_field_$;\n"
" $field_$ = nullptr;\n"
"#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE\n"
" auto* old = reinterpret_cast<$pb$::MessageLite*>(temp);\n"
" temp = $pbi$::DuplicateIfNonNull(temp);\n"
" if (GetArenaForAllocation() == nullptr) { delete old; }\n"
"#else // PROTOBUF_FORCE_COPY_IN_RELEASE\n"
" if (GetArenaForAllocation() != nullptr) {\n"
" temp = $pbi$::DuplicateIfNonNull(temp);\n"
" }\n"
"#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE\n"
" return temp;\n"
"}\n"
"inline $Submsg$* $Msg$::unsafe_arena_release_$name$() {\n"
"$annotate_release$"
" // @@protoc_insertion_point(field_release:$pkg.Msg.field$)\n"
"$StrongRef$;"
"$PrepareSplitMessageForWrite$"
" $clear_hasbit$\n"
" $Submsg$* temp = $cast_field_$;\n"
" $field_$ = nullptr;\n"
" return temp;\n"
"}\n");
p->Emit(
"inline $Submsg$* $Msg$::_internal_mutable_$name$() {\n"
"$StrongRef$;"
" $set_hasbit$\n"
" if ($field_$ == nullptr) {\n"
" auto* p = CreateMaybeMessage<$Submsg$>(GetArenaForAllocation());\n");
if (weak_) {
p->Emit(" $field_$ = reinterpret_cast<$pb$::MessageLite*>(p);\n");
} else {
p->Emit(" $field_$ = p;\n");
}
p->Emit(
" }\n"
" return $cast_field_$;\n"
"}\n"
"inline $Submsg$* $Msg$::mutable_$name$() {\n"
// TODO(b/122856539): add tests to make sure all write accessors are able
// to prepare split message allocation.
"$PrepareSplitMessageForWrite$"
" $Submsg$* _msg = _internal_mutable_$name$();\n"
"$annotate_mutable$"
" // @@protoc_insertion_point(field_mutable:$pkg.Msg.field$)\n"
" return _msg;\n"
"}\n");
// We handle the most common case inline, and delegate less common cases to
// the slow fallback function.
p->Emit(
"inline void $Msg$::set_allocated_$name$($Submsg$* $name$) {\n"
" $pb$::Arena* message_arena = GetArenaForAllocation();\n");
p->Emit(
"$PrepareSplitMessageForWrite$"
" if (message_arena == nullptr) {\n");
if (is_foreign_) {
p->Emit(
" delete reinterpret_cast< "
"$pb$::MessageLite*>($field_$);\n");
} else {
p->Emit(" delete $field_$;\n");
}
p->Emit(
" }\n"
" if ($name$) {\n");
if (is_foreign_) {
// We have to read the arena through the virtual method, because the type
// isn't defined in this file.
p->Emit(
" $pb$::Arena* submessage_arena =\n"
" $pb$::Arena::InternalGetOwningArena(\n"
" reinterpret_cast<$pb$::MessageLite*>("
"$name$));\n");
} else {
p->Emit(
" $pb$::Arena* submessage_arena =\n"
" $pb$::Arena::InternalGetOwningArena("
"$name$);\n");
}
p->Emit(
" if (message_arena != submessage_arena) {\n"
" $name$ = $pbi$::GetOwnedMessage(\n"
" message_arena, $name$, submessage_arena);\n"
" }\n"
" $set_hasbit$\n"
" } else {\n"
" $clear_hasbit$\n"
" }\n");
if (weak_) {
p->Emit(" $field_$ = reinterpret_cast<MessageLite*>($name$);\n");
} else {
p->Emit(" $field_$ = $name$;\n");
}
p->Emit(
"$annotate_set$"
" // @@protoc_insertion_point(field_set_allocated:$pkg.Msg.field$)\n"
"}\n");
{
{"update_hasbit",
[&] {
if (!has_hasbit_) return;
p->Emit(R"cc(
if (value != nullptr) {
$set_hasbit$
} else {
$clear_hasbit$
}
)cc");
}},
},
R"cc(
inline const $Submsg$& $Msg$::_internal_$name$() const {
$StrongRef$;
const $Submsg$* p = $cast_field_$;
return p != nullptr ? *p : reinterpret_cast<const $Submsg$&>($kDefault$);
}
inline const $Submsg$& $Msg$::$name$() const {
$annotate_get$;
// @@protoc_insertion_point(field_get:$pkg.Msg.field$)
return _internal_$name$();
}
inline void $Msg$::unsafe_arena_set_allocated_$name$($Submsg$* value) {
$PrepareSplitMessageForWrite$;
//~ If we're not on an arena, free whatever we were holding before.
//~ (If we are on arena, we can just forget the earlier pointer.)
if (GetArenaForAllocation() == nullptr) {
delete reinterpret_cast<$pb$::MessageLite*>($field_$);
}
$field_$ = reinterpret_cast<$MemberType$*>(value);
$update_hasbit$;
$annotate_set$;
// @@protoc_insertion_point(field_unsafe_arena_set_allocated:$pkg.Msg.field$)
}
inline $Submsg$* $Msg$::$release_name$() {
$StrongRef$;
$annotate_release$;
$PrepareSplitMessageForWrite$;
$clear_hasbit$;
$Submsg$* released = $cast_field_$;
$field_$ = nullptr;
#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
auto* old = reinterpret_cast<$pb$::MessageLite*>(released);
released = $pbi$::DuplicateIfNonNull(released);
if (GetArenaForAllocation() == nullptr) {
delete old;
}
#else // PROTOBUF_FORCE_COPY_IN_RELEASE
if (GetArenaForAllocation() != nullptr) {
released = $pbi$::DuplicateIfNonNull(released);
}
#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE
return released;
}
inline $Submsg$* $Msg$::unsafe_arena_release_$name$() {
$annotate_release$;
// @@protoc_insertion_point(field_release:$pkg.Msg.field$)
$StrongRef$;
$PrepareSplitMessageForWrite$;
$clear_hasbit$;
$Submsg$* temp = $cast_field_$;
$field_$ = nullptr;
return temp;
}
inline $Submsg$* $Msg$::_internal_mutable_$name$() {
$StrongRef$;
$set_hasbit$;
if ($field_$ == nullptr) {
auto* p = CreateMaybeMessage<$Submsg$>(GetArenaForAllocation());
$field_$ = reinterpret_cast<$MemberType$*>(p);
}
return $cast_field_$;
}
inline $Submsg$* $Msg$::mutable_$name$() {
//~ TODO(b/122856539): add tests to make sure all write accessors are
//~ able to prepare split message allocation.
$PrepareSplitMessageForWrite$;
$Submsg$* _msg = _internal_mutable_$name$();
$annotate_mutable$;
// @@protoc_insertion_point(field_mutable:$pkg.Msg.field$)
return _msg;
}
//~ We handle the most common case inline, and delegate less common
//~ cases to the slow fallback function.
inline void $Msg$::set_allocated_$name$($Submsg$* value) {
$pb$::Arena* message_arena = GetArenaForAllocation();
$PrepareSplitMessageForWrite$;
if (message_arena == nullptr) {
delete $base_cast$($field_$);
}
if (value != nullptr) {
//~ When $Submsg$ is a cross-file type, have to read the arena
//~ through the virtual method, because the type isn't defined in
//~ this file, only forward-declated.
$pb$::Arena* submessage_arena =
$pb$::Arena::InternalGetOwningArena($base_cast$(value));
if (message_arena != submessage_arena) {
value = $pbi$::GetOwnedMessage(message_arena, value, submessage_arena);
}
$set_hasbit$;
} else {
$clear_hasbit$;
}
$field_$ = reinterpret_cast<$MemberType$*>(value);
$annotate_set$;
// @@protoc_insertion_point(field_set_allocated:$pkg.Msg.field$)
}
)cc");
}
void SingularMessage::GenerateInternalAccessorDeclarations(
io::Printer* p) const {
if (weak_) {
p->Emit(
"static const $pb$::MessageLite& $name$("
"const $Msg$* msg);\n"
"static $pb$::MessageLite* mutable_$name$("
"$Msg$* msg);\n");
} else {
p->Emit("static const $Submsg$& $name$(const $Msg$* msg);\n");
if (!weak_) {
p->Emit(R"cc(
static const $Submsg$& $name$(const $Msg$* msg);
)cc");
return;
}
p->Emit(R"cc(
static const $pb$::MessageLite& $name$(const $Msg$* msg);
static $pb$::MessageLite* mutable_$name$($Msg$* msg);
)cc");
}
void SingularMessage::GenerateInternalAccessorDefinitions(
@ -349,49 +323,65 @@ void SingularMessage::GenerateInternalAccessorDefinitions(
// In theory, these accessors could be inline in _Internal. However, in
// practice, the linker is then not able to throw them out making implicit
// weak dependencies not work at all.
if (weak_) {
// These private accessors are used by MergeFrom and
// MergePartialFromCodedStream, and their purpose is to provide access to
// the field without creating a strong dependency on the message type.
p->Emit(
"const $pb$::MessageLite& $Msg$::_Internal::$name$(\n"
" const $Msg$* msg) {\n"
" if (msg->$field_$ != nullptr) {\n"
" return *msg->$field_$;\n"
" } else {\n"
" return *$kDefaultPtr$;\n"
" }\n"
"}\n");
p->Emit(
"$pb$::MessageLite*\n"
"$Msg$::_Internal::mutable_$name$($Msg$* msg) {\n");
if (has_hasbit_) {
p->Emit(" msg->$set_hasbit$\n");
}
if (!is_oneof_) {
p->Emit(" if (msg->$field_$ == nullptr) {\n");
} else {
p->Emit(
" if (msg->$not_has_field$) {\n"
" msg->clear_$oneof_name$();\n"
" msg->set_has_$name$();\n");
}
p->Emit(
" msg->$field_$ = $kDefaultPtr$->New(\n"
" msg->GetArenaForAllocation());\n"
" }\n"
" return msg->$field_$;\n"
"}\n");
} else {
if (!weak_) {
// This inline accessor directly returns member field and is used in
// Serialize such that AFDO profile correctly captures access information to
// message fields under serialize.
p->Emit(
"const $Submsg$&\n"
"$Msg$::_Internal::$name$(const $Msg$* msg) {\n"
" return *msg->$field_$;\n"
"}\n");
p->Emit(R"cc(
const $Submsg$& $Msg$::_Internal::$name$(const $Msg$* msg) {
return *msg->$field_$;
}
)cc");
return;
}
// These private accessors are used by MergeFrom and
// MergePartialFromCodedStream, and their purpose is to provide access to
// the field without creating a strong dependency on the message type.
p->Emit(
{
{"update_hasbit",
[&] {
if (!has_hasbit_) return;
p->Emit(R"cc(
msg->$set_hasbit$;
)cc");
}},
{"is_already_set",
[&] {
if (!is_oneof_) {
p->Emit("msg->$field_$ == nullptr");
} else {
p->Emit("msg->$not_has_field$");
}
}},
{"clear_oneof",
[&] {
if (!is_oneof_) return;
p->Emit(R"cc(
msg->clear_$oneof_name$();
msg->set_has_$name$();
)cc");
}},
},
R"cc(
const $pb$::MessageLite& $Msg$::_Internal::$name$(const $Msg$* msg) {
if (msg->$field_$ != nullptr) {
return *msg->$field_$;
} else {
return *$kDefaultPtr$;
}
}
$pb$::MessageLite* $Msg$::_Internal::mutable_$name$($Msg$* msg) {
$update_hasbit$;
if ($is_already_set$) {
$clear_oneof$;
msg->$field_$ = $kDefaultPtr$->New(msg->GetArenaForAllocation());
}
return msg->$field_$;
}
)cc");
}
void SingularMessage::GenerateClearingCode(io::Printer* p) const {

@ -198,17 +198,16 @@ void SingularPrimitive::GenerateAccessorDeclarations(io::Printer* p) const {
auto v = p->WithVars(
AnnotatedAccessors(field_, {"", "_internal_", "_internal_set_"}));
auto vs = p->WithVars(AnnotatedAccessors(field_, {"set_"}, Semantic::kSet));
p->Emit(
R"cc(
$DEPRECATED$ $Type$ $name$() const;
$DEPRECATED$ void $set_name$($Type$ value);
p->Emit(R"cc(
$DEPRECATED$ $Type$ $name$() const;
$DEPRECATED$ void $set_name$($Type$ value);
private:
$Type$ $_internal_name$() const;
void $_internal_set_name$($Type$ value);
private:
$Type$ $_internal_name$() const;
void $_internal_set_name$($Type$ value);
public:
)cc");
public:
)cc");
}
void SingularPrimitive::GenerateInlineAccessorDefinitions(

@ -637,8 +637,7 @@ class CodeGeneratorRequest::_Internal {
}
};
const ::PROTOBUF_NAMESPACE_ID::compiler::Version&
CodeGeneratorRequest::_Internal::compiler_version(const CodeGeneratorRequest* msg) {
const ::PROTOBUF_NAMESPACE_ID::compiler::Version& CodeGeneratorRequest::_Internal::compiler_version(const CodeGeneratorRequest* msg) {
return *msg->_impl_.compiler_version_;
}
void CodeGeneratorRequest::clear_proto_file() {
@ -991,8 +990,7 @@ class CodeGeneratorResponse_File::_Internal {
}
};
const ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo&
CodeGeneratorResponse_File::_Internal::generated_code_info(const CodeGeneratorResponse_File* msg) {
const ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo& CodeGeneratorResponse_File::_Internal::generated_code_info(const CodeGeneratorResponse_File* msg) {
return *msg->_impl_.generated_code_info_;
}
void CodeGeneratorResponse_File::clear_generated_code_info() {
@ -1633,8 +1631,7 @@ void CodeGeneratorResponse::InternalSwap(CodeGeneratorResponse* other) {
_internal_mutable_file()->InternalSwap(other->_internal_mutable_file());
::_pbi::ArenaStringPtr::InternalSwap(&_impl_.error_, lhs_arena,
&other->_impl_.error_, rhs_arena);
swap(_impl_.supported_features_, other->_impl_.supported_features_);
swap(_impl_.supported_features_, other->_impl_.supported_features_);
}
::PROTOBUF_NAMESPACE_ID::Metadata CodeGeneratorResponse::GetMetadata() const {

@ -255,10 +255,6 @@ class PROTOC_EXPORT Version final :
bool has_suffix() const;
void clear_suffix() ;
const std::string& suffix() const;
template <typename Arg_ = const std::string&, typename... Args_>
void set_suffix(Arg_&& arg, Args_... args);
std::string* mutable_suffix();
@ -506,10 +502,6 @@ class PROTOC_EXPORT CodeGeneratorRequest final :
bool has_parameter() const;
void clear_parameter() ;
const std::string& parameter() const;
template <typename Arg_ = const std::string&, typename... Args_>
void set_parameter(Arg_&& arg, Args_... args);
std::string* mutable_parameter();
@ -529,14 +521,15 @@ class PROTOC_EXPORT CodeGeneratorRequest final :
const ::PROTOBUF_NAMESPACE_ID::compiler::Version& compiler_version() const;
PROTOBUF_NODISCARD ::PROTOBUF_NAMESPACE_ID::compiler::Version* release_compiler_version();
::PROTOBUF_NAMESPACE_ID::compiler::Version* mutable_compiler_version();
void set_allocated_compiler_version(::PROTOBUF_NAMESPACE_ID::compiler::Version* compiler_version);
void set_allocated_compiler_version(::PROTOBUF_NAMESPACE_ID::compiler::Version* value);
void unsafe_arena_set_allocated_compiler_version(::PROTOBUF_NAMESPACE_ID::compiler::Version* value);
::PROTOBUF_NAMESPACE_ID::compiler::Version* unsafe_arena_release_compiler_version();
private:
const ::PROTOBUF_NAMESPACE_ID::compiler::Version& _internal_compiler_version() const;
::PROTOBUF_NAMESPACE_ID::compiler::Version* _internal_mutable_compiler_version();
public:
void unsafe_arena_set_allocated_compiler_version(
::PROTOBUF_NAMESPACE_ID::compiler::Version* compiler_version);
::PROTOBUF_NAMESPACE_ID::compiler::Version* unsafe_arena_release_compiler_version();
// @@protoc_insertion_point(class_scope:google.protobuf.compiler.CodeGeneratorRequest)
private:
class _Internal;
@ -692,10 +685,6 @@ class PROTOC_EXPORT CodeGeneratorResponse_File final :
bool has_name() const;
void clear_name() ;
const std::string& name() const;
template <typename Arg_ = const std::string&, typename... Args_>
void set_name(Arg_&& arg, Args_... args);
std::string* mutable_name();
@ -713,10 +702,6 @@ class PROTOC_EXPORT CodeGeneratorResponse_File final :
bool has_insertion_point() const;
void clear_insertion_point() ;
const std::string& insertion_point() const;
template <typename Arg_ = const std::string&, typename... Args_>
void set_insertion_point(Arg_&& arg, Args_... args);
std::string* mutable_insertion_point();
@ -734,10 +719,6 @@ class PROTOC_EXPORT CodeGeneratorResponse_File final :
bool has_content() const;
void clear_content() ;
const std::string& content() const;
template <typename Arg_ = const std::string&, typename... Args_>
void set_content(Arg_&& arg, Args_... args);
std::string* mutable_content();
@ -757,14 +738,15 @@ class PROTOC_EXPORT CodeGeneratorResponse_File final :
const ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo& generated_code_info() const;
PROTOBUF_NODISCARD ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* release_generated_code_info();
::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* mutable_generated_code_info();
void set_allocated_generated_code_info(::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* generated_code_info);
void set_allocated_generated_code_info(::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* value);
void unsafe_arena_set_allocated_generated_code_info(::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* value);
::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* unsafe_arena_release_generated_code_info();
private:
const ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo& _internal_generated_code_info() const;
::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* _internal_mutable_generated_code_info();
public:
void unsafe_arena_set_allocated_generated_code_info(
::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* generated_code_info);
::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* unsafe_arena_release_generated_code_info();
// @@protoc_insertion_point(class_scope:google.protobuf.compiler.CodeGeneratorResponse.File)
private:
class _Internal;
@ -959,10 +941,6 @@ class PROTOC_EXPORT CodeGeneratorResponse final :
bool has_error() const;
void clear_error() ;
const std::string& error() const;
template <typename Arg_ = const std::string&, typename... Args_>
void set_error(Arg_&& arg, Args_... args);
std::string* mutable_error();
@ -1126,8 +1104,6 @@ inline const std::string& Version::_internal_suffix() const {
}
inline void Version::_internal_set_suffix(const std::string& value) {
_impl_._has_bits_[0] |= 0x00000001u;
_impl_.suffix_.Set(value, GetArenaForAllocation());
}
inline std::string* Version::_internal_mutable_suffix() {
@ -1282,8 +1258,6 @@ inline const std::string& CodeGeneratorRequest::_internal_parameter() const {
}
inline void CodeGeneratorRequest::_internal_set_parameter(const std::string& value) {
_impl_._has_bits_[0] |= 0x00000001u;
_impl_.parameter_.Set(value, GetArenaForAllocation());
}
inline std::string* CodeGeneratorRequest::_internal_mutable_parameter() {
@ -1368,20 +1342,18 @@ inline void CodeGeneratorRequest::clear_compiler_version() {
}
inline const ::PROTOBUF_NAMESPACE_ID::compiler::Version& CodeGeneratorRequest::_internal_compiler_version() const {
const ::PROTOBUF_NAMESPACE_ID::compiler::Version* p = _impl_.compiler_version_;
return p != nullptr ? *p : reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::compiler::Version&>(
::PROTOBUF_NAMESPACE_ID::compiler::_Version_default_instance_);
return p != nullptr ? *p : reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::compiler::Version&>(::PROTOBUF_NAMESPACE_ID::compiler::_Version_default_instance_);
}
inline const ::PROTOBUF_NAMESPACE_ID::compiler::Version& CodeGeneratorRequest::compiler_version() const {
// @@protoc_insertion_point(field_get:google.protobuf.compiler.CodeGeneratorRequest.compiler_version)
return _internal_compiler_version();
}
inline void CodeGeneratorRequest::unsafe_arena_set_allocated_compiler_version(
::PROTOBUF_NAMESPACE_ID::compiler::Version* compiler_version) {
inline void CodeGeneratorRequest::unsafe_arena_set_allocated_compiler_version(::PROTOBUF_NAMESPACE_ID::compiler::Version* value) {
if (GetArenaForAllocation() == nullptr) {
delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.compiler_version_);
}
_impl_.compiler_version_ = compiler_version;
if (compiler_version) {
_impl_.compiler_version_ = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::compiler::Version*>(value);
if (value != nullptr) {
_impl_._has_bits_[0] |= 0x00000002u;
} else {
_impl_._has_bits_[0] &= ~0x00000002u;
@ -1389,22 +1361,26 @@ inline void CodeGeneratorRequest::unsafe_arena_set_allocated_compiler_version(
// @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.compiler.CodeGeneratorRequest.compiler_version)
}
inline ::PROTOBUF_NAMESPACE_ID::compiler::Version* CodeGeneratorRequest::release_compiler_version() {
_impl_._has_bits_[0] &= ~0x00000002u;
::PROTOBUF_NAMESPACE_ID::compiler::Version* temp = _impl_.compiler_version_;
::PROTOBUF_NAMESPACE_ID::compiler::Version* released = _impl_.compiler_version_;
_impl_.compiler_version_ = nullptr;
#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
if (GetArenaForAllocation() == nullptr) { delete old; }
#else // PROTOBUF_FORCE_COPY_IN_RELEASE
auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(released);
released = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(released);
if (GetArenaForAllocation() == nullptr) {
delete old;
}
#else // PROTOBUF_FORCE_COPY_IN_RELEASE
if (GetArenaForAllocation() != nullptr) {
temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
released = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(released);
}
#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE
return temp;
return released;
}
inline ::PROTOBUF_NAMESPACE_ID::compiler::Version* CodeGeneratorRequest::unsafe_arena_release_compiler_version() {
// @@protoc_insertion_point(field_release:google.protobuf.compiler.CodeGeneratorRequest.compiler_version)
_impl_._has_bits_[0] &= ~0x00000002u;
::PROTOBUF_NAMESPACE_ID::compiler::Version* temp = _impl_.compiler_version_;
_impl_.compiler_version_ = nullptr;
@ -1414,7 +1390,7 @@ inline ::PROTOBUF_NAMESPACE_ID::compiler::Version* CodeGeneratorRequest::_intern
_impl_._has_bits_[0] |= 0x00000002u;
if (_impl_.compiler_version_ == nullptr) {
auto* p = CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::compiler::Version>(GetArenaForAllocation());
_impl_.compiler_version_ = p;
_impl_.compiler_version_ = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::compiler::Version*>(p);
}
return _impl_.compiler_version_;
}
@ -1423,23 +1399,24 @@ inline ::PROTOBUF_NAMESPACE_ID::compiler::Version* CodeGeneratorRequest::mutable
// @@protoc_insertion_point(field_mutable:google.protobuf.compiler.CodeGeneratorRequest.compiler_version)
return _msg;
}
inline void CodeGeneratorRequest::set_allocated_compiler_version(::PROTOBUF_NAMESPACE_ID::compiler::Version* compiler_version) {
inline void CodeGeneratorRequest::set_allocated_compiler_version(::PROTOBUF_NAMESPACE_ID::compiler::Version* value) {
::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
if (message_arena == nullptr) {
delete _impl_.compiler_version_;
delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::compiler::Version*>(_impl_.compiler_version_);
}
if (compiler_version) {
if (value != nullptr) {
::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(compiler_version);
::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(reinterpret_cast<::PROTOBUF_NAMESPACE_ID::compiler::Version*>(value));
if (message_arena != submessage_arena) {
compiler_version = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
message_arena, compiler_version, submessage_arena);
value = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(message_arena, value, submessage_arena);
}
_impl_._has_bits_[0] |= 0x00000002u;
} else {
_impl_._has_bits_[0] &= ~0x00000002u;
}
_impl_.compiler_version_ = compiler_version;
_impl_.compiler_version_ = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::compiler::Version*>(value);
// @@protoc_insertion_point(field_set_allocated:google.protobuf.compiler.CodeGeneratorRequest.compiler_version)
}
@ -1477,8 +1454,6 @@ inline const std::string& CodeGeneratorResponse_File::_internal_name() const {
}
inline void CodeGeneratorResponse_File::_internal_set_name(const std::string& value) {
_impl_._has_bits_[0] |= 0x00000001u;
_impl_.name_.Set(value, GetArenaForAllocation());
}
inline std::string* CodeGeneratorResponse_File::_internal_mutable_name() {
@ -1542,8 +1517,6 @@ inline const std::string& CodeGeneratorResponse_File::_internal_insertion_point(
}
inline void CodeGeneratorResponse_File::_internal_set_insertion_point(const std::string& value) {
_impl_._has_bits_[0] |= 0x00000002u;
_impl_.insertion_point_.Set(value, GetArenaForAllocation());
}
inline std::string* CodeGeneratorResponse_File::_internal_mutable_insertion_point() {
@ -1607,8 +1580,6 @@ inline const std::string& CodeGeneratorResponse_File::_internal_content() const
}
inline void CodeGeneratorResponse_File::_internal_set_content(const std::string& value) {
_impl_._has_bits_[0] |= 0x00000004u;
_impl_.content_.Set(value, GetArenaForAllocation());
}
inline std::string* CodeGeneratorResponse_File::_internal_mutable_content() {
@ -1650,20 +1621,18 @@ inline bool CodeGeneratorResponse_File::has_generated_code_info() const {
}
inline const ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo& CodeGeneratorResponse_File::_internal_generated_code_info() const {
const ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* p = _impl_.generated_code_info_;
return p != nullptr ? *p : reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo&>(
::PROTOBUF_NAMESPACE_ID::_GeneratedCodeInfo_default_instance_);
return p != nullptr ? *p : reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo&>(::PROTOBUF_NAMESPACE_ID::_GeneratedCodeInfo_default_instance_);
}
inline const ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo& CodeGeneratorResponse_File::generated_code_info() const {
// @@protoc_insertion_point(field_get:google.protobuf.compiler.CodeGeneratorResponse.File.generated_code_info)
return _internal_generated_code_info();
}
inline void CodeGeneratorResponse_File::unsafe_arena_set_allocated_generated_code_info(
::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* generated_code_info) {
inline void CodeGeneratorResponse_File::unsafe_arena_set_allocated_generated_code_info(::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* value) {
if (GetArenaForAllocation() == nullptr) {
delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.generated_code_info_);
}
_impl_.generated_code_info_ = generated_code_info;
if (generated_code_info) {
_impl_.generated_code_info_ = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo*>(value);
if (value != nullptr) {
_impl_._has_bits_[0] |= 0x00000008u;
} else {
_impl_._has_bits_[0] &= ~0x00000008u;
@ -1671,22 +1640,26 @@ inline void CodeGeneratorResponse_File::unsafe_arena_set_allocated_generated_cod
// @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.compiler.CodeGeneratorResponse.File.generated_code_info)
}
inline ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* CodeGeneratorResponse_File::release_generated_code_info() {
_impl_._has_bits_[0] &= ~0x00000008u;
::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* temp = _impl_.generated_code_info_;
::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* released = _impl_.generated_code_info_;
_impl_.generated_code_info_ = nullptr;
#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
if (GetArenaForAllocation() == nullptr) { delete old; }
#else // PROTOBUF_FORCE_COPY_IN_RELEASE
auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(released);
released = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(released);
if (GetArenaForAllocation() == nullptr) {
delete old;
}
#else // PROTOBUF_FORCE_COPY_IN_RELEASE
if (GetArenaForAllocation() != nullptr) {
temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
released = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(released);
}
#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE
return temp;
return released;
}
inline ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* CodeGeneratorResponse_File::unsafe_arena_release_generated_code_info() {
// @@protoc_insertion_point(field_release:google.protobuf.compiler.CodeGeneratorResponse.File.generated_code_info)
_impl_._has_bits_[0] &= ~0x00000008u;
::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* temp = _impl_.generated_code_info_;
_impl_.generated_code_info_ = nullptr;
@ -1696,7 +1669,7 @@ inline ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* CodeGeneratorResponse_File::_
_impl_._has_bits_[0] |= 0x00000008u;
if (_impl_.generated_code_info_ == nullptr) {
auto* p = CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo>(GetArenaForAllocation());
_impl_.generated_code_info_ = p;
_impl_.generated_code_info_ = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo*>(p);
}
return _impl_.generated_code_info_;
}
@ -1705,24 +1678,24 @@ inline ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* CodeGeneratorResponse_File::m
// @@protoc_insertion_point(field_mutable:google.protobuf.compiler.CodeGeneratorResponse.File.generated_code_info)
return _msg;
}
inline void CodeGeneratorResponse_File::set_allocated_generated_code_info(::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* generated_code_info) {
inline void CodeGeneratorResponse_File::set_allocated_generated_code_info(::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* value) {
::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
if (message_arena == nullptr) {
delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.generated_code_info_);
delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.generated_code_info_);
}
if (generated_code_info) {
if (value != nullptr) {
::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(
reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(generated_code_info));
::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(value));
if (message_arena != submessage_arena) {
generated_code_info = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
message_arena, generated_code_info, submessage_arena);
value = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(message_arena, value, submessage_arena);
}
_impl_._has_bits_[0] |= 0x00000008u;
} else {
_impl_._has_bits_[0] &= ~0x00000008u;
}
_impl_.generated_code_info_ = generated_code_info;
_impl_.generated_code_info_ = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo*>(value);
// @@protoc_insertion_point(field_set_allocated:google.protobuf.compiler.CodeGeneratorResponse.File.generated_code_info)
}
@ -1760,8 +1733,6 @@ inline const std::string& CodeGeneratorResponse::_internal_error() const {
}
inline void CodeGeneratorResponse::_internal_set_error(const std::string& value) {
_impl_._has_bits_[0] |= 0x00000001u;
_impl_.error_.Set(value, GetArenaForAllocation());
}
inline std::string* CodeGeneratorResponse::_internal_mutable_error() {

@ -2044,12 +2044,10 @@ class FileDescriptorProto::_Internal {
}
};
const ::PROTOBUF_NAMESPACE_ID::FileOptions&
FileDescriptorProto::_Internal::options(const FileDescriptorProto* msg) {
const ::PROTOBUF_NAMESPACE_ID::FileOptions& FileDescriptorProto::_Internal::options(const FileDescriptorProto* msg) {
return *msg->_impl_.options_;
}
const ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo&
FileDescriptorProto::_Internal::source_code_info(const FileDescriptorProto* msg) {
const ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo& FileDescriptorProto::_Internal::source_code_info(const FileDescriptorProto* msg) {
return *msg->_impl_.source_code_info_;
}
FileDescriptorProto::FileDescriptorProto(::PROTOBUF_NAMESPACE_ID::Arena* arena)
@ -2791,8 +2789,7 @@ class DescriptorProto_ExtensionRange::_Internal {
}
};
const ::PROTOBUF_NAMESPACE_ID::ExtensionRangeOptions&
DescriptorProto_ExtensionRange::_Internal::options(const DescriptorProto_ExtensionRange* msg) {
const ::PROTOBUF_NAMESPACE_ID::ExtensionRangeOptions& DescriptorProto_ExtensionRange::_Internal::options(const DescriptorProto_ExtensionRange* msg) {
return *msg->_impl_.options_;
}
DescriptorProto_ExtensionRange::DescriptorProto_ExtensionRange(::PROTOBUF_NAMESPACE_ID::Arena* arena)
@ -3315,8 +3312,7 @@ class DescriptorProto::_Internal {
}
};
const ::PROTOBUF_NAMESPACE_ID::MessageOptions&
DescriptorProto::_Internal::options(const DescriptorProto* msg) {
const ::PROTOBUF_NAMESPACE_ID::MessageOptions& DescriptorProto::_Internal::options(const DescriptorProto* msg) {
return *msg->_impl_.options_;
}
DescriptorProto::DescriptorProto(::PROTOBUF_NAMESPACE_ID::Arena* arena)
@ -4622,8 +4618,7 @@ class FieldDescriptorProto::_Internal {
}
};
const ::PROTOBUF_NAMESPACE_ID::FieldOptions&
FieldDescriptorProto::_Internal::options(const FieldDescriptorProto* msg) {
const ::PROTOBUF_NAMESPACE_ID::FieldOptions& FieldDescriptorProto::_Internal::options(const FieldDescriptorProto* msg) {
return *msg->_impl_.options_;
}
FieldDescriptorProto::FieldDescriptorProto(::PROTOBUF_NAMESPACE_ID::Arena* arena)
@ -5278,8 +5273,7 @@ class OneofDescriptorProto::_Internal {
}
};
const ::PROTOBUF_NAMESPACE_ID::OneofOptions&
OneofDescriptorProto::_Internal::options(const OneofDescriptorProto* msg) {
const ::PROTOBUF_NAMESPACE_ID::OneofOptions& OneofDescriptorProto::_Internal::options(const OneofDescriptorProto* msg) {
return *msg->_impl_.options_;
}
OneofDescriptorProto::OneofDescriptorProto(::PROTOBUF_NAMESPACE_ID::Arena* arena)
@ -5783,8 +5777,7 @@ class EnumDescriptorProto::_Internal {
}
};
const ::PROTOBUF_NAMESPACE_ID::EnumOptions&
EnumDescriptorProto::_Internal::options(const EnumDescriptorProto* msg) {
const ::PROTOBUF_NAMESPACE_ID::EnumOptions& EnumDescriptorProto::_Internal::options(const EnumDescriptorProto* msg) {
return *msg->_impl_.options_;
}
EnumDescriptorProto::EnumDescriptorProto(::PROTOBUF_NAMESPACE_ID::Arena* arena)
@ -6169,8 +6162,7 @@ class EnumValueDescriptorProto::_Internal {
}
};
const ::PROTOBUF_NAMESPACE_ID::EnumValueOptions&
EnumValueDescriptorProto::_Internal::options(const EnumValueDescriptorProto* msg) {
const ::PROTOBUF_NAMESPACE_ID::EnumValueOptions& EnumValueDescriptorProto::_Internal::options(const EnumValueDescriptorProto* msg) {
return *msg->_impl_.options_;
}
EnumValueDescriptorProto::EnumValueDescriptorProto(::PROTOBUF_NAMESPACE_ID::Arena* arena)
@ -6478,8 +6470,7 @@ class ServiceDescriptorProto::_Internal {
}
};
const ::PROTOBUF_NAMESPACE_ID::ServiceOptions&
ServiceDescriptorProto::_Internal::options(const ServiceDescriptorProto* msg) {
const ::PROTOBUF_NAMESPACE_ID::ServiceOptions& ServiceDescriptorProto::_Internal::options(const ServiceDescriptorProto* msg) {
return *msg->_impl_.options_;
}
ServiceDescriptorProto::ServiceDescriptorProto(::PROTOBUF_NAMESPACE_ID::Arena* arena)
@ -6798,8 +6789,7 @@ class MethodDescriptorProto::_Internal {
}
};
const ::PROTOBUF_NAMESPACE_ID::MethodOptions&
MethodDescriptorProto::_Internal::options(const MethodDescriptorProto* msg) {
const ::PROTOBUF_NAMESPACE_ID::MethodOptions& MethodDescriptorProto::_Internal::options(const MethodDescriptorProto* msg) {
return *msg->_impl_.options_;
}
MethodDescriptorProto::MethodDescriptorProto(::PROTOBUF_NAMESPACE_ID::Arena* arena)
@ -10169,8 +10159,7 @@ void EnumValueOptions::InternalSwap(EnumValueOptions* other) {
_internal_metadata_.InternalSwap(&other->_internal_metadata_);
swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
_internal_mutable_uninterpreted_option()->InternalSwap(other->_internal_mutable_uninterpreted_option());
swap(_impl_.deprecated_, other->_impl_.deprecated_);
swap(_impl_.deprecated_, other->_impl_.deprecated_);
}
::PROTOBUF_NAMESPACE_ID::Metadata EnumValueOptions::GetMetadata() const {
@ -10422,8 +10411,7 @@ void ServiceOptions::InternalSwap(ServiceOptions* other) {
_internal_metadata_.InternalSwap(&other->_internal_metadata_);
swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
_internal_mutable_uninterpreted_option()->InternalSwap(other->_internal_mutable_uninterpreted_option());
swap(_impl_.deprecated_, other->_impl_.deprecated_);
swap(_impl_.deprecated_, other->_impl_.deprecated_);
}
::PROTOBUF_NAMESPACE_ID::Metadata ServiceOptions::GetMetadata() const {
@ -11004,8 +10992,7 @@ void UninterpretedOption_NamePart::InternalSwap(UninterpretedOption_NamePart* ot
swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
::_pbi::ArenaStringPtr::InternalSwap(&_impl_.name_part_, lhs_arena,
&other->_impl_.name_part_, rhs_arena);
swap(_impl_.is_extension_, other->_impl_.is_extension_);
swap(_impl_.is_extension_, other->_impl_.is_extension_);
}
::PROTOBUF_NAMESPACE_ID::Metadata UninterpretedOption_NamePart::GetMetadata() const {

File diff suppressed because it is too large Load Diff

@ -174,7 +174,12 @@ Printer::Format Printer::TokenizeFormat(absl::string_view format_string,
for (absl::string_view line_text : absl::StrSplit(format_string, '\n')) {
if (format.is_raw_string) {
size_t comment_index = line_text.find(options_.ignored_comment_start);
line_text = line_text.substr(0, comment_index);
if (comment_index != absl::string_view::npos) {
line_text = line_text.substr(0, comment_index);
if (absl::StripLeadingAsciiWhitespace(line_text).empty()) {
continue;
}
}
}
size_t line_indent = 0;

Loading…
Cancel
Save