Skip to content

Commit

Permalink
Merge pull request #8594 from jtattermusch/csharp_mark_generated_code
Browse files Browse the repository at this point in the history
Mark C# generated code with System.CodeDom.Compiler.GeneratedCode as well
  • Loading branch information
jtattermusch authored May 11, 2021
2 parents 465acaa + 829b201 commit a84686c
Show file tree
Hide file tree
Showing 33 changed files with 6,584 additions and 0 deletions.
57 changes: 57 additions & 0 deletions csharp/src/AddressBook/Addressbook.cs

Large diffs are not rendered by default.

93 changes: 93 additions & 0 deletions csharp/src/Google.Protobuf.Benchmarks/BenchmarkMessage1Proto3.cs

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions csharp/src/Google.Protobuf.Benchmarks/Benchmarks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,26 +46,31 @@ public sealed partial class BenchmarkDataset : pb::IMessage<BenchmarkDataset>
private static readonly pb::MessageParser<BenchmarkDataset> _parser = new pb::MessageParser<BenchmarkDataset>(() => new BenchmarkDataset());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public static pb::MessageParser<BenchmarkDataset> Parser { get { return _parser; } }

[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public static pbr::MessageDescriptor Descriptor {
get { return global::Benchmarks.BenchmarksReflection.Descriptor.MessageTypes[0]; }
}

[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}

[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public BenchmarkDataset() {
OnConstruction();
}

partial void OnConstruction();

[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public BenchmarkDataset(BenchmarkDataset other) : this() {
name_ = other.name_;
messageName_ = other.messageName_;
Expand All @@ -74,6 +79,7 @@ public BenchmarkDataset(BenchmarkDataset other) : this() {
}

[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public BenchmarkDataset Clone() {
return new BenchmarkDataset(this);
}
Expand All @@ -86,6 +92,7 @@ public BenchmarkDataset Clone() {
/// Should only contain word characters: [a-zA-Z0-9_]
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public string Name {
get { return name_; }
set {
Expand All @@ -106,6 +113,7 @@ public string Name {
/// in those files.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public string MessageName {
get { return messageName_; }
set {
Expand Down Expand Up @@ -134,16 +142,19 @@ public string MessageName {
/// good branch prediction performance.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public pbc::RepeatedField<pb::ByteString> Payload {
get { return payload_; }
}

[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override bool Equals(object other) {
return Equals(other as BenchmarkDataset);
}

[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public bool Equals(BenchmarkDataset other) {
if (ReferenceEquals(other, null)) {
return false;
Expand All @@ -158,6 +169,7 @@ public bool Equals(BenchmarkDataset other) {
}

[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override int GetHashCode() {
int hash = 1;
if (Name.Length != 0) hash ^= Name.GetHashCode();
Expand All @@ -170,11 +182,13 @@ public override int GetHashCode() {
}

[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}

[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void WriteTo(pb::CodedOutputStream output) {
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
output.WriteRawMessage(this);
Expand All @@ -196,6 +210,7 @@ public void WriteTo(pb::CodedOutputStream output) {

#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
if (Name.Length != 0) {
output.WriteRawTag(10);
Expand All @@ -213,6 +228,7 @@ public void WriteTo(pb::CodedOutputStream output) {
#endif

[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public int CalculateSize() {
int size = 0;
if (Name.Length != 0) {
Expand All @@ -229,6 +245,7 @@ public int CalculateSize() {
}

[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void MergeFrom(BenchmarkDataset other) {
if (other == null) {
return;
Expand All @@ -244,6 +261,7 @@ public void MergeFrom(BenchmarkDataset other) {
}

[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void MergeFrom(pb::CodedInputStream input) {
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
input.ReadRawMessage(this);
Expand Down Expand Up @@ -273,6 +291,7 @@ public void MergeFrom(pb::CodedInputStream input) {

#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
Expand Down
Loading

0 comments on commit a84686c

Please sign in to comment.