Skip to content

Commit

Permalink
[ObjC] Simplify root registry generation.
Browse files Browse the repository at this point in the history
The the distinction in the output isn't worth it.

PiperOrigin-RevId: 556828871
  • Loading branch information
thomasvl authored and copybara-github committed Aug 14, 2023
1 parent bd9d689 commit 740d314
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 31 deletions.
4 changes: 2 additions & 2 deletions objectivec/GPBAny.pbobjc.m

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions objectivec/GPBApi.pbobjc.m

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions objectivec/GPBDuration.pbobjc.m

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions objectivec/GPBEmpty.pbobjc.m

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions objectivec/GPBFieldMask.pbobjc.m

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions objectivec/GPBSourceContext.pbobjc.m

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions objectivec/GPBStruct.pbobjc.m

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions objectivec/GPBTimestamp.pbobjc.m

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions objectivec/GPBType.pbobjc.m

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions objectivec/GPBWrappers.pbobjc.m

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 4 additions & 11 deletions src/google/protobuf/compiler/objectivec/file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 740d314

Please sign in to comment.