Remove implementation related to lazy fields.

PiperOrigin-RevId: 691936133
pull/19078/head
Tony Liao 4 weeks 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. 12
      src/google/protobuf/generated_message_reflection.cc

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

@ -286,10 +286,6 @@ bool DescriptorPoolExtensionFinder::Find(int number, ExtensionInfo* output) {
<< "Extension factory's GetPrototype() returned nullptr; extension: "
<< 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) {
output->enum_validity_check.func = ValidateEnumUsingDescriptor;
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 {
if (field->type() != FieldDescriptor::TYPE_MESSAGE || field->is_repeated()) {
return false;
}
return field->options().unverified_lazy();
return false;
}
bool Reflection::IsEagerlyVerifiedLazyField(
const FieldDescriptor* field) const {
if (field->type() != FieldDescriptor::TYPE_MESSAGE) 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);
return false;
}
internal::field_layout::TransformValidation Reflection::GetLazyStyle(

Loading…
Cancel
Save