Automated rollback of commit d800c5f08b.

PiperOrigin-RevId: 538788425
pull/13005/head
Protobuf Team Bot 2 years ago committed by Copybara-Service
parent 2f1938fafe
commit dab3a8b389
  1. 5
      src/google/protobuf/compiler/cpp/field.cc
  2. 2
      src/google/protobuf/compiler/cpp/field_generators/enum_field.cc
  3. 2
      src/google/protobuf/compiler/cpp/field_generators/map_field.cc
  4. 4
      src/google/protobuf/compiler/cpp/field_generators/message_field.cc
  5. 2
      src/google/protobuf/compiler/cpp/field_generators/primitive_field.cc
  6. 2
      src/google/protobuf/compiler/cpp/field_generators/string_field.cc
  7. 6
      src/google/protobuf/compiler/plugin.pb.h
  8. 76
      src/google/protobuf/descriptor.pb.h
  9. 25
      src/google/protobuf/port_def.inc
  10. 2
      src/google/protobuf/port_undef.inc
  11. 1
      src/google/protobuf/repeated_field_unittest.cc

@ -85,11 +85,6 @@ std::vector<Sub> FieldVars(const FieldDescriptor* field, const Options& opts) {
{"{", ""},
{"}", ""},
// For TSan validation.
{"TsanDetectConcurrentMutation",
"PROTOBUF_TSAN_WRITE(&_internal_metadata_)"},
{"TsanDetectConcurrentRead", "PROTOBUF_TSAN_READ(&_internal_metadata_)"},
// Old-style names.
{"field", FieldMemberName(field, split)},
{"declared_type", DeclaredTypeMethodName(field->type())},

@ -388,11 +388,9 @@ void RepeatedEnum::GenerateInlineAccessorDefinitions(io::Printer* p) const {
return _internal_mutable_$name$();
}
inline const $pb$::RepeatedField<int>& $Msg$::_internal_$name$() const {
$TsanDetectConcurrentRead$;
return $field_$;
}
inline $pb$::RepeatedField<int>* $Msg$::_internal_mutable_$name$() {
$TsanDetectConcurrentMutation$;
return &$field_$;
}
)cc");

@ -218,7 +218,6 @@ void Map::GenerateAccessorDeclarations(io::Printer* p) const {
void Map::GenerateInlineAccessorDefinitions(io::Printer* p) const {
p->Emit(R"cc(
inline const $Map$& $Msg$::_internal_$name$() const {
$TsanDetectConcurrentRead$;
return $field_$.GetMap();
}
inline const $Map$& $Msg$::$name$() const {
@ -228,7 +227,6 @@ void Map::GenerateInlineAccessorDefinitions(io::Printer* p) const {
}
inline $Map$* $Msg$::_internal_mutable_$name$() {
$PrepareSplitMessageForWrite$;
$TsanDetectConcurrentMutation$;
return $field_$.MutableMap();
}
inline $Map$* $Msg$::mutable_$name$() {

@ -826,12 +826,10 @@ void RepeatedMessage::GenerateInlineAccessorDefinitions(io::Printer* p) const {
p->Emit(R"cc(
inline const $pb$::RepeatedPtrField<$Submsg$>&
$classname$::_internal_$name$() const {
$TsanDetectConcurrentRead$;
return $field$$.weak$;
}
inline $pb$::RepeatedPtrField<$Submsg$>*
$classname$::_internal_mutable_$name$() {
$TsanDetectConcurrentMutation$;
return &$field$$.weak$;
}
)cc");
@ -839,12 +837,10 @@ void RepeatedMessage::GenerateInlineAccessorDefinitions(io::Printer* p) const {
p->Emit(R"cc(
inline const $pb$::WeakRepeatedPtrField<$Submsg$>&
$Msg$::_internal_weak_$name$() const {
$TsanDetectConcurrentRead$;
return $field$;
}
inline $pb$::WeakRepeatedPtrField<$Submsg$>*
$Msg$::_internal_mutable_weak_$name$() {
$TsanDetectConcurrentMutation$;
return &$field$;
}
)cc");

@ -455,11 +455,9 @@ void RepeatedPrimitive::GenerateInlineAccessorDefinitions(
}
inline const $pb$::RepeatedField<$Type$>& $Msg$::_internal_$name$() const {
$TsanDetectConcurrentRead$;
return $field_$;
}
inline $pb$::RepeatedField<$Type$>* $Msg$::_internal_mutable_$name$() {
$TsanDetectConcurrentMutation$;
return &$field_$;
}
)cc");

@ -893,12 +893,10 @@ void RepeatedString::GenerateInlineAccessorDefinitions(io::Printer* p) const {
}
inline const ::$proto_ns$::RepeatedPtrField<std::string>&
$Msg$::_internal_$name$() const {
$TsanDetectConcurrentRead$;
return $field_$;
}
inline ::$proto_ns$::RepeatedPtrField<std::string>*
$Msg$::_internal_mutable_$name$() {
$TsanDetectConcurrentMutation$;
return &$field_$;
}
)cc");

@ -1239,12 +1239,10 @@ inline ::google::protobuf::RepeatedPtrField<std::string>* CodeGeneratorRequest::
}
inline const ::google::protobuf::RepeatedPtrField<std::string>&
CodeGeneratorRequest::_internal_file_to_generate() const {
PROTOBUF_TSAN_READ(&_internal_metadata_);
return _impl_.file_to_generate_;
}
inline ::google::protobuf::RepeatedPtrField<std::string>*
CodeGeneratorRequest::_internal_mutable_file_to_generate() {
PROTOBUF_TSAN_WRITE(&_internal_metadata_);
return &_impl_.file_to_generate_;
}
@ -1343,12 +1341,10 @@ CodeGeneratorRequest::proto_file() const {
}
inline const ::google::protobuf::RepeatedPtrField<::google::protobuf::FileDescriptorProto>&
CodeGeneratorRequest::_internal_proto_file() const {
PROTOBUF_TSAN_READ(&_internal_metadata_);
return _impl_.proto_file_;
}
inline ::google::protobuf::RepeatedPtrField<::google::protobuf::FileDescriptorProto>*
CodeGeneratorRequest::_internal_mutable_proto_file() {
PROTOBUF_TSAN_WRITE(&_internal_metadata_);
return &_impl_.proto_file_;
}
@ -1848,12 +1844,10 @@ CodeGeneratorResponse::file() const {
}
inline const ::google::protobuf::RepeatedPtrField<::google::protobuf::compiler::CodeGeneratorResponse_File>&
CodeGeneratorResponse::_internal_file() const {
PROTOBUF_TSAN_READ(&_internal_metadata_);
return _impl_.file_;
}
inline ::google::protobuf::RepeatedPtrField<::google::protobuf::compiler::CodeGeneratorResponse_File>*
CodeGeneratorResponse::_internal_mutable_file() {
PROTOBUF_TSAN_WRITE(&_internal_metadata_);
return &_impl_.file_;
}

@ -8704,12 +8704,10 @@ FileDescriptorSet::file() const {
}
inline const ::google::protobuf::RepeatedPtrField<::google::protobuf::FileDescriptorProto>&
FileDescriptorSet::_internal_file() const {
PROTOBUF_TSAN_READ(&_internal_metadata_);
return _impl_.file_;
}
inline ::google::protobuf::RepeatedPtrField<::google::protobuf::FileDescriptorProto>*
FileDescriptorSet::_internal_mutable_file() {
PROTOBUF_TSAN_WRITE(&_internal_metadata_);
return &_impl_.file_;
}
@ -8923,12 +8921,10 @@ inline ::google::protobuf::RepeatedPtrField<std::string>* FileDescriptorProto::m
}
inline const ::google::protobuf::RepeatedPtrField<std::string>&
FileDescriptorProto::_internal_dependency() const {
PROTOBUF_TSAN_READ(&_internal_metadata_);
return _impl_.dependency_;
}
inline ::google::protobuf::RepeatedPtrField<std::string>*
FileDescriptorProto::_internal_mutable_dependency() {
PROTOBUF_TSAN_WRITE(&_internal_metadata_);
return &_impl_.dependency_;
}
@ -8964,11 +8960,9 @@ inline ::google::protobuf::RepeatedField<::int32_t>* FileDescriptorProto::mutabl
}
inline const ::google::protobuf::RepeatedField<::int32_t>& FileDescriptorProto::_internal_public_dependency() const {
PROTOBUF_TSAN_READ(&_internal_metadata_);
return _impl_.public_dependency_;
}
inline ::google::protobuf::RepeatedField<::int32_t>* FileDescriptorProto::_internal_mutable_public_dependency() {
PROTOBUF_TSAN_WRITE(&_internal_metadata_);
return &_impl_.public_dependency_;
}
@ -9004,11 +8998,9 @@ inline ::google::protobuf::RepeatedField<::int32_t>* FileDescriptorProto::mutabl
}
inline const ::google::protobuf::RepeatedField<::int32_t>& FileDescriptorProto::_internal_weak_dependency() const {
PROTOBUF_TSAN_READ(&_internal_metadata_);
return _impl_.weak_dependency_;
}
inline ::google::protobuf::RepeatedField<::int32_t>* FileDescriptorProto::_internal_mutable_weak_dependency() {
PROTOBUF_TSAN_WRITE(&_internal_metadata_);
return &_impl_.weak_dependency_;
}
@ -9047,12 +9039,10 @@ FileDescriptorProto::message_type() const {
}
inline const ::google::protobuf::RepeatedPtrField<::google::protobuf::DescriptorProto>&
FileDescriptorProto::_internal_message_type() const {
PROTOBUF_TSAN_READ(&_internal_metadata_);
return _impl_.message_type_;
}
inline ::google::protobuf::RepeatedPtrField<::google::protobuf::DescriptorProto>*
FileDescriptorProto::_internal_mutable_message_type() {
PROTOBUF_TSAN_WRITE(&_internal_metadata_);
return &_impl_.message_type_;
}
@ -9091,12 +9081,10 @@ FileDescriptorProto::enum_type() const {
}
inline const ::google::protobuf::RepeatedPtrField<::google::protobuf::EnumDescriptorProto>&
FileDescriptorProto::_internal_enum_type() const {
PROTOBUF_TSAN_READ(&_internal_metadata_);
return _impl_.enum_type_;
}
inline ::google::protobuf::RepeatedPtrField<::google::protobuf::EnumDescriptorProto>*
FileDescriptorProto::_internal_mutable_enum_type() {
PROTOBUF_TSAN_WRITE(&_internal_metadata_);
return &_impl_.enum_type_;
}
@ -9135,12 +9123,10 @@ FileDescriptorProto::service() const {
}
inline const ::google::protobuf::RepeatedPtrField<::google::protobuf::ServiceDescriptorProto>&
FileDescriptorProto::_internal_service() const {
PROTOBUF_TSAN_READ(&_internal_metadata_);
return _impl_.service_;
}
inline ::google::protobuf::RepeatedPtrField<::google::protobuf::ServiceDescriptorProto>*
FileDescriptorProto::_internal_mutable_service() {
PROTOBUF_TSAN_WRITE(&_internal_metadata_);
return &_impl_.service_;
}
@ -9179,12 +9165,10 @@ FileDescriptorProto::extension() const {
}
inline const ::google::protobuf::RepeatedPtrField<::google::protobuf::FieldDescriptorProto>&
FileDescriptorProto::_internal_extension() const {
PROTOBUF_TSAN_READ(&_internal_metadata_);
return _impl_.extension_;
}
inline ::google::protobuf::RepeatedPtrField<::google::protobuf::FieldDescriptorProto>*
FileDescriptorProto::_internal_mutable_extension() {
PROTOBUF_TSAN_WRITE(&_internal_metadata_);
return &_impl_.extension_;
}
@ -9794,12 +9778,10 @@ DescriptorProto::field() const {
}
inline const ::google::protobuf::RepeatedPtrField<::google::protobuf::FieldDescriptorProto>&
DescriptorProto::_internal_field() const {
PROTOBUF_TSAN_READ(&_internal_metadata_);
return _impl_.field_;
}
inline ::google::protobuf::RepeatedPtrField<::google::protobuf::FieldDescriptorProto>*
DescriptorProto::_internal_mutable_field() {
PROTOBUF_TSAN_WRITE(&_internal_metadata_);
return &_impl_.field_;
}
@ -9838,12 +9820,10 @@ DescriptorProto::extension() const {
}
inline const ::google::protobuf::RepeatedPtrField<::google::protobuf::FieldDescriptorProto>&
DescriptorProto::_internal_extension() const {
PROTOBUF_TSAN_READ(&_internal_metadata_);
return _impl_.extension_;
}
inline ::google::protobuf::RepeatedPtrField<::google::protobuf::FieldDescriptorProto>*
DescriptorProto::_internal_mutable_extension() {
PROTOBUF_TSAN_WRITE(&_internal_metadata_);
return &_impl_.extension_;
}
@ -9882,12 +9862,10 @@ DescriptorProto::nested_type() const {
}
inline const ::google::protobuf::RepeatedPtrField<::google::protobuf::DescriptorProto>&
DescriptorProto::_internal_nested_type() const {
PROTOBUF_TSAN_READ(&_internal_metadata_);
return _impl_.nested_type_;
}
inline ::google::protobuf::RepeatedPtrField<::google::protobuf::DescriptorProto>*
DescriptorProto::_internal_mutable_nested_type() {
PROTOBUF_TSAN_WRITE(&_internal_metadata_);
return &_impl_.nested_type_;
}
@ -9926,12 +9904,10 @@ DescriptorProto::enum_type() const {
}
inline const ::google::protobuf::RepeatedPtrField<::google::protobuf::EnumDescriptorProto>&
DescriptorProto::_internal_enum_type() const {
PROTOBUF_TSAN_READ(&_internal_metadata_);
return _impl_.enum_type_;
}
inline ::google::protobuf::RepeatedPtrField<::google::protobuf::EnumDescriptorProto>*
DescriptorProto::_internal_mutable_enum_type() {
PROTOBUF_TSAN_WRITE(&_internal_metadata_);
return &_impl_.enum_type_;
}
@ -9970,12 +9946,10 @@ DescriptorProto::extension_range() const {
}
inline const ::google::protobuf::RepeatedPtrField<::google::protobuf::DescriptorProto_ExtensionRange>&
DescriptorProto::_internal_extension_range() const {
PROTOBUF_TSAN_READ(&_internal_metadata_);
return _impl_.extension_range_;
}
inline ::google::protobuf::RepeatedPtrField<::google::protobuf::DescriptorProto_ExtensionRange>*
DescriptorProto::_internal_mutable_extension_range() {
PROTOBUF_TSAN_WRITE(&_internal_metadata_);
return &_impl_.extension_range_;
}
@ -10014,12 +9988,10 @@ DescriptorProto::oneof_decl() const {
}
inline const ::google::protobuf::RepeatedPtrField<::google::protobuf::OneofDescriptorProto>&
DescriptorProto::_internal_oneof_decl() const {
PROTOBUF_TSAN_READ(&_internal_metadata_);
return _impl_.oneof_decl_;
}
inline ::google::protobuf::RepeatedPtrField<::google::protobuf::OneofDescriptorProto>*
DescriptorProto::_internal_mutable_oneof_decl() {
PROTOBUF_TSAN_WRITE(&_internal_metadata_);
return &_impl_.oneof_decl_;
}
@ -10148,12 +10120,10 @@ DescriptorProto::reserved_range() const {
}
inline const ::google::protobuf::RepeatedPtrField<::google::protobuf::DescriptorProto_ReservedRange>&
DescriptorProto::_internal_reserved_range() const {
PROTOBUF_TSAN_READ(&_internal_metadata_);
return _impl_.reserved_range_;
}
inline ::google::protobuf::RepeatedPtrField<::google::protobuf::DescriptorProto_ReservedRange>*
DescriptorProto::_internal_mutable_reserved_range() {
PROTOBUF_TSAN_WRITE(&_internal_metadata_);
return &_impl_.reserved_range_;
}
@ -10237,12 +10207,10 @@ inline ::google::protobuf::RepeatedPtrField<std::string>* DescriptorProto::mutab
}
inline const ::google::protobuf::RepeatedPtrField<std::string>&
DescriptorProto::_internal_reserved_name() const {
PROTOBUF_TSAN_READ(&_internal_metadata_);
return _impl_.reserved_name_;
}
inline ::google::protobuf::RepeatedPtrField<std::string>*
DescriptorProto::_internal_mutable_reserved_name() {
PROTOBUF_TSAN_WRITE(&_internal_metadata_);
return &_impl_.reserved_name_;
}
@ -10515,12 +10483,10 @@ ExtensionRangeOptions::uninterpreted_option() const {
}
inline const ::google::protobuf::RepeatedPtrField<::google::protobuf::UninterpretedOption>&
ExtensionRangeOptions::_internal_uninterpreted_option() const {
PROTOBUF_TSAN_READ(&_internal_metadata_);
return _impl_.uninterpreted_option_;
}
inline ::google::protobuf::RepeatedPtrField<::google::protobuf::UninterpretedOption>*
ExtensionRangeOptions::_internal_mutable_uninterpreted_option() {
PROTOBUF_TSAN_WRITE(&_internal_metadata_);
return &_impl_.uninterpreted_option_;
}
@ -10559,12 +10525,10 @@ ExtensionRangeOptions::declaration() const {
}
inline const ::google::protobuf::RepeatedPtrField<::google::protobuf::ExtensionRangeOptions_Declaration>&
ExtensionRangeOptions::_internal_declaration() const {
PROTOBUF_TSAN_READ(&_internal_metadata_);
return _impl_.declaration_;
}
inline ::google::protobuf::RepeatedPtrField<::google::protobuf::ExtensionRangeOptions_Declaration>*
ExtensionRangeOptions::_internal_mutable_declaration() {
PROTOBUF_TSAN_WRITE(&_internal_metadata_);
return &_impl_.declaration_;
}
@ -11443,12 +11407,10 @@ EnumDescriptorProto::value() const {
}
inline const ::google::protobuf::RepeatedPtrField<::google::protobuf::EnumValueDescriptorProto>&
EnumDescriptorProto::_internal_value() const {
PROTOBUF_TSAN_READ(&_internal_metadata_);
return _impl_.value_;
}
inline ::google::protobuf::RepeatedPtrField<::google::protobuf::EnumValueDescriptorProto>*
EnumDescriptorProto::_internal_mutable_value() {
PROTOBUF_TSAN_WRITE(&_internal_metadata_);
return &_impl_.value_;
}
@ -11577,12 +11539,10 @@ EnumDescriptorProto::reserved_range() const {
}
inline const ::google::protobuf::RepeatedPtrField<::google::protobuf::EnumDescriptorProto_EnumReservedRange>&
EnumDescriptorProto::_internal_reserved_range() const {
PROTOBUF_TSAN_READ(&_internal_metadata_);
return _impl_.reserved_range_;
}
inline ::google::protobuf::RepeatedPtrField<::google::protobuf::EnumDescriptorProto_EnumReservedRange>*
EnumDescriptorProto::_internal_mutable_reserved_range() {
PROTOBUF_TSAN_WRITE(&_internal_metadata_);
return &_impl_.reserved_range_;
}
@ -11666,12 +11626,10 @@ inline ::google::protobuf::RepeatedPtrField<std::string>* EnumDescriptorProto::m
}
inline const ::google::protobuf::RepeatedPtrField<std::string>&
EnumDescriptorProto::_internal_reserved_name() const {
PROTOBUF_TSAN_READ(&_internal_metadata_);
return _impl_.reserved_name_;
}
inline ::google::protobuf::RepeatedPtrField<std::string>*
EnumDescriptorProto::_internal_mutable_reserved_name() {
PROTOBUF_TSAN_WRITE(&_internal_metadata_);
return &_impl_.reserved_name_;
}
@ -11959,12 +11917,10 @@ ServiceDescriptorProto::method() const {
}
inline const ::google::protobuf::RepeatedPtrField<::google::protobuf::MethodDescriptorProto>&
ServiceDescriptorProto::_internal_method() const {
PROTOBUF_TSAN_READ(&_internal_metadata_);
return _impl_.method_;
}
inline ::google::protobuf::RepeatedPtrField<::google::protobuf::MethodDescriptorProto>*
ServiceDescriptorProto::_internal_mutable_method() {
PROTOBUF_TSAN_WRITE(&_internal_metadata_);
return &_impl_.method_;
}
@ -13311,12 +13267,10 @@ FileOptions::uninterpreted_option() const {
}
inline const ::google::protobuf::RepeatedPtrField<::google::protobuf::UninterpretedOption>&
FileOptions::_internal_uninterpreted_option() const {
PROTOBUF_TSAN_READ(&_internal_metadata_);
return _impl_.uninterpreted_option_;
}
inline ::google::protobuf::RepeatedPtrField<::google::protobuf::UninterpretedOption>*
FileOptions::_internal_mutable_uninterpreted_option() {
PROTOBUF_TSAN_WRITE(&_internal_metadata_);
return &_impl_.uninterpreted_option_;
}
@ -13484,12 +13438,10 @@ MessageOptions::uninterpreted_option() const {
}
inline const ::google::protobuf::RepeatedPtrField<::google::protobuf::UninterpretedOption>&
MessageOptions::_internal_uninterpreted_option() const {
PROTOBUF_TSAN_READ(&_internal_metadata_);
return _impl_.uninterpreted_option_;
}
inline ::google::protobuf::RepeatedPtrField<::google::protobuf::UninterpretedOption>*
MessageOptions::_internal_mutable_uninterpreted_option() {
PROTOBUF_TSAN_WRITE(&_internal_metadata_);
return &_impl_.uninterpreted_option_;
}
@ -13758,11 +13710,9 @@ inline ::google::protobuf::RepeatedField<int>* FieldOptions::mutable_targets() {
return _internal_mutable_targets();
}
inline const ::google::protobuf::RepeatedField<int>& FieldOptions::_internal_targets() const {
PROTOBUF_TSAN_READ(&_internal_metadata_);
return _impl_.targets_;
}
inline ::google::protobuf::RepeatedField<int>* FieldOptions::_internal_mutable_targets() {
PROTOBUF_TSAN_WRITE(&_internal_metadata_);
return &_impl_.targets_;
}
@ -13801,12 +13751,10 @@ FieldOptions::uninterpreted_option() const {
}
inline const ::google::protobuf::RepeatedPtrField<::google::protobuf::UninterpretedOption>&
FieldOptions::_internal_uninterpreted_option() const {
PROTOBUF_TSAN_READ(&_internal_metadata_);
return _impl_.uninterpreted_option_;
}
inline ::google::protobuf::RepeatedPtrField<::google::protobuf::UninterpretedOption>*
FieldOptions::_internal_mutable_uninterpreted_option() {
PROTOBUF_TSAN_WRITE(&_internal_metadata_);
return &_impl_.uninterpreted_option_;
}
@ -13875,12 +13823,10 @@ OneofOptions::uninterpreted_option() const {
}
inline const ::google::protobuf::RepeatedPtrField<::google::protobuf::UninterpretedOption>&
OneofOptions::_internal_uninterpreted_option() const {
PROTOBUF_TSAN_READ(&_internal_metadata_);
return _impl_.uninterpreted_option_;
}
inline ::google::protobuf::RepeatedPtrField<::google::protobuf::UninterpretedOption>*
OneofOptions::_internal_mutable_uninterpreted_option() {
PROTOBUF_TSAN_WRITE(&_internal_metadata_);
return &_impl_.uninterpreted_option_;
}
@ -13998,12 +13944,10 @@ EnumOptions::uninterpreted_option() const {
}
inline const ::google::protobuf::RepeatedPtrField<::google::protobuf::UninterpretedOption>&
EnumOptions::_internal_uninterpreted_option() const {
PROTOBUF_TSAN_READ(&_internal_metadata_);
return _impl_.uninterpreted_option_;
}
inline ::google::protobuf::RepeatedPtrField<::google::protobuf::UninterpretedOption>*
EnumOptions::_internal_mutable_uninterpreted_option() {
PROTOBUF_TSAN_WRITE(&_internal_metadata_);
return &_impl_.uninterpreted_option_;
}
@ -14096,12 +14040,10 @@ EnumValueOptions::uninterpreted_option() const {
}
inline const ::google::protobuf::RepeatedPtrField<::google::protobuf::UninterpretedOption>&
EnumValueOptions::_internal_uninterpreted_option() const {
PROTOBUF_TSAN_READ(&_internal_metadata_);
return _impl_.uninterpreted_option_;
}
inline ::google::protobuf::RepeatedPtrField<::google::protobuf::UninterpretedOption>*
EnumValueOptions::_internal_mutable_uninterpreted_option() {
PROTOBUF_TSAN_WRITE(&_internal_metadata_);
return &_impl_.uninterpreted_option_;
}
@ -14169,12 +14111,10 @@ ServiceOptions::uninterpreted_option() const {
}
inline const ::google::protobuf::RepeatedPtrField<::google::protobuf::UninterpretedOption>&
ServiceOptions::_internal_uninterpreted_option() const {
PROTOBUF_TSAN_READ(&_internal_metadata_);
return _impl_.uninterpreted_option_;
}
inline ::google::protobuf::RepeatedPtrField<::google::protobuf::UninterpretedOption>*
ServiceOptions::_internal_mutable_uninterpreted_option() {
PROTOBUF_TSAN_WRITE(&_internal_metadata_);
return &_impl_.uninterpreted_option_;
}
@ -14268,12 +14208,10 @@ MethodOptions::uninterpreted_option() const {
}
inline const ::google::protobuf::RepeatedPtrField<::google::protobuf::UninterpretedOption>&
MethodOptions::_internal_uninterpreted_option() const {
PROTOBUF_TSAN_READ(&_internal_metadata_);
return _impl_.uninterpreted_option_;
}
inline ::google::protobuf::RepeatedPtrField<::google::protobuf::UninterpretedOption>*
MethodOptions::_internal_mutable_uninterpreted_option() {
PROTOBUF_TSAN_WRITE(&_internal_metadata_);
return &_impl_.uninterpreted_option_;
}
@ -14408,12 +14346,10 @@ UninterpretedOption::name() const {
}
inline const ::google::protobuf::RepeatedPtrField<::google::protobuf::UninterpretedOption_NamePart>&
UninterpretedOption::_internal_name() const {
PROTOBUF_TSAN_READ(&_internal_metadata_);
return _impl_.name_;
}
inline ::google::protobuf::RepeatedPtrField<::google::protobuf::UninterpretedOption_NamePart>*
UninterpretedOption::_internal_mutable_name() {
PROTOBUF_TSAN_WRITE(&_internal_metadata_);
return &_impl_.name_;
}
@ -14717,11 +14653,9 @@ inline ::google::protobuf::RepeatedField<::int32_t>* SourceCodeInfo_Location::mu
}
inline const ::google::protobuf::RepeatedField<::int32_t>& SourceCodeInfo_Location::_internal_path() const {
PROTOBUF_TSAN_READ(&_internal_metadata_);
return _impl_.path_;
}
inline ::google::protobuf::RepeatedField<::int32_t>* SourceCodeInfo_Location::_internal_mutable_path() {
PROTOBUF_TSAN_WRITE(&_internal_metadata_);
return &_impl_.path_;
}
@ -14757,11 +14691,9 @@ inline ::google::protobuf::RepeatedField<::int32_t>* SourceCodeInfo_Location::mu
}
inline const ::google::protobuf::RepeatedField<::int32_t>& SourceCodeInfo_Location::_internal_span() const {
PROTOBUF_TSAN_READ(&_internal_metadata_);
return _impl_.span_;
}
inline ::google::protobuf::RepeatedField<::int32_t>* SourceCodeInfo_Location::_internal_mutable_span() {
PROTOBUF_TSAN_WRITE(&_internal_metadata_);
return &_impl_.span_;
}
@ -14971,12 +14903,10 @@ inline ::google::protobuf::RepeatedPtrField<std::string>* SourceCodeInfo_Locatio
}
inline const ::google::protobuf::RepeatedPtrField<std::string>&
SourceCodeInfo_Location::_internal_leading_detached_comments() const {
PROTOBUF_TSAN_READ(&_internal_metadata_);
return _impl_.leading_detached_comments_;
}
inline ::google::protobuf::RepeatedPtrField<std::string>*
SourceCodeInfo_Location::_internal_mutable_leading_detached_comments() {
PROTOBUF_TSAN_WRITE(&_internal_metadata_);
return &_impl_.leading_detached_comments_;
}
@ -15019,12 +14949,10 @@ SourceCodeInfo::location() const {
}
inline const ::google::protobuf::RepeatedPtrField<::google::protobuf::SourceCodeInfo_Location>&
SourceCodeInfo::_internal_location() const {
PROTOBUF_TSAN_READ(&_internal_metadata_);
return _impl_.location_;
}
inline ::google::protobuf::RepeatedPtrField<::google::protobuf::SourceCodeInfo_Location>*
SourceCodeInfo::_internal_mutable_location() {
PROTOBUF_TSAN_WRITE(&_internal_metadata_);
return &_impl_.location_;
}
@ -15064,11 +14992,9 @@ inline ::google::protobuf::RepeatedField<::int32_t>* GeneratedCodeInfo_Annotatio
}
inline const ::google::protobuf::RepeatedField<::int32_t>& GeneratedCodeInfo_Annotation::_internal_path() const {
PROTOBUF_TSAN_READ(&_internal_metadata_);
return _impl_.path_;
}
inline ::google::protobuf::RepeatedField<::int32_t>* GeneratedCodeInfo_Annotation::_internal_mutable_path() {
PROTOBUF_TSAN_WRITE(&_internal_metadata_);
return &_impl_.path_;
}
@ -15250,12 +15176,10 @@ GeneratedCodeInfo::annotation() const {
}
inline const ::google::protobuf::RepeatedPtrField<::google::protobuf::GeneratedCodeInfo_Annotation>&
GeneratedCodeInfo::_internal_annotation() const {
PROTOBUF_TSAN_READ(&_internal_metadata_);
return _impl_.annotation_;
}
inline ::google::protobuf::RepeatedPtrField<::google::protobuf::GeneratedCodeInfo_Annotation>*
GeneratedCodeInfo::_internal_mutable_annotation() {
PROTOBUF_TSAN_WRITE(&_internal_metadata_);
return &_impl_.annotation_;
}

@ -829,31 +829,6 @@ static_assert(PROTOBUF_ABSL_MIN(20230125, 3),
# endif
#endif
#ifdef PROTOBUF_TSAN_READ
#error PROTOBUF_TSAN_READ was previously defined
#endif
#ifdef PROTOBUF_TSAN_WRITE
#error PROTOBUF_TSAN_WRITE was previously defined
#endif
#ifdef PROTOBUF_TSAN
// TODO(b/285620714): it would be preferable to use __tsan_external_read/
// __tsan_external_write, but they can cause dlopen issues.
#define PROTOBUF_TSAN_READ(addr) \
do { \
volatile char protobuf_tsan_dummy = *reinterpret_cast<const char *>(addr); \
(void)protobuf_tsan_dummy; \
} while (0)
#define PROTOBUF_TSAN_WRITE(addr) \
do { \
char protobuf_tsan_zero = 0; \
asm volatile("" : "+m"(protobuf_tsan_zero)); \
*reinterpret_cast<char *>(addr) += protobuf_tsan_zero; \
} while (0)
#else // PROTOBUF_TSAN
#define PROTOBUF_TSAN_READ(addr)
#define PROTOBUF_TSAN_WRITE(addr)
#endif // PROTOBUF_TSAN
#ifdef PROTOBUF_USE_TABLE_PARSER_ON_REFLECTION
#error PROTOBUF_USE_TABLE_PARSER_ON_REFLECTION was previously defined
#endif

@ -103,8 +103,6 @@
#undef PROTOBUF_ASAN
#undef PROTOBUF_MSAN
#undef PROTOBUF_TSAN
#undef PROTOBUF_TSAN_READ
#undef PROTOBUF_TSAN_WRITE
#undef PROTOBUF_USE_TABLE_PARSER_ON_REFLECTION
#undef PROTOBUF_TC_PARAM_DECL
#undef PROTOBUF_EXCLUSIVE_LOCKS_REQUIRED

@ -2029,7 +2029,6 @@ TEST(RepeatedPtrField, Cleanups) {
EXPECT_THAT(growth.cleanups, testing::IsEmpty());
}
// ===================================================================
// Iterator tests stolen from net/proto/proto-array_unittest.

Loading…
Cancel
Save