[ObjC] Simplify root registry generation.

The the distinction in the output isn't worth it.

PiperOrigin-RevId: 556828871
pull/13507/head
Thomas Van Lenten 2 years ago committed by Copybara-Service
parent bd9d6895c3
commit 740d314166
  1. 4
      objectivec/GPBAny.pbobjc.m
  2. 4
      objectivec/GPBApi.pbobjc.m
  3. 4
      objectivec/GPBDuration.pbobjc.m
  4. 4
      objectivec/GPBEmpty.pbobjc.m
  5. 4
      objectivec/GPBFieldMask.pbobjc.m
  6. 4
      objectivec/GPBSourceContext.pbobjc.m
  7. 4
      objectivec/GPBStruct.pbobjc.m
  8. 4
      objectivec/GPBTimestamp.pbobjc.m
  9. 4
      objectivec/GPBType.pbobjc.m
  10. 4
      objectivec/GPBWrappers.pbobjc.m
  11. 15
      src/google/protobuf/compiler/objectivec/file.cc

@ -28,8 +28,8 @@ GPBObjCClassDeclaration(GPBAny);
@implementation GPBAnyRoot
// No extensions in the file and no imports, so no need to generate
// +extensionRegistry.
// No extensions in the file and no imports or none of the imports (direct or
// indirect) defined extensions, so no need to generate +extensionRegistry.
@end

@ -32,8 +32,8 @@ GPBObjCClassDeclaration(GPBSourceContext);
@implementation GPBApiRoot
// No extensions in the file and none of the imports (direct or indirect)
// defined extensions, so no need to generate +extensionRegistry.
// No extensions in the file and no imports or none of the imports (direct or
// indirect) defined extensions, so no need to generate +extensionRegistry.
@end

@ -28,8 +28,8 @@ GPBObjCClassDeclaration(GPBDuration);
@implementation GPBDurationRoot
// No extensions in the file and no imports, so no need to generate
// +extensionRegistry.
// No extensions in the file and no imports or none of the imports (direct or
// indirect) defined extensions, so no need to generate +extensionRegistry.
@end

@ -28,8 +28,8 @@ GPBObjCClassDeclaration(GPBEmpty);
@implementation GPBEmptyRoot
// No extensions in the file and no imports, so no need to generate
// +extensionRegistry.
// No extensions in the file and no imports or none of the imports (direct or
// indirect) defined extensions, so no need to generate +extensionRegistry.
@end

@ -28,8 +28,8 @@ GPBObjCClassDeclaration(GPBFieldMask);
@implementation GPBFieldMaskRoot
// No extensions in the file and no imports, so no need to generate
// +extensionRegistry.
// No extensions in the file and no imports or none of the imports (direct or
// indirect) defined extensions, so no need to generate +extensionRegistry.
@end

@ -28,8 +28,8 @@ GPBObjCClassDeclaration(GPBSourceContext);
@implementation GPBSourceContextRoot
// No extensions in the file and no imports, so no need to generate
// +extensionRegistry.
// No extensions in the file and no imports or none of the imports (direct or
// indirect) defined extensions, so no need to generate +extensionRegistry.
@end

@ -33,8 +33,8 @@ GPBObjCClassDeclaration(GPBValue);
@implementation GPBStructRoot
// No extensions in the file and no imports, so no need to generate
// +extensionRegistry.
// No extensions in the file and no imports or none of the imports (direct or
// indirect) defined extensions, so no need to generate +extensionRegistry.
@end

@ -28,8 +28,8 @@ GPBObjCClassDeclaration(GPBTimestamp);
@implementation GPBTimestampRoot
// No extensions in the file and no imports, so no need to generate
// +extensionRegistry.
// No extensions in the file and no imports or none of the imports (direct or
// indirect) defined extensions, so no need to generate +extensionRegistry.
@end

@ -36,8 +36,8 @@ GPBObjCClassDeclaration(GPBType);
@implementation GPBTypeRoot
// No extensions in the file and none of the imports (direct or indirect)
// defined extensions, so no need to generate +extensionRegistry.
// No extensions in the file and no imports or none of the imports (direct or
// indirect) defined extensions, so no need to generate +extensionRegistry.
@end

@ -36,8 +36,8 @@ GPBObjCClassDeclaration(GPBUInt64Value);
@implementation GPBWrappersRoot
// No extensions in the file and no imports, so no need to generate
// +extensionRegistry.
// No extensions in the file and no imports or none of the imports (direct or
// indirect) defined extensions, so no need to generate +extensionRegistry.
@end

@ -629,17 +629,10 @@ void FileGenerator::EmitRootImplementation(
// output a registry to override to create the file specific
// registry.
if (extension_generators_.empty() && deps_with_extensions.empty()) {
if (file_->dependency_count() == 0) {
p->Emit(R"objc(
// No extensions in the file and no imports, so no need to generate
// +extensionRegistry.
)objc");
} else {
p->Emit(R"objc(
// No extensions in the file and none of the imports (direct or indirect)
// defined extensions, so no need to generate +extensionRegistry.
)objc");
}
p->Emit(R"objc(
// No extensions in the file and no imports or none of the imports (direct or
// indirect) defined extensions, so no need to generate +extensionRegistry.
)objc");
} else {
EmitRootExtensionRegistryImplementation(p, deps_with_extensions);
}

Loading…
Cancel
Save