From 56580bd0d48016de501649a3b1ffd50cfa64e507 Mon Sep 17 00:00:00 2001 From: Tony Liao Date: Thu, 31 Oct 2024 14:27:37 -0700 Subject: [PATCH] Remove implementation related to lazy fields. PiperOrigin-RevId: 691936133 --- src/google/protobuf/compiler/cpp/extension.cc | 4 +--- src/google/protobuf/extension_set_heavy.cc | 4 ---- src/google/protobuf/generated_message_reflection.cc | 12 ++---------- 3 files changed, 3 insertions(+), 17 deletions(-) diff --git a/src/google/protobuf/compiler/cpp/extension.cc b/src/google/protobuf/compiler/cpp/extension.cc index 87a3a2cd3f..6dab8fdb96 100644 --- a/src/google/protobuf/compiler/cpp/extension.cc +++ b/src/google/protobuf/compiler/cpp/extension.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( { diff --git a/src/google/protobuf/extension_set_heavy.cc b/src/google/protobuf/extension_set_heavy.cc index 96d363e2ab..36e94d95e1 100644 --- a/src/google/protobuf/extension_set_heavy.cc +++ b/src/google/protobuf/extension_set_heavy.cc @@ -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(); diff --git a/src/google/protobuf/generated_message_reflection.cc b/src/google/protobuf/generated_message_reflection.cc index 6e13104afd..baf77078f6 100644 --- a/src/google/protobuf/generated_message_reflection.cc +++ b/src/google/protobuf/generated_message_reflection.cc @@ -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(