From 9ba7d1c03810b47e535018d0362a8affef6f7f56 Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Wed, 12 Apr 2017 13:55:29 +0200 Subject: C++: Do not forward-declare dependencies in generated .h files --- src/google/protobuf/api.pb.h | 18 ------- src/google/protobuf/compiler/cpp/cpp_file.cc | 8 --- src/google/protobuf/compiler/plugin.pb.h | 75 ---------------------------- src/google/protobuf/type.pb.h | 6 --- 4 files changed, 107 deletions(-) (limited to 'src/google') diff --git a/src/google/protobuf/api.pb.h b/src/google/protobuf/api.pb.h index 108c63a4..729e4ad1 100644 --- a/src/google/protobuf/api.pb.h +++ b/src/google/protobuf/api.pb.h @@ -37,30 +37,12 @@ namespace protobuf { class Api; class ApiDefaultTypeInternal; LIBPROTOBUF_EXPORT extern ApiDefaultTypeInternal _Api_default_instance_; -class Enum; -class EnumDefaultTypeInternal; -LIBPROTOBUF_EXPORT extern EnumDefaultTypeInternal _Enum_default_instance_; -class EnumValue; -class EnumValueDefaultTypeInternal; -LIBPROTOBUF_EXPORT extern EnumValueDefaultTypeInternal _EnumValue_default_instance_; -class Field; -class FieldDefaultTypeInternal; -LIBPROTOBUF_EXPORT extern FieldDefaultTypeInternal _Field_default_instance_; class Method; class MethodDefaultTypeInternal; LIBPROTOBUF_EXPORT extern MethodDefaultTypeInternal _Method_default_instance_; class Mixin; class MixinDefaultTypeInternal; LIBPROTOBUF_EXPORT extern MixinDefaultTypeInternal _Mixin_default_instance_; -class Option; -class OptionDefaultTypeInternal; -LIBPROTOBUF_EXPORT extern OptionDefaultTypeInternal _Option_default_instance_; -class SourceContext; -class SourceContextDefaultTypeInternal; -LIBPROTOBUF_EXPORT extern SourceContextDefaultTypeInternal _SourceContext_default_instance_; -class Type; -class TypeDefaultTypeInternal; -LIBPROTOBUF_EXPORT extern TypeDefaultTypeInternal _Type_default_instance_; } // namespace protobuf } // namespace google diff --git a/src/google/protobuf/compiler/cpp/cpp_file.cc b/src/google/protobuf/compiler/cpp/cpp_file.cc index e0542ae8..1f7a66c5 100644 --- a/src/google/protobuf/compiler/cpp/cpp_file.cc +++ b/src/google/protobuf/compiler/cpp/cpp_file.cc @@ -925,19 +925,11 @@ void FileGenerator::GenerateNamespaceClosers(io::Printer* printer) { void FileGenerator::GenerateForwardDeclarations(io::Printer* printer) { ForwardDeclarations decls; - for (int i = 0; i < file_->dependency_count(); i++) { - FileGenerator dependency(file_->dependency(i), options_); - dependency.FillForwardDeclarations(&decls); - } FillForwardDeclarations(&decls); decls.Print(printer, options_); } void FileGenerator::FillForwardDeclarations(ForwardDeclarations* decls) { - for (int i = 0; i < file_->public_dependency_count(); i++) { - FileGenerator dependency(file_->public_dependency(i), options_); - dependency.FillForwardDeclarations(decls); - } for (int i = 0; i < package_parts_.size(); i++) { decls = decls->AddOrGetNamespace(package_parts_[i]); } diff --git a/src/google/protobuf/compiler/plugin.pb.h b/src/google/protobuf/compiler/plugin.pb.h index 4f8befb6..c8ae8774 100644 --- a/src/google/protobuf/compiler/plugin.pb.h +++ b/src/google/protobuf/compiler/plugin.pb.h @@ -39,81 +39,6 @@ #endif namespace google { namespace protobuf { -class DescriptorProto; -class DescriptorProtoDefaultTypeInternal; -LIBPROTOC_EXPORT extern DescriptorProtoDefaultTypeInternal _DescriptorProto_default_instance_; -class DescriptorProto_ExtensionRange; -class DescriptorProto_ExtensionRangeDefaultTypeInternal; -LIBPROTOC_EXPORT extern DescriptorProto_ExtensionRangeDefaultTypeInternal _DescriptorProto_ExtensionRange_default_instance_; -class DescriptorProto_ReservedRange; -class DescriptorProto_ReservedRangeDefaultTypeInternal; -LIBPROTOC_EXPORT extern DescriptorProto_ReservedRangeDefaultTypeInternal _DescriptorProto_ReservedRange_default_instance_; -class EnumDescriptorProto; -class EnumDescriptorProtoDefaultTypeInternal; -LIBPROTOC_EXPORT extern EnumDescriptorProtoDefaultTypeInternal _EnumDescriptorProto_default_instance_; -class EnumOptions; -class EnumOptionsDefaultTypeInternal; -LIBPROTOC_EXPORT extern EnumOptionsDefaultTypeInternal _EnumOptions_default_instance_; -class EnumValueDescriptorProto; -class EnumValueDescriptorProtoDefaultTypeInternal; -LIBPROTOC_EXPORT extern EnumValueDescriptorProtoDefaultTypeInternal _EnumValueDescriptorProto_default_instance_; -class EnumValueOptions; -class EnumValueOptionsDefaultTypeInternal; -LIBPROTOC_EXPORT extern EnumValueOptionsDefaultTypeInternal _EnumValueOptions_default_instance_; -class FieldDescriptorProto; -class FieldDescriptorProtoDefaultTypeInternal; -LIBPROTOC_EXPORT extern FieldDescriptorProtoDefaultTypeInternal _FieldDescriptorProto_default_instance_; -class FieldOptions; -class FieldOptionsDefaultTypeInternal; -LIBPROTOC_EXPORT extern FieldOptionsDefaultTypeInternal _FieldOptions_default_instance_; -class FileDescriptorProto; -class FileDescriptorProtoDefaultTypeInternal; -LIBPROTOC_EXPORT extern FileDescriptorProtoDefaultTypeInternal _FileDescriptorProto_default_instance_; -class FileDescriptorSet; -class FileDescriptorSetDefaultTypeInternal; -LIBPROTOC_EXPORT extern FileDescriptorSetDefaultTypeInternal _FileDescriptorSet_default_instance_; -class FileOptions; -class FileOptionsDefaultTypeInternal; -LIBPROTOC_EXPORT extern FileOptionsDefaultTypeInternal _FileOptions_default_instance_; -class GeneratedCodeInfo; -class GeneratedCodeInfoDefaultTypeInternal; -LIBPROTOC_EXPORT extern GeneratedCodeInfoDefaultTypeInternal _GeneratedCodeInfo_default_instance_; -class GeneratedCodeInfo_Annotation; -class GeneratedCodeInfo_AnnotationDefaultTypeInternal; -LIBPROTOC_EXPORT extern GeneratedCodeInfo_AnnotationDefaultTypeInternal _GeneratedCodeInfo_Annotation_default_instance_; -class MessageOptions; -class MessageOptionsDefaultTypeInternal; -LIBPROTOC_EXPORT extern MessageOptionsDefaultTypeInternal _MessageOptions_default_instance_; -class MethodDescriptorProto; -class MethodDescriptorProtoDefaultTypeInternal; -LIBPROTOC_EXPORT extern MethodDescriptorProtoDefaultTypeInternal _MethodDescriptorProto_default_instance_; -class MethodOptions; -class MethodOptionsDefaultTypeInternal; -LIBPROTOC_EXPORT extern MethodOptionsDefaultTypeInternal _MethodOptions_default_instance_; -class OneofDescriptorProto; -class OneofDescriptorProtoDefaultTypeInternal; -LIBPROTOC_EXPORT extern OneofDescriptorProtoDefaultTypeInternal _OneofDescriptorProto_default_instance_; -class OneofOptions; -class OneofOptionsDefaultTypeInternal; -LIBPROTOC_EXPORT extern OneofOptionsDefaultTypeInternal _OneofOptions_default_instance_; -class ServiceDescriptorProto; -class ServiceDescriptorProtoDefaultTypeInternal; -LIBPROTOC_EXPORT extern ServiceDescriptorProtoDefaultTypeInternal _ServiceDescriptorProto_default_instance_; -class ServiceOptions; -class ServiceOptionsDefaultTypeInternal; -LIBPROTOC_EXPORT extern ServiceOptionsDefaultTypeInternal _ServiceOptions_default_instance_; -class SourceCodeInfo; -class SourceCodeInfoDefaultTypeInternal; -LIBPROTOC_EXPORT extern SourceCodeInfoDefaultTypeInternal _SourceCodeInfo_default_instance_; -class SourceCodeInfo_Location; -class SourceCodeInfo_LocationDefaultTypeInternal; -LIBPROTOC_EXPORT extern SourceCodeInfo_LocationDefaultTypeInternal _SourceCodeInfo_Location_default_instance_; -class UninterpretedOption; -class UninterpretedOptionDefaultTypeInternal; -LIBPROTOC_EXPORT extern UninterpretedOptionDefaultTypeInternal _UninterpretedOption_default_instance_; -class UninterpretedOption_NamePart; -class UninterpretedOption_NamePartDefaultTypeInternal; -LIBPROTOC_EXPORT extern UninterpretedOption_NamePartDefaultTypeInternal _UninterpretedOption_NamePart_default_instance_; namespace compiler { class CodeGeneratorRequest; class CodeGeneratorRequestDefaultTypeInternal; diff --git a/src/google/protobuf/type.pb.h b/src/google/protobuf/type.pb.h index c1cd4164..5ac80bb9 100644 --- a/src/google/protobuf/type.pb.h +++ b/src/google/protobuf/type.pb.h @@ -35,9 +35,6 @@ // @@protoc_insertion_point(includes) namespace google { namespace protobuf { -class Any; -class AnyDefaultTypeInternal; -LIBPROTOBUF_EXPORT extern AnyDefaultTypeInternal _Any_default_instance_; class Enum; class EnumDefaultTypeInternal; LIBPROTOBUF_EXPORT extern EnumDefaultTypeInternal _Enum_default_instance_; @@ -50,9 +47,6 @@ LIBPROTOBUF_EXPORT extern FieldDefaultTypeInternal _Field_default_instance_; class Option; class OptionDefaultTypeInternal; LIBPROTOBUF_EXPORT extern OptionDefaultTypeInternal _Option_default_instance_; -class SourceContext; -class SourceContextDefaultTypeInternal; -LIBPROTOBUF_EXPORT extern SourceContextDefaultTypeInternal _SourceContext_default_instance_; class Type; class TypeDefaultTypeInternal; LIBPROTOBUF_EXPORT extern TypeDefaultTypeInternal _Type_default_instance_; -- cgit v1.2.3