aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Skeet <jonskeet@google.com>2016-07-07 07:14:51 +0100
committerJon Skeet <jonskeet@google.com>2016-07-07 20:20:42 +0100
commite9a7fc837feb8fc663d64e67c5291a711b3ba376 (patch)
tree03d19d82fc75c11e6e01253f11a1dc7ad581c583
parentc53484539c691a717ad531081e6fbed7fd4ea192 (diff)
downloadprotobuf-e9a7fc837feb8fc663d64e67c5291a711b3ba376.tar.gz
protobuf-e9a7fc837feb8fc663d64e67c5291a711b3ba376.tar.bz2
protobuf-e9a7fc837feb8fc663d64e67c5291a711b3ba376.zip
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.
-rw-r--r--src/google/protobuf/compiler/csharp/csharp_enum.cc1
-rw-r--r--src/google/protobuf/compiler/csharp/csharp_message.cc1
-rw-r--r--src/google/protobuf/compiler/csharp/csharp_reflection_class.cc6
-rw-r--r--src/google/protobuf/compiler/csharp/csharp_source_generator_base.cc4
-rw-r--r--src/google/protobuf/compiler/csharp/csharp_source_generator_base.h3
5 files changed, 2 insertions, 13 deletions
diff --git a/src/google/protobuf/compiler/csharp/csharp_enum.cc b/src/google/protobuf/compiler/csharp/csharp_enum.cc
index ba61c4c7..64381d0f 100644
--- a/src/google/protobuf/compiler/csharp/csharp_enum.cc
+++ b/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());
diff --git a/src/google/protobuf/compiler/csharp/csharp_message.cc b/src/google/protobuf/compiler/csharp/csharp_message.cc
index 4c3ec6bd..ed744854 100644
--- a/src/google/protobuf/compiler/csharp/csharp_message.cc
+++ b/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");
diff --git a/src/google/protobuf/compiler/csharp/csharp_reflection_class.cc b/src/google/protobuf/compiler/csharp/csharp_reflection_class.cc
index df7ea11b..bac9aef7 100644
--- a/src/google/protobuf/compiler/csharp/csharp_reflection_class.cc
+++ b/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();
diff --git a/src/google/protobuf/compiler/csharp/csharp_source_generator_base.cc b/src/google/protobuf/compiler/csharp/csharp_source_generator_base.cc
index d8ef2d2e..1fda7ddf 100644
--- a/src/google/protobuf/compiler/csharp/csharp_source_generator_base.cc
+++ b/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";
}
diff --git a/src/google/protobuf/compiler/csharp/csharp_source_generator_base.h b/src/google/protobuf/compiler/csharp/csharp_source_generator_base.h
index 9cfe5c69..c741080e 100644
--- a/src/google/protobuf/compiler/csharp/csharp_source_generator_base.h
+++ b/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_;