Update TSan validation of concurrent mutations of fields to include non-repeated primitive, enum, string, and message fields.

Note that TSan validation is currently disabled so this should be a no-op.

PiperOrigin-RevId: 541943542
pull/13095/head
Protobuf Team Bot 1 year ago committed by Copybara-Service
parent 55741dcb94
commit 6e3dca3668
  1. 2
      src/google/protobuf/compiler/cpp/field_generators/enum_field.cc
  2. 6
      src/google/protobuf/compiler/cpp/field_generators/message_field.cc
  3. 2
      src/google/protobuf/compiler/cpp/field_generators/primitive_field.cc
  4. 6
      src/google/protobuf/compiler/cpp/field_generators/string_field.cc
  5. 56
      src/google/protobuf/compiler/plugin.pb.h
  6. 394
      src/google/protobuf/descriptor.pb.h

@ -221,9 +221,11 @@ void SingularEnum::GenerateInlineAccessorDefinitions(io::Printer* p) const {
} else { } else {
p->Emit(R"cc( p->Emit(R"cc(
inline $Enum$ $Msg$::_internal_$name$() const { inline $Enum$ $Msg$::_internal_$name$() const {
$TsanDetectConcurrentRead$;
return static_cast<$Enum$>($field_$); return static_cast<$Enum$>($field_$);
} }
inline void $Msg$::_internal_set_$name$($Enum$ value) { inline void $Msg$::_internal_set_$name$($Enum$ value) {
$TsanDetectConcurrentMutation$;
$assert_valid$; $assert_valid$;
$set_hasbit$; $set_hasbit$;
$field_$ = value; $field_$ = value;

@ -201,6 +201,7 @@ void SingularMessage::GenerateInlineAccessorDefinitions(io::Printer* p) const {
}, },
R"cc( R"cc(
inline const $Submsg$& $Msg$::_internal_$name$() const { inline const $Submsg$& $Msg$::_internal_$name$() const {
$TsanDetectConcurrentRead$;
$StrongRef$; $StrongRef$;
const $Submsg$* p = $cast_field_$; const $Submsg$* p = $cast_field_$;
return p != nullptr ? *p : reinterpret_cast<const $Submsg$&>($kDefault$); return p != nullptr ? *p : reinterpret_cast<const $Submsg$&>($kDefault$);
@ -211,6 +212,7 @@ void SingularMessage::GenerateInlineAccessorDefinitions(io::Printer* p) const {
return _internal_$name$(); return _internal_$name$();
} }
inline void $Msg$::unsafe_arena_set_allocated_$name$($Submsg$* value) { inline void $Msg$::unsafe_arena_set_allocated_$name$($Submsg$* value) {
$TsanDetectConcurrentMutation$;
$PrepareSplitMessageForWrite$; $PrepareSplitMessageForWrite$;
//~ If we're not on an arena, free whatever we were holding before. //~ 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 we are on arena, we can just forget the earlier pointer.)
@ -223,6 +225,7 @@ void SingularMessage::GenerateInlineAccessorDefinitions(io::Printer* p) const {
// @@protoc_insertion_point(field_unsafe_arena_set_allocated:$pkg.Msg.field$) // @@protoc_insertion_point(field_unsafe_arena_set_allocated:$pkg.Msg.field$)
} }
inline $Submsg$* $Msg$::$release_name$() { inline $Submsg$* $Msg$::$release_name$() {
$TsanDetectConcurrentMutation$;
$StrongRef$; $StrongRef$;
$annotate_release$; $annotate_release$;
$PrepareSplitMessageForWrite$; $PrepareSplitMessageForWrite$;
@ -244,6 +247,7 @@ void SingularMessage::GenerateInlineAccessorDefinitions(io::Printer* p) const {
return released; return released;
} }
inline $Submsg$* $Msg$::unsafe_arena_release_$name$() { inline $Submsg$* $Msg$::unsafe_arena_release_$name$() {
$TsanDetectConcurrentMutation$;
$annotate_release$; $annotate_release$;
// @@protoc_insertion_point(field_release:$pkg.Msg.field$) // @@protoc_insertion_point(field_release:$pkg.Msg.field$)
$StrongRef$; $StrongRef$;
@ -255,6 +259,7 @@ void SingularMessage::GenerateInlineAccessorDefinitions(io::Printer* p) const {
return temp; return temp;
} }
inline $Submsg$* $Msg$::_internal_mutable_$name$() { inline $Submsg$* $Msg$::_internal_mutable_$name$() {
$TsanDetectConcurrentMutation$;
$StrongRef$; $StrongRef$;
$set_hasbit$; $set_hasbit$;
if ($field_$ == nullptr) { if ($field_$ == nullptr) {
@ -276,6 +281,7 @@ void SingularMessage::GenerateInlineAccessorDefinitions(io::Printer* p) const {
//~ cases to the slow fallback function. //~ cases to the slow fallback function.
inline void $Msg$::set_allocated_$name$($Submsg$* value) { inline void $Msg$::set_allocated_$name$($Submsg$* value) {
$pb$::Arena* message_arena = GetArenaForAllocation(); $pb$::Arena* message_arena = GetArenaForAllocation();
$TsanDetectConcurrentMutation$;
$PrepareSplitMessageForWrite$; $PrepareSplitMessageForWrite$;
if (message_arena == nullptr) { if (message_arena == nullptr) {
delete $base_cast$($field_$); delete $base_cast$($field_$);

@ -245,9 +245,11 @@ void SingularPrimitive::GenerateInlineAccessorDefinitions(
} else { } else {
p->Emit(R"cc( p->Emit(R"cc(
inline $Type$ $Msg$::_internal_$name$() const { inline $Type$ $Msg$::_internal_$name$() const {
$TsanDetectConcurrentRead$;
return $field_$; return $field_$;
} }
inline void $Msg$::_internal_set_$name$($Type$ value) { inline void $Msg$::_internal_set_$name$($Type$ value) {
$TsanDetectConcurrentMutation$;
$set_hasbit$; $set_hasbit$;
$field_$ = value; $field_$ = value;
} }

@ -426,6 +426,7 @@ void SingularString::GenerateInlineAccessorDefinitions(io::Printer* p) const {
template <typename Arg_, typename... Args_> template <typename Arg_, typename... Args_>
inline PROTOBUF_ALWAYS_INLINE void $Msg$::set_$name$(Arg_&& arg, inline PROTOBUF_ALWAYS_INLINE void $Msg$::set_$name$(Arg_&& arg,
Args_... args) { Args_... args) {
$TsanDetectConcurrentMutation$;
$PrepareSplitMessageForWrite$; $PrepareSplitMessageForWrite$;
$update_hasbit$; $update_hasbit$;
$field_$.$Set$(static_cast<Arg_&&>(arg), args..., $set_args$); $field_$.$Set$(static_cast<Arg_&&>(arg), args..., $set_args$);
@ -440,26 +441,31 @@ void SingularString::GenerateInlineAccessorDefinitions(io::Printer* p) const {
return _s; return _s;
} }
inline const std::string& $Msg$::_internal_$name$() const { inline const std::string& $Msg$::_internal_$name$() const {
$TsanDetectConcurrentRead$;
$check_hasbit$; $check_hasbit$;
return $field_$.Get(); return $field_$.Get();
} }
inline void $Msg$::_internal_set_$name$(const std::string& value) { inline void $Msg$::_internal_set_$name$(const std::string& value) {
$TsanDetectConcurrentMutation$;
$update_hasbit$; $update_hasbit$;
//~ Don't use $Set$ here; we always want the std::string variant //~ Don't use $Set$ here; we always want the std::string variant
//~ regardless of whether this is a `bytes` field. //~ regardless of whether this is a `bytes` field.
$field_$.Set(value, $set_args$); $field_$.Set(value, $set_args$);
} }
inline std::string* $Msg$::_internal_mutable_$name$() { inline std::string* $Msg$::_internal_mutable_$name$() {
$TsanDetectConcurrentMutation$;
$update_hasbit$; $update_hasbit$;
return $field_$.Mutable($lazy_args$, $set_args$); return $field_$.Mutable($lazy_args$, $set_args$);
} }
inline std::string* $Msg$::$release_name$() { inline std::string* $Msg$::$release_name$() {
$TsanDetectConcurrentMutation$;
$annotate_release$; $annotate_release$;
$PrepareSplitMessageForWrite$; $PrepareSplitMessageForWrite$;
// @@protoc_insertion_point(field_release:$pkg.Msg.field$) // @@protoc_insertion_point(field_release:$pkg.Msg.field$)
$release_impl$; $release_impl$;
} }
inline void $Msg$::set_allocated_$name$(std::string* value) { inline void $Msg$::set_allocated_$name$(std::string* value) {
$TsanDetectConcurrentMutation$;
$PrepareSplitMessageForWrite$; $PrepareSplitMessageForWrite$;
$set_allocated_impl$; $set_allocated_impl$;
$annotate_set$; $annotate_set$;

@ -1039,9 +1039,11 @@ inline void Version::set_major(::int32_t value) {
// @@protoc_insertion_point(field_set:google.protobuf.compiler.Version.major) // @@protoc_insertion_point(field_set:google.protobuf.compiler.Version.major)
} }
inline ::int32_t Version::_internal_major() const { inline ::int32_t Version::_internal_major() const {
PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race);
return _impl_.major_; return _impl_.major_;
} }
inline void Version::_internal_set_major(::int32_t value) { inline void Version::_internal_set_major(::int32_t value) {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_._has_bits_[0] |= 0x00000002u; _impl_._has_bits_[0] |= 0x00000002u;
_impl_.major_ = value; _impl_.major_ = value;
} }
@ -1064,9 +1066,11 @@ inline void Version::set_minor(::int32_t value) {
// @@protoc_insertion_point(field_set:google.protobuf.compiler.Version.minor) // @@protoc_insertion_point(field_set:google.protobuf.compiler.Version.minor)
} }
inline ::int32_t Version::_internal_minor() const { inline ::int32_t Version::_internal_minor() const {
PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race);
return _impl_.minor_; return _impl_.minor_;
} }
inline void Version::_internal_set_minor(::int32_t value) { inline void Version::_internal_set_minor(::int32_t value) {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_._has_bits_[0] |= 0x00000004u; _impl_._has_bits_[0] |= 0x00000004u;
_impl_.minor_ = value; _impl_.minor_ = value;
} }
@ -1089,9 +1093,11 @@ inline void Version::set_patch(::int32_t value) {
// @@protoc_insertion_point(field_set:google.protobuf.compiler.Version.patch) // @@protoc_insertion_point(field_set:google.protobuf.compiler.Version.patch)
} }
inline ::int32_t Version::_internal_patch() const { inline ::int32_t Version::_internal_patch() const {
PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race);
return _impl_.patch_; return _impl_.patch_;
} }
inline void Version::_internal_set_patch(::int32_t value) { inline void Version::_internal_set_patch(::int32_t value) {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_._has_bits_[0] |= 0x00000008u; _impl_._has_bits_[0] |= 0x00000008u;
_impl_.patch_ = value; _impl_.patch_ = value;
} }
@ -1112,6 +1118,7 @@ inline const std::string& Version::suffix() const {
template <typename Arg_, typename... Args_> template <typename Arg_, typename... Args_>
inline PROTOBUF_ALWAYS_INLINE void Version::set_suffix(Arg_&& arg, inline PROTOBUF_ALWAYS_INLINE void Version::set_suffix(Arg_&& arg,
Args_... args) { Args_... args) {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_._has_bits_[0] |= 0x00000001u; _impl_._has_bits_[0] |= 0x00000001u;
_impl_.suffix_.Set(static_cast<Arg_&&>(arg), args..., GetArenaForAllocation()); _impl_.suffix_.Set(static_cast<Arg_&&>(arg), args..., GetArenaForAllocation());
// @@protoc_insertion_point(field_set:google.protobuf.compiler.Version.suffix) // @@protoc_insertion_point(field_set:google.protobuf.compiler.Version.suffix)
@ -1122,17 +1129,21 @@ inline std::string* Version::mutable_suffix() {
return _s; return _s;
} }
inline const std::string& Version::_internal_suffix() const { inline const std::string& Version::_internal_suffix() const {
PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race);
return _impl_.suffix_.Get(); return _impl_.suffix_.Get();
} }
inline void Version::_internal_set_suffix(const std::string& value) { inline void Version::_internal_set_suffix(const std::string& value) {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_._has_bits_[0] |= 0x00000001u; _impl_._has_bits_[0] |= 0x00000001u;
_impl_.suffix_.Set(value, GetArenaForAllocation()); _impl_.suffix_.Set(value, GetArenaForAllocation());
} }
inline std::string* Version::_internal_mutable_suffix() { inline std::string* Version::_internal_mutable_suffix() {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_._has_bits_[0] |= 0x00000001u; _impl_._has_bits_[0] |= 0x00000001u;
return _impl_.suffix_.Mutable( GetArenaForAllocation()); return _impl_.suffix_.Mutable( GetArenaForAllocation());
} }
inline std::string* Version::release_suffix() { inline std::string* Version::release_suffix() {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
// @@protoc_insertion_point(field_release:google.protobuf.compiler.Version.suffix) // @@protoc_insertion_point(field_release:google.protobuf.compiler.Version.suffix)
if ((_impl_._has_bits_[0] & 0x00000001u) == 0) { if ((_impl_._has_bits_[0] & 0x00000001u) == 0) {
return nullptr; return nullptr;
@ -1145,6 +1156,7 @@ inline std::string* Version::release_suffix() {
return released; return released;
} }
inline void Version::set_allocated_suffix(std::string* value) { inline void Version::set_allocated_suffix(std::string* value) {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
if (value != nullptr) { if (value != nullptr) {
_impl_._has_bits_[0] |= 0x00000001u; _impl_._has_bits_[0] |= 0x00000001u;
} else { } else {
@ -1275,6 +1287,7 @@ inline const std::string& CodeGeneratorRequest::parameter() const {
template <typename Arg_, typename... Args_> template <typename Arg_, typename... Args_>
inline PROTOBUF_ALWAYS_INLINE void CodeGeneratorRequest::set_parameter(Arg_&& arg, inline PROTOBUF_ALWAYS_INLINE void CodeGeneratorRequest::set_parameter(Arg_&& arg,
Args_... args) { Args_... args) {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_._has_bits_[0] |= 0x00000001u; _impl_._has_bits_[0] |= 0x00000001u;
_impl_.parameter_.Set(static_cast<Arg_&&>(arg), args..., GetArenaForAllocation()); _impl_.parameter_.Set(static_cast<Arg_&&>(arg), args..., GetArenaForAllocation());
// @@protoc_insertion_point(field_set:google.protobuf.compiler.CodeGeneratorRequest.parameter) // @@protoc_insertion_point(field_set:google.protobuf.compiler.CodeGeneratorRequest.parameter)
@ -1285,17 +1298,21 @@ inline std::string* CodeGeneratorRequest::mutable_parameter() {
return _s; return _s;
} }
inline const std::string& CodeGeneratorRequest::_internal_parameter() const { inline const std::string& CodeGeneratorRequest::_internal_parameter() const {
PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race);
return _impl_.parameter_.Get(); return _impl_.parameter_.Get();
} }
inline void CodeGeneratorRequest::_internal_set_parameter(const std::string& value) { inline void CodeGeneratorRequest::_internal_set_parameter(const std::string& value) {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_._has_bits_[0] |= 0x00000001u; _impl_._has_bits_[0] |= 0x00000001u;
_impl_.parameter_.Set(value, GetArenaForAllocation()); _impl_.parameter_.Set(value, GetArenaForAllocation());
} }
inline std::string* CodeGeneratorRequest::_internal_mutable_parameter() { inline std::string* CodeGeneratorRequest::_internal_mutable_parameter() {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_._has_bits_[0] |= 0x00000001u; _impl_._has_bits_[0] |= 0x00000001u;
return _impl_.parameter_.Mutable( GetArenaForAllocation()); return _impl_.parameter_.Mutable( GetArenaForAllocation());
} }
inline std::string* CodeGeneratorRequest::release_parameter() { inline std::string* CodeGeneratorRequest::release_parameter() {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
// @@protoc_insertion_point(field_release:google.protobuf.compiler.CodeGeneratorRequest.parameter) // @@protoc_insertion_point(field_release:google.protobuf.compiler.CodeGeneratorRequest.parameter)
if ((_impl_._has_bits_[0] & 0x00000001u) == 0) { if ((_impl_._has_bits_[0] & 0x00000001u) == 0) {
return nullptr; return nullptr;
@ -1308,6 +1325,7 @@ inline std::string* CodeGeneratorRequest::release_parameter() {
return released; return released;
} }
inline void CodeGeneratorRequest::set_allocated_parameter(std::string* value) { inline void CodeGeneratorRequest::set_allocated_parameter(std::string* value) {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
if (value != nullptr) { if (value != nullptr) {
_impl_._has_bits_[0] |= 0x00000001u; _impl_._has_bits_[0] |= 0x00000001u;
} else { } else {
@ -1376,6 +1394,7 @@ inline void CodeGeneratorRequest::clear_compiler_version() {
_impl_._has_bits_[0] &= ~0x00000002u; _impl_._has_bits_[0] &= ~0x00000002u;
} }
inline const ::google::protobuf::compiler::Version& CodeGeneratorRequest::_internal_compiler_version() const { inline const ::google::protobuf::compiler::Version& CodeGeneratorRequest::_internal_compiler_version() const {
PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race);
const ::google::protobuf::compiler::Version* p = _impl_.compiler_version_; const ::google::protobuf::compiler::Version* p = _impl_.compiler_version_;
return p != nullptr ? *p : reinterpret_cast<const ::google::protobuf::compiler::Version&>(::google::protobuf::compiler::_Version_default_instance_); return p != nullptr ? *p : reinterpret_cast<const ::google::protobuf::compiler::Version&>(::google::protobuf::compiler::_Version_default_instance_);
} }
@ -1384,6 +1403,7 @@ inline const ::google::protobuf::compiler::Version& CodeGeneratorRequest::compil
return _internal_compiler_version(); return _internal_compiler_version();
} }
inline void CodeGeneratorRequest::unsafe_arena_set_allocated_compiler_version(::google::protobuf::compiler::Version* value) { inline void CodeGeneratorRequest::unsafe_arena_set_allocated_compiler_version(::google::protobuf::compiler::Version* value) {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
if (GetArenaForAllocation() == nullptr) { if (GetArenaForAllocation() == nullptr) {
delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.compiler_version_); delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.compiler_version_);
} }
@ -1396,6 +1416,7 @@ inline void CodeGeneratorRequest::unsafe_arena_set_allocated_compiler_version(::
// @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.compiler.CodeGeneratorRequest.compiler_version) // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.compiler.CodeGeneratorRequest.compiler_version)
} }
inline ::google::protobuf::compiler::Version* CodeGeneratorRequest::release_compiler_version() { inline ::google::protobuf::compiler::Version* CodeGeneratorRequest::release_compiler_version() {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_._has_bits_[0] &= ~0x00000002u; _impl_._has_bits_[0] &= ~0x00000002u;
::google::protobuf::compiler::Version* released = _impl_.compiler_version_; ::google::protobuf::compiler::Version* released = _impl_.compiler_version_;
@ -1414,6 +1435,7 @@ inline ::google::protobuf::compiler::Version* CodeGeneratorRequest::release_comp
return released; return released;
} }
inline ::google::protobuf::compiler::Version* CodeGeneratorRequest::unsafe_arena_release_compiler_version() { inline ::google::protobuf::compiler::Version* CodeGeneratorRequest::unsafe_arena_release_compiler_version() {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
// @@protoc_insertion_point(field_release:google.protobuf.compiler.CodeGeneratorRequest.compiler_version) // @@protoc_insertion_point(field_release:google.protobuf.compiler.CodeGeneratorRequest.compiler_version)
_impl_._has_bits_[0] &= ~0x00000002u; _impl_._has_bits_[0] &= ~0x00000002u;
@ -1422,6 +1444,7 @@ inline ::google::protobuf::compiler::Version* CodeGeneratorRequest::unsafe_arena
return temp; return temp;
} }
inline ::google::protobuf::compiler::Version* CodeGeneratorRequest::_internal_mutable_compiler_version() { inline ::google::protobuf::compiler::Version* CodeGeneratorRequest::_internal_mutable_compiler_version() {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_._has_bits_[0] |= 0x00000002u; _impl_._has_bits_[0] |= 0x00000002u;
if (_impl_.compiler_version_ == nullptr) { if (_impl_.compiler_version_ == nullptr) {
auto* p = CreateMaybeMessage<::google::protobuf::compiler::Version>(GetArenaForAllocation()); auto* p = CreateMaybeMessage<::google::protobuf::compiler::Version>(GetArenaForAllocation());
@ -1436,6 +1459,7 @@ inline ::google::protobuf::compiler::Version* CodeGeneratorRequest::mutable_comp
} }
inline void CodeGeneratorRequest::set_allocated_compiler_version(::google::protobuf::compiler::Version* value) { inline void CodeGeneratorRequest::set_allocated_compiler_version(::google::protobuf::compiler::Version* value) {
::google::protobuf::Arena* message_arena = GetArenaForAllocation(); ::google::protobuf::Arena* message_arena = GetArenaForAllocation();
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
if (message_arena == nullptr) { if (message_arena == nullptr) {
delete reinterpret_cast<::google::protobuf::compiler::Version*>(_impl_.compiler_version_); delete reinterpret_cast<::google::protobuf::compiler::Version*>(_impl_.compiler_version_);
} }
@ -1475,6 +1499,7 @@ inline const std::string& CodeGeneratorResponse_File::name() const {
template <typename Arg_, typename... Args_> template <typename Arg_, typename... Args_>
inline PROTOBUF_ALWAYS_INLINE void CodeGeneratorResponse_File::set_name(Arg_&& arg, inline PROTOBUF_ALWAYS_INLINE void CodeGeneratorResponse_File::set_name(Arg_&& arg,
Args_... args) { Args_... args) {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_._has_bits_[0] |= 0x00000001u; _impl_._has_bits_[0] |= 0x00000001u;
_impl_.name_.Set(static_cast<Arg_&&>(arg), args..., GetArenaForAllocation()); _impl_.name_.Set(static_cast<Arg_&&>(arg), args..., GetArenaForAllocation());
// @@protoc_insertion_point(field_set:google.protobuf.compiler.CodeGeneratorResponse.File.name) // @@protoc_insertion_point(field_set:google.protobuf.compiler.CodeGeneratorResponse.File.name)
@ -1485,17 +1510,21 @@ inline std::string* CodeGeneratorResponse_File::mutable_name() {
return _s; return _s;
} }
inline const std::string& CodeGeneratorResponse_File::_internal_name() const { inline const std::string& CodeGeneratorResponse_File::_internal_name() const {
PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race);
return _impl_.name_.Get(); return _impl_.name_.Get();
} }
inline void CodeGeneratorResponse_File::_internal_set_name(const std::string& value) { inline void CodeGeneratorResponse_File::_internal_set_name(const std::string& value) {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_._has_bits_[0] |= 0x00000001u; _impl_._has_bits_[0] |= 0x00000001u;
_impl_.name_.Set(value, GetArenaForAllocation()); _impl_.name_.Set(value, GetArenaForAllocation());
} }
inline std::string* CodeGeneratorResponse_File::_internal_mutable_name() { inline std::string* CodeGeneratorResponse_File::_internal_mutable_name() {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_._has_bits_[0] |= 0x00000001u; _impl_._has_bits_[0] |= 0x00000001u;
return _impl_.name_.Mutable( GetArenaForAllocation()); return _impl_.name_.Mutable( GetArenaForAllocation());
} }
inline std::string* CodeGeneratorResponse_File::release_name() { inline std::string* CodeGeneratorResponse_File::release_name() {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
// @@protoc_insertion_point(field_release:google.protobuf.compiler.CodeGeneratorResponse.File.name) // @@protoc_insertion_point(field_release:google.protobuf.compiler.CodeGeneratorResponse.File.name)
if ((_impl_._has_bits_[0] & 0x00000001u) == 0) { if ((_impl_._has_bits_[0] & 0x00000001u) == 0) {
return nullptr; return nullptr;
@ -1508,6 +1537,7 @@ inline std::string* CodeGeneratorResponse_File::release_name() {
return released; return released;
} }
inline void CodeGeneratorResponse_File::set_allocated_name(std::string* value) { inline void CodeGeneratorResponse_File::set_allocated_name(std::string* value) {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
if (value != nullptr) { if (value != nullptr) {
_impl_._has_bits_[0] |= 0x00000001u; _impl_._has_bits_[0] |= 0x00000001u;
} else { } else {
@ -1538,6 +1568,7 @@ inline const std::string& CodeGeneratorResponse_File::insertion_point() const {
template <typename Arg_, typename... Args_> template <typename Arg_, typename... Args_>
inline PROTOBUF_ALWAYS_INLINE void CodeGeneratorResponse_File::set_insertion_point(Arg_&& arg, inline PROTOBUF_ALWAYS_INLINE void CodeGeneratorResponse_File::set_insertion_point(Arg_&& arg,
Args_... args) { Args_... args) {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_._has_bits_[0] |= 0x00000002u; _impl_._has_bits_[0] |= 0x00000002u;
_impl_.insertion_point_.Set(static_cast<Arg_&&>(arg), args..., GetArenaForAllocation()); _impl_.insertion_point_.Set(static_cast<Arg_&&>(arg), args..., GetArenaForAllocation());
// @@protoc_insertion_point(field_set:google.protobuf.compiler.CodeGeneratorResponse.File.insertion_point) // @@protoc_insertion_point(field_set:google.protobuf.compiler.CodeGeneratorResponse.File.insertion_point)
@ -1548,17 +1579,21 @@ inline std::string* CodeGeneratorResponse_File::mutable_insertion_point() {
return _s; return _s;
} }
inline const std::string& CodeGeneratorResponse_File::_internal_insertion_point() const { inline const std::string& CodeGeneratorResponse_File::_internal_insertion_point() const {
PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race);
return _impl_.insertion_point_.Get(); return _impl_.insertion_point_.Get();
} }
inline void CodeGeneratorResponse_File::_internal_set_insertion_point(const std::string& value) { inline void CodeGeneratorResponse_File::_internal_set_insertion_point(const std::string& value) {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_._has_bits_[0] |= 0x00000002u; _impl_._has_bits_[0] |= 0x00000002u;
_impl_.insertion_point_.Set(value, GetArenaForAllocation()); _impl_.insertion_point_.Set(value, GetArenaForAllocation());
} }
inline std::string* CodeGeneratorResponse_File::_internal_mutable_insertion_point() { inline std::string* CodeGeneratorResponse_File::_internal_mutable_insertion_point() {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_._has_bits_[0] |= 0x00000002u; _impl_._has_bits_[0] |= 0x00000002u;
return _impl_.insertion_point_.Mutable( GetArenaForAllocation()); return _impl_.insertion_point_.Mutable( GetArenaForAllocation());
} }
inline std::string* CodeGeneratorResponse_File::release_insertion_point() { inline std::string* CodeGeneratorResponse_File::release_insertion_point() {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
// @@protoc_insertion_point(field_release:google.protobuf.compiler.CodeGeneratorResponse.File.insertion_point) // @@protoc_insertion_point(field_release:google.protobuf.compiler.CodeGeneratorResponse.File.insertion_point)
if ((_impl_._has_bits_[0] & 0x00000002u) == 0) { if ((_impl_._has_bits_[0] & 0x00000002u) == 0) {
return nullptr; return nullptr;
@ -1571,6 +1606,7 @@ inline std::string* CodeGeneratorResponse_File::release_insertion_point() {
return released; return released;
} }
inline void CodeGeneratorResponse_File::set_allocated_insertion_point(std::string* value) { inline void CodeGeneratorResponse_File::set_allocated_insertion_point(std::string* value) {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
if (value != nullptr) { if (value != nullptr) {
_impl_._has_bits_[0] |= 0x00000002u; _impl_._has_bits_[0] |= 0x00000002u;
} else { } else {
@ -1601,6 +1637,7 @@ inline const std::string& CodeGeneratorResponse_File::content() const {
template <typename Arg_, typename... Args_> template <typename Arg_, typename... Args_>
inline PROTOBUF_ALWAYS_INLINE void CodeGeneratorResponse_File::set_content(Arg_&& arg, inline PROTOBUF_ALWAYS_INLINE void CodeGeneratorResponse_File::set_content(Arg_&& arg,
Args_... args) { Args_... args) {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_._has_bits_[0] |= 0x00000004u; _impl_._has_bits_[0] |= 0x00000004u;
_impl_.content_.Set(static_cast<Arg_&&>(arg), args..., GetArenaForAllocation()); _impl_.content_.Set(static_cast<Arg_&&>(arg), args..., GetArenaForAllocation());
// @@protoc_insertion_point(field_set:google.protobuf.compiler.CodeGeneratorResponse.File.content) // @@protoc_insertion_point(field_set:google.protobuf.compiler.CodeGeneratorResponse.File.content)
@ -1611,17 +1648,21 @@ inline std::string* CodeGeneratorResponse_File::mutable_content() {
return _s; return _s;
} }
inline const std::string& CodeGeneratorResponse_File::_internal_content() const { inline const std::string& CodeGeneratorResponse_File::_internal_content() const {
PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race);
return _impl_.content_.Get(); return _impl_.content_.Get();
} }
inline void CodeGeneratorResponse_File::_internal_set_content(const std::string& value) { inline void CodeGeneratorResponse_File::_internal_set_content(const std::string& value) {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_._has_bits_[0] |= 0x00000004u; _impl_._has_bits_[0] |= 0x00000004u;
_impl_.content_.Set(value, GetArenaForAllocation()); _impl_.content_.Set(value, GetArenaForAllocation());
} }
inline std::string* CodeGeneratorResponse_File::_internal_mutable_content() { inline std::string* CodeGeneratorResponse_File::_internal_mutable_content() {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_._has_bits_[0] |= 0x00000004u; _impl_._has_bits_[0] |= 0x00000004u;
return _impl_.content_.Mutable( GetArenaForAllocation()); return _impl_.content_.Mutable( GetArenaForAllocation());
} }
inline std::string* CodeGeneratorResponse_File::release_content() { inline std::string* CodeGeneratorResponse_File::release_content() {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
// @@protoc_insertion_point(field_release:google.protobuf.compiler.CodeGeneratorResponse.File.content) // @@protoc_insertion_point(field_release:google.protobuf.compiler.CodeGeneratorResponse.File.content)
if ((_impl_._has_bits_[0] & 0x00000004u) == 0) { if ((_impl_._has_bits_[0] & 0x00000004u) == 0) {
return nullptr; return nullptr;
@ -1634,6 +1675,7 @@ inline std::string* CodeGeneratorResponse_File::release_content() {
return released; return released;
} }
inline void CodeGeneratorResponse_File::set_allocated_content(std::string* value) { inline void CodeGeneratorResponse_File::set_allocated_content(std::string* value) {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
if (value != nullptr) { if (value != nullptr) {
_impl_._has_bits_[0] |= 0x00000004u; _impl_._has_bits_[0] |= 0x00000004u;
} else { } else {
@ -1655,6 +1697,7 @@ inline bool CodeGeneratorResponse_File::has_generated_code_info() const {
return value; return value;
} }
inline const ::google::protobuf::GeneratedCodeInfo& CodeGeneratorResponse_File::_internal_generated_code_info() const { inline const ::google::protobuf::GeneratedCodeInfo& CodeGeneratorResponse_File::_internal_generated_code_info() const {
PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race);
const ::google::protobuf::GeneratedCodeInfo* p = _impl_.generated_code_info_; const ::google::protobuf::GeneratedCodeInfo* p = _impl_.generated_code_info_;
return p != nullptr ? *p : reinterpret_cast<const ::google::protobuf::GeneratedCodeInfo&>(::google::protobuf::_GeneratedCodeInfo_default_instance_); return p != nullptr ? *p : reinterpret_cast<const ::google::protobuf::GeneratedCodeInfo&>(::google::protobuf::_GeneratedCodeInfo_default_instance_);
} }
@ -1663,6 +1706,7 @@ inline const ::google::protobuf::GeneratedCodeInfo& CodeGeneratorResponse_File::
return _internal_generated_code_info(); return _internal_generated_code_info();
} }
inline void CodeGeneratorResponse_File::unsafe_arena_set_allocated_generated_code_info(::google::protobuf::GeneratedCodeInfo* value) { inline void CodeGeneratorResponse_File::unsafe_arena_set_allocated_generated_code_info(::google::protobuf::GeneratedCodeInfo* value) {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
if (GetArenaForAllocation() == nullptr) { if (GetArenaForAllocation() == nullptr) {
delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.generated_code_info_); delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.generated_code_info_);
} }
@ -1675,6 +1719,7 @@ 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) // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.compiler.CodeGeneratorResponse.File.generated_code_info)
} }
inline ::google::protobuf::GeneratedCodeInfo* CodeGeneratorResponse_File::release_generated_code_info() { inline ::google::protobuf::GeneratedCodeInfo* CodeGeneratorResponse_File::release_generated_code_info() {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_._has_bits_[0] &= ~0x00000008u; _impl_._has_bits_[0] &= ~0x00000008u;
::google::protobuf::GeneratedCodeInfo* released = _impl_.generated_code_info_; ::google::protobuf::GeneratedCodeInfo* released = _impl_.generated_code_info_;
@ -1693,6 +1738,7 @@ inline ::google::protobuf::GeneratedCodeInfo* CodeGeneratorResponse_File::releas
return released; return released;
} }
inline ::google::protobuf::GeneratedCodeInfo* CodeGeneratorResponse_File::unsafe_arena_release_generated_code_info() { inline ::google::protobuf::GeneratedCodeInfo* CodeGeneratorResponse_File::unsafe_arena_release_generated_code_info() {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
// @@protoc_insertion_point(field_release:google.protobuf.compiler.CodeGeneratorResponse.File.generated_code_info) // @@protoc_insertion_point(field_release:google.protobuf.compiler.CodeGeneratorResponse.File.generated_code_info)
_impl_._has_bits_[0] &= ~0x00000008u; _impl_._has_bits_[0] &= ~0x00000008u;
@ -1701,6 +1747,7 @@ inline ::google::protobuf::GeneratedCodeInfo* CodeGeneratorResponse_File::unsafe
return temp; return temp;
} }
inline ::google::protobuf::GeneratedCodeInfo* CodeGeneratorResponse_File::_internal_mutable_generated_code_info() { inline ::google::protobuf::GeneratedCodeInfo* CodeGeneratorResponse_File::_internal_mutable_generated_code_info() {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_._has_bits_[0] |= 0x00000008u; _impl_._has_bits_[0] |= 0x00000008u;
if (_impl_.generated_code_info_ == nullptr) { if (_impl_.generated_code_info_ == nullptr) {
auto* p = CreateMaybeMessage<::google::protobuf::GeneratedCodeInfo>(GetArenaForAllocation()); auto* p = CreateMaybeMessage<::google::protobuf::GeneratedCodeInfo>(GetArenaForAllocation());
@ -1715,6 +1762,7 @@ inline ::google::protobuf::GeneratedCodeInfo* CodeGeneratorResponse_File::mutabl
} }
inline void CodeGeneratorResponse_File::set_allocated_generated_code_info(::google::protobuf::GeneratedCodeInfo* value) { inline void CodeGeneratorResponse_File::set_allocated_generated_code_info(::google::protobuf::GeneratedCodeInfo* value) {
::google::protobuf::Arena* message_arena = GetArenaForAllocation(); ::google::protobuf::Arena* message_arena = GetArenaForAllocation();
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
if (message_arena == nullptr) { if (message_arena == nullptr) {
delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.generated_code_info_); delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.generated_code_info_);
} }
@ -1754,6 +1802,7 @@ inline const std::string& CodeGeneratorResponse::error() const {
template <typename Arg_, typename... Args_> template <typename Arg_, typename... Args_>
inline PROTOBUF_ALWAYS_INLINE void CodeGeneratorResponse::set_error(Arg_&& arg, inline PROTOBUF_ALWAYS_INLINE void CodeGeneratorResponse::set_error(Arg_&& arg,
Args_... args) { Args_... args) {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_._has_bits_[0] |= 0x00000001u; _impl_._has_bits_[0] |= 0x00000001u;
_impl_.error_.Set(static_cast<Arg_&&>(arg), args..., GetArenaForAllocation()); _impl_.error_.Set(static_cast<Arg_&&>(arg), args..., GetArenaForAllocation());
// @@protoc_insertion_point(field_set:google.protobuf.compiler.CodeGeneratorResponse.error) // @@protoc_insertion_point(field_set:google.protobuf.compiler.CodeGeneratorResponse.error)
@ -1764,17 +1813,21 @@ inline std::string* CodeGeneratorResponse::mutable_error() {
return _s; return _s;
} }
inline const std::string& CodeGeneratorResponse::_internal_error() const { inline const std::string& CodeGeneratorResponse::_internal_error() const {
PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race);
return _impl_.error_.Get(); return _impl_.error_.Get();
} }
inline void CodeGeneratorResponse::_internal_set_error(const std::string& value) { inline void CodeGeneratorResponse::_internal_set_error(const std::string& value) {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_._has_bits_[0] |= 0x00000001u; _impl_._has_bits_[0] |= 0x00000001u;
_impl_.error_.Set(value, GetArenaForAllocation()); _impl_.error_.Set(value, GetArenaForAllocation());
} }
inline std::string* CodeGeneratorResponse::_internal_mutable_error() { inline std::string* CodeGeneratorResponse::_internal_mutable_error() {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_._has_bits_[0] |= 0x00000001u; _impl_._has_bits_[0] |= 0x00000001u;
return _impl_.error_.Mutable( GetArenaForAllocation()); return _impl_.error_.Mutable( GetArenaForAllocation());
} }
inline std::string* CodeGeneratorResponse::release_error() { inline std::string* CodeGeneratorResponse::release_error() {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
// @@protoc_insertion_point(field_release:google.protobuf.compiler.CodeGeneratorResponse.error) // @@protoc_insertion_point(field_release:google.protobuf.compiler.CodeGeneratorResponse.error)
if ((_impl_._has_bits_[0] & 0x00000001u) == 0) { if ((_impl_._has_bits_[0] & 0x00000001u) == 0) {
return nullptr; return nullptr;
@ -1787,6 +1840,7 @@ inline std::string* CodeGeneratorResponse::release_error() {
return released; return released;
} }
inline void CodeGeneratorResponse::set_allocated_error(std::string* value) { inline void CodeGeneratorResponse::set_allocated_error(std::string* value) {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
if (value != nullptr) { if (value != nullptr) {
_impl_._has_bits_[0] |= 0x00000001u; _impl_._has_bits_[0] |= 0x00000001u;
} else { } else {
@ -1819,9 +1873,11 @@ inline void CodeGeneratorResponse::set_supported_features(::uint64_t value) {
// @@protoc_insertion_point(field_set:google.protobuf.compiler.CodeGeneratorResponse.supported_features) // @@protoc_insertion_point(field_set:google.protobuf.compiler.CodeGeneratorResponse.supported_features)
} }
inline ::uint64_t CodeGeneratorResponse::_internal_supported_features() const { inline ::uint64_t CodeGeneratorResponse::_internal_supported_features() const {
PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race);
return _impl_.supported_features_; return _impl_.supported_features_;
} }
inline void CodeGeneratorResponse::_internal_set_supported_features(::uint64_t value) { inline void CodeGeneratorResponse::_internal_set_supported_features(::uint64_t value) {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_._has_bits_[0] |= 0x00000002u; _impl_._has_bits_[0] |= 0x00000002u;
_impl_.supported_features_ = value; _impl_.supported_features_ = value;
} }

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save