Clean up macros related to the phased rollout of TSan validation.

PiperOrigin-RevId: 546969351
pull/13265/head
Protobuf Team Bot 1 year ago committed by Copybara-Service
parent 0d7a39663b
commit 55e5230196
  1. 17
      src/google/protobuf/compiler/cpp/field.cc
  2. 154
      src/google/protobuf/compiler/plugin.pb.h
  3. 4
      src/google/protobuf/cpp_features.pb.h
  4. 1288
      src/google/protobuf/descriptor.pb.h
  5. 10
      src/google/protobuf/port_def.inc
  6. 8
      src/google/protobuf/port_undef.inc

@ -62,17 +62,6 @@ using Sub = ::google::protobuf::io::Printer::Sub;
std::vector<Sub> FieldVars(const FieldDescriptor* field, const Options& opts) {
bool split = ShouldSplit(field, opts);
// TODO(b/280674214): get rid of phase logic after TSan validation rolls out.
std::string tsan_validation_phase;
if (field->is_repeated()) {
tsan_validation_phase = "REPEATED";
} else if (field->cpp_type() < FieldDescriptor::CPPTYPE_STRING) {
tsan_validation_phase = "PRIMITIVE";
} else if (field->cpp_type() == FieldDescriptor::CPPTYPE_STRING) {
tsan_validation_phase = "STRING";
} else { // message fields
tsan_validation_phase = "MESSAGE";
}
std::vector<Sub> vars = {
// This will eventually be renamed to "field", once the existing "field"
// variable is replaced with "field_" everywhere.
@ -99,11 +88,9 @@ std::vector<Sub> FieldVars(const FieldDescriptor* field, const Options& opts) {
// For TSan validation.
{"TsanDetectConcurrentMutation",
absl::StrCat("PROTOBUF_TSAN_WRITE_", tsan_validation_phase,
"(&_impl_._tsan_detect_race)")},
"PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race)"},
{"TsanDetectConcurrentRead",
absl::StrCat("PROTOBUF_TSAN_READ_", tsan_validation_phase,
"(&_impl_._tsan_detect_race)")},
"PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race)"},
// Old-style names.
{"field", FieldMemberName(field, split)},

@ -1059,11 +1059,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_PRIMITIVE(&_impl_._tsan_detect_race);
PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race);
return _impl_.major_;
}
inline void Version::_internal_set_major(::int32_t value) {
PROTOBUF_TSAN_WRITE_PRIMITIVE(&_impl_._tsan_detect_race);
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_._has_bits_[0] |= 0x00000002u;
_impl_.major_ = value;
}
@ -1086,11 +1086,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_PRIMITIVE(&_impl_._tsan_detect_race);
PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race);
return _impl_.minor_;
}
inline void Version::_internal_set_minor(::int32_t value) {
PROTOBUF_TSAN_WRITE_PRIMITIVE(&_impl_._tsan_detect_race);
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_._has_bits_[0] |= 0x00000004u;
_impl_.minor_ = value;
}
@ -1113,11 +1113,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_PRIMITIVE(&_impl_._tsan_detect_race);
PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race);
return _impl_.patch_;
}
inline void Version::_internal_set_patch(::int32_t value) {
PROTOBUF_TSAN_WRITE_PRIMITIVE(&_impl_._tsan_detect_race);
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_._has_bits_[0] |= 0x00000008u;
_impl_.patch_ = value;
}
@ -1138,7 +1138,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_STRING(&_impl_._tsan_detect_race);
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)
@ -1149,21 +1149,21 @@ inline std::string* Version::mutable_suffix() {
return _s;
}
inline const std::string& Version::_internal_suffix() const {
PROTOBUF_TSAN_READ_STRING(&_impl_._tsan_detect_race);
PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race);
return _impl_.suffix_.Get();
}
inline void Version::_internal_set_suffix(const std::string& value) {
PROTOBUF_TSAN_WRITE_STRING(&_impl_._tsan_detect_race);
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_STRING(&_impl_._tsan_detect_race);
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_STRING(&_impl_._tsan_detect_race);
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;
@ -1176,7 +1176,7 @@ inline std::string* Version::release_suffix() {
return released;
}
inline void Version::set_allocated_suffix(std::string* value) {
PROTOBUF_TSAN_WRITE_STRING(&_impl_._tsan_detect_race);
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
if (value != nullptr) {
_impl_._has_bits_[0] |= 0x00000001u;
} else {
@ -1206,7 +1206,7 @@ inline void CodeGeneratorRequest::clear_file_to_generate() {
_internal_mutable_file_to_generate()->Clear();
}
inline std::string* CodeGeneratorRequest::add_file_to_generate() {
PROTOBUF_TSAN_WRITE_REPEATED(&_impl_._tsan_detect_race);
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
std::string* _s = _internal_mutable_file_to_generate()->Add();
// @@protoc_insertion_point(field_add_mutable:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate)
return _s;
@ -1244,29 +1244,29 @@ inline void CodeGeneratorRequest::set_file_to_generate(int index, absl::string_v
// @@protoc_insertion_point(field_set_string_piece:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate)
}
inline void CodeGeneratorRequest::add_file_to_generate(const std::string& value) {
PROTOBUF_TSAN_WRITE_REPEATED(&_impl_._tsan_detect_race);
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_internal_mutable_file_to_generate()->Add()->assign(value);
// @@protoc_insertion_point(field_add:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate)
}
inline void CodeGeneratorRequest::add_file_to_generate(std::string&& value) {
PROTOBUF_TSAN_WRITE_REPEATED(&_impl_._tsan_detect_race);
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_internal_mutable_file_to_generate()->Add(std::move(value));
// @@protoc_insertion_point(field_add:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate)
}
inline void CodeGeneratorRequest::add_file_to_generate(const char* value) {
ABSL_DCHECK(value != nullptr);
PROTOBUF_TSAN_WRITE_REPEATED(&_impl_._tsan_detect_race);
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_internal_mutable_file_to_generate()->Add()->assign(value);
// @@protoc_insertion_point(field_add_char:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate)
}
inline void CodeGeneratorRequest::add_file_to_generate(const char* value, std::size_t size) {
PROTOBUF_TSAN_WRITE_REPEATED(&_impl_._tsan_detect_race);
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_internal_mutable_file_to_generate()->Add()->assign(
reinterpret_cast<const char*>(value), size);
// @@protoc_insertion_point(field_add_pointer:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate)
}
inline void CodeGeneratorRequest::add_file_to_generate(absl::string_view value) {
PROTOBUF_TSAN_WRITE_REPEATED(&_impl_._tsan_detect_race);
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_internal_mutable_file_to_generate()->Add()->assign(value.data(), value.size());
// @@protoc_insertion_point(field_add_string_piece:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate)
}
@ -1277,17 +1277,17 @@ CodeGeneratorRequest::file_to_generate() const {
}
inline ::google::protobuf::RepeatedPtrField<std::string>* CodeGeneratorRequest::mutable_file_to_generate() {
// @@protoc_insertion_point(field_mutable_list:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate)
PROTOBUF_TSAN_WRITE_REPEATED(&_impl_._tsan_detect_race);
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
return _internal_mutable_file_to_generate();
}
inline const ::google::protobuf::RepeatedPtrField<std::string>&
CodeGeneratorRequest::_internal_file_to_generate() const {
PROTOBUF_TSAN_READ_REPEATED(&_impl_._tsan_detect_race);
PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race);
return _impl_.file_to_generate_;
}
inline ::google::protobuf::RepeatedPtrField<std::string>*
CodeGeneratorRequest::_internal_mutable_file_to_generate() {
PROTOBUF_TSAN_READ_REPEATED(&_impl_._tsan_detect_race);
PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race);
return &_impl_.file_to_generate_;
}
@ -1307,7 +1307,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_STRING(&_impl_._tsan_detect_race);
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)
@ -1318,21 +1318,21 @@ inline std::string* CodeGeneratorRequest::mutable_parameter() {
return _s;
}
inline const std::string& CodeGeneratorRequest::_internal_parameter() const {
PROTOBUF_TSAN_READ_STRING(&_impl_._tsan_detect_race);
PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race);
return _impl_.parameter_.Get();
}
inline void CodeGeneratorRequest::_internal_set_parameter(const std::string& value) {
PROTOBUF_TSAN_WRITE_STRING(&_impl_._tsan_detect_race);
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_STRING(&_impl_._tsan_detect_race);
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_STRING(&_impl_._tsan_detect_race);
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;
@ -1345,7 +1345,7 @@ inline std::string* CodeGeneratorRequest::release_parameter() {
return released;
}
inline void CodeGeneratorRequest::set_allocated_parameter(std::string* value) {
PROTOBUF_TSAN_WRITE_STRING(&_impl_._tsan_detect_race);
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
if (value != nullptr) {
_impl_._has_bits_[0] |= 0x00000001u;
} else {
@ -1374,7 +1374,7 @@ inline ::google::protobuf::FileDescriptorProto* CodeGeneratorRequest::mutable_pr
inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::FileDescriptorProto >*
CodeGeneratorRequest::mutable_proto_file() {
// @@protoc_insertion_point(field_mutable_list:google.protobuf.compiler.CodeGeneratorRequest.proto_file)
PROTOBUF_TSAN_WRITE_REPEATED(&_impl_._tsan_detect_race);
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
return _internal_mutable_proto_file();
}
inline const ::google::protobuf::FileDescriptorProto& CodeGeneratorRequest::proto_file(int index) const {
@ -1382,7 +1382,7 @@ inline const ::google::protobuf::FileDescriptorProto& CodeGeneratorRequest::prot
return _internal_proto_file().Get(index);
}
inline ::google::protobuf::FileDescriptorProto* CodeGeneratorRequest::add_proto_file() {
PROTOBUF_TSAN_WRITE_REPEATED(&_impl_._tsan_detect_race);
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
::google::protobuf::FileDescriptorProto* _add = _internal_mutable_proto_file()->Add();
// @@protoc_insertion_point(field_add:google.protobuf.compiler.CodeGeneratorRequest.proto_file)
return _add;
@ -1394,12 +1394,12 @@ CodeGeneratorRequest::proto_file() const {
}
inline const ::google::protobuf::RepeatedPtrField<::google::protobuf::FileDescriptorProto>&
CodeGeneratorRequest::_internal_proto_file() const {
PROTOBUF_TSAN_READ_REPEATED(&_impl_._tsan_detect_race);
PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race);
return _impl_.proto_file_;
}
inline ::google::protobuf::RepeatedPtrField<::google::protobuf::FileDescriptorProto>*
CodeGeneratorRequest::_internal_mutable_proto_file() {
PROTOBUF_TSAN_READ_REPEATED(&_impl_._tsan_detect_race);
PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race);
return &_impl_.proto_file_;
}
@ -1417,7 +1417,7 @@ inline ::google::protobuf::FileDescriptorProto* CodeGeneratorRequest::mutable_so
inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::FileDescriptorProto >*
CodeGeneratorRequest::mutable_source_file_descriptors() {
// @@protoc_insertion_point(field_mutable_list:google.protobuf.compiler.CodeGeneratorRequest.source_file_descriptors)
PROTOBUF_TSAN_WRITE_REPEATED(&_impl_._tsan_detect_race);
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
return _internal_mutable_source_file_descriptors();
}
inline const ::google::protobuf::FileDescriptorProto& CodeGeneratorRequest::source_file_descriptors(int index) const {
@ -1425,7 +1425,7 @@ inline const ::google::protobuf::FileDescriptorProto& CodeGeneratorRequest::sour
return _internal_source_file_descriptors().Get(index);
}
inline ::google::protobuf::FileDescriptorProto* CodeGeneratorRequest::add_source_file_descriptors() {
PROTOBUF_TSAN_WRITE_REPEATED(&_impl_._tsan_detect_race);
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
::google::protobuf::FileDescriptorProto* _add = _internal_mutable_source_file_descriptors()->Add();
// @@protoc_insertion_point(field_add:google.protobuf.compiler.CodeGeneratorRequest.source_file_descriptors)
return _add;
@ -1437,12 +1437,12 @@ CodeGeneratorRequest::source_file_descriptors() const {
}
inline const ::google::protobuf::RepeatedPtrField<::google::protobuf::FileDescriptorProto>&
CodeGeneratorRequest::_internal_source_file_descriptors() const {
PROTOBUF_TSAN_READ_REPEATED(&_impl_._tsan_detect_race);
PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race);
return _impl_.source_file_descriptors_;
}
inline ::google::protobuf::RepeatedPtrField<::google::protobuf::FileDescriptorProto>*
CodeGeneratorRequest::_internal_mutable_source_file_descriptors() {
PROTOBUF_TSAN_READ_REPEATED(&_impl_._tsan_detect_race);
PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race);
return &_impl_.source_file_descriptors_;
}
@ -1457,7 +1457,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_MESSAGE(&_impl_._tsan_detect_race);
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_);
}
@ -1466,7 +1466,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_MESSAGE(&_impl_._tsan_detect_race);
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
if (GetArenaForAllocation() == nullptr) {
delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.compiler_version_);
}
@ -1479,7 +1479,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_MESSAGE(&_impl_._tsan_detect_race);
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_._has_bits_[0] &= ~0x00000002u;
::google::protobuf::compiler::Version* released = _impl_.compiler_version_;
@ -1498,7 +1498,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_MESSAGE(&_impl_._tsan_detect_race);
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
// @@protoc_insertion_point(field_release:google.protobuf.compiler.CodeGeneratorRequest.compiler_version)
_impl_._has_bits_[0] &= ~0x00000002u;
@ -1507,7 +1507,7 @@ inline ::google::protobuf::compiler::Version* CodeGeneratorRequest::unsafe_arena
return temp;
}
inline ::google::protobuf::compiler::Version* CodeGeneratorRequest::_internal_mutable_compiler_version() {
PROTOBUF_TSAN_WRITE_MESSAGE(&_impl_._tsan_detect_race);
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());
@ -1522,7 +1522,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_MESSAGE(&_impl_._tsan_detect_race);
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
if (message_arena == nullptr) {
delete reinterpret_cast<::google::protobuf::compiler::Version*>(_impl_.compiler_version_);
}
@ -1562,7 +1562,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_STRING(&_impl_._tsan_detect_race);
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)
@ -1573,21 +1573,21 @@ inline std::string* CodeGeneratorResponse_File::mutable_name() {
return _s;
}
inline const std::string& CodeGeneratorResponse_File::_internal_name() const {
PROTOBUF_TSAN_READ_STRING(&_impl_._tsan_detect_race);
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_STRING(&_impl_._tsan_detect_race);
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_STRING(&_impl_._tsan_detect_race);
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_STRING(&_impl_._tsan_detect_race);
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;
@ -1600,7 +1600,7 @@ inline std::string* CodeGeneratorResponse_File::release_name() {
return released;
}
inline void CodeGeneratorResponse_File::set_allocated_name(std::string* value) {
PROTOBUF_TSAN_WRITE_STRING(&_impl_._tsan_detect_race);
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
if (value != nullptr) {
_impl_._has_bits_[0] |= 0x00000001u;
} else {
@ -1631,7 +1631,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_STRING(&_impl_._tsan_detect_race);
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)
@ -1642,21 +1642,21 @@ inline std::string* CodeGeneratorResponse_File::mutable_insertion_point() {
return _s;
}
inline const std::string& CodeGeneratorResponse_File::_internal_insertion_point() const {
PROTOBUF_TSAN_READ_STRING(&_impl_._tsan_detect_race);
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_STRING(&_impl_._tsan_detect_race);
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_STRING(&_impl_._tsan_detect_race);
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_STRING(&_impl_._tsan_detect_race);
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;
@ -1669,7 +1669,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_STRING(&_impl_._tsan_detect_race);
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
if (value != nullptr) {
_impl_._has_bits_[0] |= 0x00000002u;
} else {
@ -1700,7 +1700,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_STRING(&_impl_._tsan_detect_race);
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)
@ -1711,21 +1711,21 @@ inline std::string* CodeGeneratorResponse_File::mutable_content() {
return _s;
}
inline const std::string& CodeGeneratorResponse_File::_internal_content() const {
PROTOBUF_TSAN_READ_STRING(&_impl_._tsan_detect_race);
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_STRING(&_impl_._tsan_detect_race);
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_STRING(&_impl_._tsan_detect_race);
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_STRING(&_impl_._tsan_detect_race);
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;
@ -1738,7 +1738,7 @@ inline std::string* CodeGeneratorResponse_File::release_content() {
return released;
}
inline void CodeGeneratorResponse_File::set_allocated_content(std::string* value) {
PROTOBUF_TSAN_WRITE_STRING(&_impl_._tsan_detect_race);
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
if (value != nullptr) {
_impl_._has_bits_[0] |= 0x00000004u;
} else {
@ -1760,7 +1760,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_MESSAGE(&_impl_._tsan_detect_race);
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_);
}
@ -1769,7 +1769,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_MESSAGE(&_impl_._tsan_detect_race);
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
if (GetArenaForAllocation() == nullptr) {
delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.generated_code_info_);
}
@ -1782,7 +1782,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_MESSAGE(&_impl_._tsan_detect_race);
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_._has_bits_[0] &= ~0x00000008u;
::google::protobuf::GeneratedCodeInfo* released = _impl_.generated_code_info_;
@ -1801,7 +1801,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_MESSAGE(&_impl_._tsan_detect_race);
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;
@ -1810,7 +1810,7 @@ inline ::google::protobuf::GeneratedCodeInfo* CodeGeneratorResponse_File::unsafe
return temp;
}
inline ::google::protobuf::GeneratedCodeInfo* CodeGeneratorResponse_File::_internal_mutable_generated_code_info() {
PROTOBUF_TSAN_WRITE_MESSAGE(&_impl_._tsan_detect_race);
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());
@ -1825,7 +1825,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_MESSAGE(&_impl_._tsan_detect_race);
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
if (message_arena == nullptr) {
delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.generated_code_info_);
}
@ -1865,7 +1865,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_STRING(&_impl_._tsan_detect_race);
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)
@ -1876,21 +1876,21 @@ inline std::string* CodeGeneratorResponse::mutable_error() {
return _s;
}
inline const std::string& CodeGeneratorResponse::_internal_error() const {
PROTOBUF_TSAN_READ_STRING(&_impl_._tsan_detect_race);
PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race);
return _impl_.error_.Get();
}
inline void CodeGeneratorResponse::_internal_set_error(const std::string& value) {
PROTOBUF_TSAN_WRITE_STRING(&_impl_._tsan_detect_race);
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_STRING(&_impl_._tsan_detect_race);
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_STRING(&_impl_._tsan_detect_race);
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;
@ -1903,7 +1903,7 @@ inline std::string* CodeGeneratorResponse::release_error() {
return released;
}
inline void CodeGeneratorResponse::set_allocated_error(std::string* value) {
PROTOBUF_TSAN_WRITE_STRING(&_impl_._tsan_detect_race);
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
if (value != nullptr) {
_impl_._has_bits_[0] |= 0x00000001u;
} else {
@ -1936,11 +1936,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_PRIMITIVE(&_impl_._tsan_detect_race);
PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race);
return _impl_.supported_features_;
}
inline void CodeGeneratorResponse::_internal_set_supported_features(::uint64_t value) {
PROTOBUF_TSAN_WRITE_PRIMITIVE(&_impl_._tsan_detect_race);
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_._has_bits_[0] |= 0x00000002u;
_impl_.supported_features_ = value;
}
@ -1962,7 +1962,7 @@ inline ::google::protobuf::compiler::CodeGeneratorResponse_File* CodeGeneratorRe
inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::compiler::CodeGeneratorResponse_File >*
CodeGeneratorResponse::mutable_file() {
// @@protoc_insertion_point(field_mutable_list:google.protobuf.compiler.CodeGeneratorResponse.file)
PROTOBUF_TSAN_WRITE_REPEATED(&_impl_._tsan_detect_race);
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
return _internal_mutable_file();
}
inline const ::google::protobuf::compiler::CodeGeneratorResponse_File& CodeGeneratorResponse::file(int index) const {
@ -1970,7 +1970,7 @@ inline const ::google::protobuf::compiler::CodeGeneratorResponse_File& CodeGener
return _internal_file().Get(index);
}
inline ::google::protobuf::compiler::CodeGeneratorResponse_File* CodeGeneratorResponse::add_file() {
PROTOBUF_TSAN_WRITE_REPEATED(&_impl_._tsan_detect_race);
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
::google::protobuf::compiler::CodeGeneratorResponse_File* _add = _internal_mutable_file()->Add();
// @@protoc_insertion_point(field_add:google.protobuf.compiler.CodeGeneratorResponse.file)
return _add;
@ -1982,12 +1982,12 @@ CodeGeneratorResponse::file() const {
}
inline const ::google::protobuf::RepeatedPtrField<::google::protobuf::compiler::CodeGeneratorResponse_File>&
CodeGeneratorResponse::_internal_file() const {
PROTOBUF_TSAN_READ_REPEATED(&_impl_._tsan_detect_race);
PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race);
return _impl_.file_;
}
inline ::google::protobuf::RepeatedPtrField<::google::protobuf::compiler::CodeGeneratorResponse_File>*
CodeGeneratorResponse::_internal_mutable_file() {
PROTOBUF_TSAN_READ_REPEATED(&_impl_._tsan_detect_race);
PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race);
return &_impl_.file_;
}

@ -271,11 +271,11 @@ inline void CppFeatures::set_legacy_closed_enum(bool value) {
// @@protoc_insertion_point(field_set:pb.CppFeatures.legacy_closed_enum)
}
inline bool CppFeatures::_internal_legacy_closed_enum() const {
PROTOBUF_TSAN_READ_PRIMITIVE(&_impl_._tsan_detect_race);
PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race);
return _impl_.legacy_closed_enum_;
}
inline void CppFeatures::_internal_set_legacy_closed_enum(bool value) {
PROTOBUF_TSAN_WRITE_PRIMITIVE(&_impl_._tsan_detect_race);
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_._has_bits_[0] |= 0x00000001u;
_impl_.legacy_closed_enum_ = value;
}

File diff suppressed because it is too large Load Diff

@ -860,16 +860,6 @@ static_assert(PROTOBUF_ABSL_MIN(20230125, 3),
#define PROTOBUF_TSAN_DECLARE_MEMBER
#endif
// TODO(b/280674214): cleanup these macros.
#define PROTOBUF_TSAN_READ_REPEATED(addr) PROTOBUF_TSAN_READ(addr)
#define PROTOBUF_TSAN_READ_PRIMITIVE(addr) PROTOBUF_TSAN_READ(addr)
#define PROTOBUF_TSAN_READ_STRING(addr) PROTOBUF_TSAN_READ(addr)
#define PROTOBUF_TSAN_READ_MESSAGE(addr) PROTOBUF_TSAN_READ(addr)
#define PROTOBUF_TSAN_WRITE_REPEATED(addr) PROTOBUF_TSAN_WRITE(addr)
#define PROTOBUF_TSAN_WRITE_PRIMITIVE(addr) PROTOBUF_TSAN_WRITE(addr)
#define PROTOBUF_TSAN_WRITE_STRING(addr) PROTOBUF_TSAN_WRITE(addr)
#define PROTOBUF_TSAN_WRITE_MESSAGE(addr) PROTOBUF_TSAN_WRITE(addr)
#ifdef PROTOBUF_USE_TABLE_PARSER_ON_REFLECTION
#error PROTOBUF_USE_TABLE_PARSER_ON_REFLECTION was previously defined
#endif

@ -106,14 +106,6 @@
#undef PROTOBUF_TSAN_DECLARE_MEMBER
#undef PROTOBUF_TSAN_READ
#undef PROTOBUF_TSAN_WRITE
#undef PROTOBUF_TSAN_READ_REPEATED
#undef PROTOBUF_TSAN_READ_PRIMITIVE
#undef PROTOBUF_TSAN_READ_STRING
#undef PROTOBUF_TSAN_READ_MESSAGE
#undef PROTOBUF_TSAN_WRITE_REPEATED
#undef PROTOBUF_TSAN_WRITE_PRIMITIVE
#undef PROTOBUF_TSAN_WRITE_STRING
#undef PROTOBUF_TSAN_WRITE_MESSAGE
#undef PROTOBUF_USE_TABLE_PARSER_ON_REFLECTION
#undef PROTOBUF_TC_PARAM_DECL
#undef PROTOBUF_EXCLUSIVE_LOCKS_REQUIRED

Loading…
Cancel
Save