Remove implementation related to lazy fields.

PiperOrigin-RevId: 691936133
pull/19078/head
Tony Liao 4 months ago committed by Copybara-Service
parent 3a40367686
commit 56580bd0d4
  1. 4
      src/google/protobuf/compiler/cpp/extension.cc
  2. 4
      src/google/protobuf/extension_set_heavy.cc
  3. 10
      src/google/protobuf/generated_message_reflection.cc

@ -229,9 +229,7 @@ void ExtensionGenerator::GenerateRegistration(io::Printer* p,
? absl::StrCat("&", message_type, "::InternalVerify") ? absl::StrCat("&", message_type, "::InternalVerify")
: "nullptr"}, : "nullptr"},
{"message_type", message_type}, {"message_type", message_type},
{"lazy", descriptor_->options().has_lazy() {"lazy", "kUndefined"}});
? descriptor_->options().lazy() ? "kLazy" : "kEager"
: "kUndefined"}});
if (using_implicit_weak_descriptors) { if (using_implicit_weak_descriptors) {
p->Emit( p->Emit(
{ {

@ -286,10 +286,6 @@ bool DescriptorPoolExtensionFinder::Find(int number, ExtensionInfo* output) {
<< "Extension factory's GetPrototype() returned nullptr; extension: " << "Extension factory's GetPrototype() returned nullptr; extension: "
<< extension->full_name(); << extension->full_name();
if (extension->options().has_lazy()) {
output->is_lazy = extension->options().lazy() ? LazyAnnotation::kLazy
: LazyAnnotation::kEager;
}
} else if (extension->cpp_type() == FieldDescriptor::CPPTYPE_ENUM) { } else if (extension->cpp_type() == FieldDescriptor::CPPTYPE_ENUM) {
output->enum_validity_check.func = ValidateEnumUsingDescriptor; output->enum_validity_check.func = ValidateEnumUsingDescriptor;
output->enum_validity_check.arg = extension->enum_type(); output->enum_validity_check.arg = extension->enum_type();

@ -356,20 +356,12 @@ bool Reflection::IsLazyExtension(const Message& message,
} }
bool Reflection::IsLazilyVerifiedLazyField(const FieldDescriptor* field) const { bool Reflection::IsLazilyVerifiedLazyField(const FieldDescriptor* field) const {
if (field->type() != FieldDescriptor::TYPE_MESSAGE || field->is_repeated()) {
return false; return false;
}
return field->options().unverified_lazy();
} }
bool Reflection::IsEagerlyVerifiedLazyField( bool Reflection::IsEagerlyVerifiedLazyField(
const FieldDescriptor* field) const { const FieldDescriptor* field) const {
if (field->type() != FieldDescriptor::TYPE_MESSAGE) return false; return false;
// Message fields with [lazy=true] will be eagerly verified
// (go/verified-lazy).
if (field->options().lazy() && !field->is_repeated()) return true;
return schema_.IsEagerlyVerifiedLazyField(field);
} }
internal::field_layout::TransformValidation Reflection::GetLazyStyle( internal::field_layout::TransformValidation Reflection::GetLazyStyle(

Loading…
Cancel
Save