Browse Source

Remove WriteGeneratedTypeAttributes which is a no-op

This does not affect the generated code.
If we decide we want to apply attributes to generated types, we should start by
just reverting this change.
Jon Skeet 9 năm trước cách đây
mục cha
commit
e9a7fc837f

+ 0 - 1
src/google/protobuf/compiler/csharp/csharp_enum.cc

@@ -60,7 +60,6 @@ EnumGenerator::~EnumGenerator() {
 
 void EnumGenerator::Generate(io::Printer* printer) {
   WriteEnumDocComment(printer, descriptor_);
-  WriteGeneratedTypeAttributes(printer);
   printer->Print("$access_level$ enum $name$ {\n",
                  "access_level", class_access_level(),
                  "name", descriptor_->name());

+ 0 - 1
src/google/protobuf/compiler/csharp/csharp_message.cc

@@ -104,7 +104,6 @@ void MessageGenerator::Generate(io::Printer* printer) {
   vars["access_level"] = class_access_level();
 
   WriteMessageDocComment(printer, descriptor_);
-  WriteGeneratedTypeAttributes(printer);
   printer->Print(
     vars,
     "$access_level$ sealed partial class $class_name$ : pb::IMessage<$class_name$> {\n");

+ 2 - 4
src/google/protobuf/compiler/csharp/csharp_reflection_class.cc

@@ -122,12 +122,10 @@ void ReflectionClassGenerator::WriteIntroduction(io::Printer* printer) {
   }
 
   printer->Print(
-    "/// <summary>Holder for reflection information generated from $file_name$</summary>\n",
-    "file_name", file_->name());
-  WriteGeneratedTypeAttributes(printer);
-  printer->Print(
+    "/// <summary>Holder for reflection information generated from $file_name$</summary>\n"
     "$access_level$ static partial class $reflection_class_name$ {\n"
     "\n",
+    "file_name", file_->name(),
     "access_level", class_access_level(),
     "reflection_class_name", reflectionClassname_);
   printer->Indent();

+ 0 - 4
src/google/protobuf/compiler/csharp/csharp_source_generator_base.cc

@@ -59,10 +59,6 @@ void SourceGeneratorBase::WriteGeneratedCodeAttributes(io::Printer* printer) {
   printer->Print("[global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n");
 }
 
-void SourceGeneratorBase::WriteGeneratedTypeAttributes(io::Printer* printer) {
-  // This hook can be used to reintroduce generated code attributes in the future.
-}
-
 std::string SourceGeneratorBase::class_access_level() {
   return (IsDescriptorProto(descriptor_) || this->options()->internal_access) ? "internal" : "public";
 }

+ 0 - 3
src/google/protobuf/compiler/csharp/csharp_source_generator_base.h

@@ -53,9 +53,6 @@ class SourceGeneratorBase {
   // Write any attributes used to decorate generated function members (methods and properties).
   // Should not be used to decorate types.
   void WriteGeneratedCodeAttributes(io::Printer* printer);
-  // Write any attributes used to decorate generated types.
-  // Should not be used to decorate function members.
-  void WriteGeneratedTypeAttributes(io::Printer* printer);
 
  private:
   const FileDescriptor* descriptor_;