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 {
p->Emit(R"cc(
inline $Enum$ $Msg$::_internal_$name$() const {
$TsanDetectConcurrentRead$;
return static_cast<$Enum$>($field_$);
}
inline void $Msg$::_internal_set_$name$($Enum$ value) {
$TsanDetectConcurrentMutation$;
$assert_valid$;
$set_hasbit$;
$field_$ = value;

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

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

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

@ -1039,9 +1039,11 @@ inline void Version::set_major(::int32_t value) {
// @@protoc_insertion_point(field_set:google.protobuf.compiler.Version.major)
}
inline ::int32_t Version::_internal_major() const {
PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race);
return _impl_.major_;
}
inline void Version::_internal_set_major(::int32_t value) {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_._has_bits_[0] |= 0x00000002u;
_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)
}
inline ::int32_t Version::_internal_minor() const {
PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race);
return _impl_.minor_;
}
inline void Version::_internal_set_minor(::int32_t value) {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_._has_bits_[0] |= 0x00000004u;
_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)
}
inline ::int32_t Version::_internal_patch() const {
PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race);
return _impl_.patch_;
}
inline void Version::_internal_set_patch(::int32_t value) {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_._has_bits_[0] |= 0x00000008u;
_impl_.patch_ = value;
}
@ -1112,6 +1118,7 @@ inline const std::string& Version::suffix() const {
template <typename Arg_, typename... Args_>
inline PROTOBUF_ALWAYS_INLINE void Version::set_suffix(Arg_&& arg,
Args_... args) {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_._has_bits_[0] |= 0x00000001u;
_impl_.suffix_.Set(static_cast<Arg_&&>(arg), args..., GetArenaForAllocation());
// @@protoc_insertion_point(field_set:google.protobuf.compiler.Version.suffix)
@ -1122,17 +1129,21 @@ inline std::string* Version::mutable_suffix() {
return _s;
}
inline const std::string& Version::_internal_suffix() const {
PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race);
return _impl_.suffix_.Get();
}
inline void Version::_internal_set_suffix(const std::string& value) {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_._has_bits_[0] |= 0x00000001u;
_impl_.suffix_.Set(value, GetArenaForAllocation());
}
inline std::string* Version::_internal_mutable_suffix() {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_._has_bits_[0] |= 0x00000001u;
return _impl_.suffix_.Mutable( GetArenaForAllocation());
}
inline std::string* Version::release_suffix() {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
// @@protoc_insertion_point(field_release:google.protobuf.compiler.Version.suffix)
if ((_impl_._has_bits_[0] & 0x00000001u) == 0) {
return nullptr;
@ -1145,6 +1156,7 @@ inline std::string* Version::release_suffix() {
return released;
}
inline void Version::set_allocated_suffix(std::string* value) {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
if (value != nullptr) {
_impl_._has_bits_[0] |= 0x00000001u;
} else {
@ -1275,6 +1287,7 @@ inline const std::string& CodeGeneratorRequest::parameter() const {
template <typename Arg_, typename... Args_>
inline PROTOBUF_ALWAYS_INLINE void CodeGeneratorRequest::set_parameter(Arg_&& arg,
Args_... args) {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_._has_bits_[0] |= 0x00000001u;
_impl_.parameter_.Set(static_cast<Arg_&&>(arg), args..., GetArenaForAllocation());
// @@protoc_insertion_point(field_set:google.protobuf.compiler.CodeGeneratorRequest.parameter)
@ -1285,17 +1298,21 @@ inline std::string* CodeGeneratorRequest::mutable_parameter() {
return _s;
}
inline const std::string& CodeGeneratorRequest::_internal_parameter() const {
PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race);
return _impl_.parameter_.Get();
}
inline void CodeGeneratorRequest::_internal_set_parameter(const std::string& value) {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_._has_bits_[0] |= 0x00000001u;
_impl_.parameter_.Set(value, GetArenaForAllocation());
}
inline std::string* CodeGeneratorRequest::_internal_mutable_parameter() {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_._has_bits_[0] |= 0x00000001u;
return _impl_.parameter_.Mutable( GetArenaForAllocation());
}
inline std::string* CodeGeneratorRequest::release_parameter() {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
// @@protoc_insertion_point(field_release:google.protobuf.compiler.CodeGeneratorRequest.parameter)
if ((_impl_._has_bits_[0] & 0x00000001u) == 0) {
return nullptr;
@ -1308,6 +1325,7 @@ inline std::string* CodeGeneratorRequest::release_parameter() {
return released;
}
inline void CodeGeneratorRequest::set_allocated_parameter(std::string* value) {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
if (value != nullptr) {
_impl_._has_bits_[0] |= 0x00000001u;
} else {
@ -1376,6 +1394,7 @@ inline void CodeGeneratorRequest::clear_compiler_version() {
_impl_._has_bits_[0] &= ~0x00000002u;
}
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_;
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();
}
inline void CodeGeneratorRequest::unsafe_arena_set_allocated_compiler_version(::google::protobuf::compiler::Version* value) {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
if (GetArenaForAllocation() == nullptr) {
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)
}
inline ::google::protobuf::compiler::Version* CodeGeneratorRequest::release_compiler_version() {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_._has_bits_[0] &= ~0x00000002u;
::google::protobuf::compiler::Version* released = _impl_.compiler_version_;
@ -1414,6 +1435,7 @@ inline ::google::protobuf::compiler::Version* CodeGeneratorRequest::release_comp
return released;
}
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)
_impl_._has_bits_[0] &= ~0x00000002u;
@ -1422,6 +1444,7 @@ inline ::google::protobuf::compiler::Version* CodeGeneratorRequest::unsafe_arena
return temp;
}
inline ::google::protobuf::compiler::Version* CodeGeneratorRequest::_internal_mutable_compiler_version() {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_._has_bits_[0] |= 0x00000002u;
if (_impl_.compiler_version_ == nullptr) {
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) {
::google::protobuf::Arena* message_arena = GetArenaForAllocation();
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
if (message_arena == nullptr) {
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_>
inline PROTOBUF_ALWAYS_INLINE void CodeGeneratorResponse_File::set_name(Arg_&& arg,
Args_... args) {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_._has_bits_[0] |= 0x00000001u;
_impl_.name_.Set(static_cast<Arg_&&>(arg), args..., GetArenaForAllocation());
// @@protoc_insertion_point(field_set:google.protobuf.compiler.CodeGeneratorResponse.File.name)
@ -1485,17 +1510,21 @@ inline std::string* CodeGeneratorResponse_File::mutable_name() {
return _s;
}
inline const std::string& CodeGeneratorResponse_File::_internal_name() const {
PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race);
return _impl_.name_.Get();
}
inline void CodeGeneratorResponse_File::_internal_set_name(const std::string& value) {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_._has_bits_[0] |= 0x00000001u;
_impl_.name_.Set(value, GetArenaForAllocation());
}
inline std::string* CodeGeneratorResponse_File::_internal_mutable_name() {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_._has_bits_[0] |= 0x00000001u;
return _impl_.name_.Mutable( GetArenaForAllocation());
}
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)
if ((_impl_._has_bits_[0] & 0x00000001u) == 0) {
return nullptr;
@ -1508,6 +1537,7 @@ inline std::string* CodeGeneratorResponse_File::release_name() {
return released;
}
inline void CodeGeneratorResponse_File::set_allocated_name(std::string* value) {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
if (value != nullptr) {
_impl_._has_bits_[0] |= 0x00000001u;
} else {
@ -1538,6 +1568,7 @@ inline const std::string& CodeGeneratorResponse_File::insertion_point() const {
template <typename Arg_, typename... Args_>
inline PROTOBUF_ALWAYS_INLINE void CodeGeneratorResponse_File::set_insertion_point(Arg_&& arg,
Args_... args) {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_._has_bits_[0] |= 0x00000002u;
_impl_.insertion_point_.Set(static_cast<Arg_&&>(arg), args..., GetArenaForAllocation());
// @@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;
}
inline const std::string& CodeGeneratorResponse_File::_internal_insertion_point() const {
PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race);
return _impl_.insertion_point_.Get();
}
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_.insertion_point_.Set(value, GetArenaForAllocation());
}
inline std::string* CodeGeneratorResponse_File::_internal_mutable_insertion_point() {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_._has_bits_[0] |= 0x00000002u;
return _impl_.insertion_point_.Mutable( GetArenaForAllocation());
}
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)
if ((_impl_._has_bits_[0] & 0x00000002u) == 0) {
return nullptr;
@ -1571,6 +1606,7 @@ inline std::string* CodeGeneratorResponse_File::release_insertion_point() {
return released;
}
inline void CodeGeneratorResponse_File::set_allocated_insertion_point(std::string* value) {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
if (value != nullptr) {
_impl_._has_bits_[0] |= 0x00000002u;
} else {
@ -1601,6 +1637,7 @@ inline const std::string& CodeGeneratorResponse_File::content() const {
template <typename Arg_, typename... Args_>
inline PROTOBUF_ALWAYS_INLINE void CodeGeneratorResponse_File::set_content(Arg_&& arg,
Args_... args) {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_._has_bits_[0] |= 0x00000004u;
_impl_.content_.Set(static_cast<Arg_&&>(arg), args..., GetArenaForAllocation());
// @@protoc_insertion_point(field_set:google.protobuf.compiler.CodeGeneratorResponse.File.content)
@ -1611,17 +1648,21 @@ inline std::string* CodeGeneratorResponse_File::mutable_content() {
return _s;
}
inline const std::string& CodeGeneratorResponse_File::_internal_content() const {
PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race);
return _impl_.content_.Get();
}
inline void CodeGeneratorResponse_File::_internal_set_content(const std::string& value) {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_._has_bits_[0] |= 0x00000004u;
_impl_.content_.Set(value, GetArenaForAllocation());
}
inline std::string* CodeGeneratorResponse_File::_internal_mutable_content() {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_._has_bits_[0] |= 0x00000004u;
return _impl_.content_.Mutable( GetArenaForAllocation());
}
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)
if ((_impl_._has_bits_[0] & 0x00000004u) == 0) {
return nullptr;
@ -1634,6 +1675,7 @@ inline std::string* CodeGeneratorResponse_File::release_content() {
return released;
}
inline void CodeGeneratorResponse_File::set_allocated_content(std::string* value) {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
if (value != nullptr) {
_impl_._has_bits_[0] |= 0x00000004u;
} else {
@ -1655,6 +1697,7 @@ inline bool CodeGeneratorResponse_File::has_generated_code_info() const {
return value;
}
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_;
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();
}
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) {
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)
}
inline ::google::protobuf::GeneratedCodeInfo* CodeGeneratorResponse_File::release_generated_code_info() {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_._has_bits_[0] &= ~0x00000008u;
::google::protobuf::GeneratedCodeInfo* released = _impl_.generated_code_info_;
@ -1693,6 +1738,7 @@ inline ::google::protobuf::GeneratedCodeInfo* CodeGeneratorResponse_File::releas
return released;
}
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)
_impl_._has_bits_[0] &= ~0x00000008u;
@ -1701,6 +1747,7 @@ inline ::google::protobuf::GeneratedCodeInfo* CodeGeneratorResponse_File::unsafe
return temp;
}
inline ::google::protobuf::GeneratedCodeInfo* CodeGeneratorResponse_File::_internal_mutable_generated_code_info() {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_._has_bits_[0] |= 0x00000008u;
if (_impl_.generated_code_info_ == nullptr) {
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) {
::google::protobuf::Arena* message_arena = GetArenaForAllocation();
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
if (message_arena == nullptr) {
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_>
inline PROTOBUF_ALWAYS_INLINE void CodeGeneratorResponse::set_error(Arg_&& arg,
Args_... args) {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_._has_bits_[0] |= 0x00000001u;
_impl_.error_.Set(static_cast<Arg_&&>(arg), args..., GetArenaForAllocation());
// @@protoc_insertion_point(field_set:google.protobuf.compiler.CodeGeneratorResponse.error)
@ -1764,17 +1813,21 @@ inline std::string* CodeGeneratorResponse::mutable_error() {
return _s;
}
inline const std::string& CodeGeneratorResponse::_internal_error() const {
PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race);
return _impl_.error_.Get();
}
inline void CodeGeneratorResponse::_internal_set_error(const std::string& value) {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_._has_bits_[0] |= 0x00000001u;
_impl_.error_.Set(value, GetArenaForAllocation());
}
inline std::string* CodeGeneratorResponse::_internal_mutable_error() {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_._has_bits_[0] |= 0x00000001u;
return _impl_.error_.Mutable( GetArenaForAllocation());
}
inline std::string* CodeGeneratorResponse::release_error() {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
// @@protoc_insertion_point(field_release:google.protobuf.compiler.CodeGeneratorResponse.error)
if ((_impl_._has_bits_[0] & 0x00000001u) == 0) {
return nullptr;
@ -1787,6 +1840,7 @@ inline std::string* CodeGeneratorResponse::release_error() {
return released;
}
inline void CodeGeneratorResponse::set_allocated_error(std::string* value) {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
if (value != nullptr) {
_impl_._has_bits_[0] |= 0x00000001u;
} 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)
}
inline ::uint64_t CodeGeneratorResponse::_internal_supported_features() const {
PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race);
return _impl_.supported_features_;
}
inline void CodeGeneratorResponse::_internal_set_supported_features(::uint64_t value) {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_._has_bits_[0] |= 0x00000002u;
_impl_.supported_features_ = value;
}

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