diff --git a/Directory.Build.props b/Directory.Build.props index 46e86dd04..189468809 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,6 +1,5 @@ - IDE2000 $(NoWarn);NU1510 diff --git a/ICSharpCode.Decompiler/ICSharpCode.Decompiler.csproj b/ICSharpCode.Decompiler/ICSharpCode.Decompiler.csproj index e77212602..3ecc483e8 100644 --- a/ICSharpCode.Decompiler/ICSharpCode.Decompiler.csproj +++ b/ICSharpCode.Decompiler/ICSharpCode.Decompiler.csproj @@ -28,7 +28,7 @@ False false - 11 + 13 true True ICSharpCode.Decompiler.snk diff --git a/ICSharpCode.Decompiler/IL/Instructions.cs b/ICSharpCode.Decompiler/IL/Instructions.cs index 4094f9c9e..3bdf53ecd 100644 --- a/ICSharpCode.Decompiler/IL/Instructions.cs +++ b/ICSharpCode.Decompiler/IL/Instructions.cs @@ -3732,10 +3732,10 @@ namespace ICSharpCode.Decompiler.IL /// Load address of instance field public sealed partial class LdFlda : ILInstruction, IInstructionWithFieldOperand { - public LdFlda(ILInstruction target, IField field) : base(OpCode.LdFlda) + public LdFlda(ILInstruction target, IField @field) : base(OpCode.LdFlda) { this.Target = target; - this.field = field; + this.@field = @field; } public static readonly SlotInfo TargetSlot = new SlotInfo("Target", canInlineInto: true); ILInstruction target = null!; @@ -3788,9 +3788,9 @@ namespace ICSharpCode.Decompiler.IL return clone; } public bool DelayExceptions; // NullReferenceException/IndexOutOfBoundsException only occurs when the reference is dereferenced - readonly IField field; + readonly IField @field; /// Returns the field operand. - public IField Field { get { return field; } } + public IField Field { get { return @field; } } public override StackType ResultType { get { return target.ResultType.IsIntegerType() ? StackType.I : StackType.Ref; } } protected override InstructionFlags ComputeFlags() { @@ -3808,7 +3808,7 @@ namespace ICSharpCode.Decompiler.IL output.Write("delayex."); output.Write(OpCode); output.Write(' '); - field.WriteTo(output); + @field.WriteTo(output); output.Write('('); this.target.WriteTo(output, options); output.Write(')'); @@ -3828,7 +3828,7 @@ namespace ICSharpCode.Decompiler.IL protected internal override bool PerformMatch(ILInstruction? other, ref Patterns.Match match) { var o = other as LdFlda; - return o != null && this.target.PerformMatch(o.target, ref match) && DelayExceptions == o.DelayExceptions && field.Equals(o.field); + return o != null && this.target.PerformMatch(o.target, ref match) && DelayExceptions == o.DelayExceptions && @field.Equals(o.@field); } } } @@ -3837,20 +3837,20 @@ namespace ICSharpCode.Decompiler.IL /// Load static field address public sealed partial class LdsFlda : SimpleInstruction, IInstructionWithFieldOperand { - public LdsFlda(IField field) : base(OpCode.LdsFlda) + public LdsFlda(IField @field) : base(OpCode.LdsFlda) { - this.field = field; + this.@field = @field; } public override StackType ResultType { get { return StackType.Ref; } } - readonly IField field; + readonly IField @field; /// Returns the field operand. - public IField Field { get { return field; } } + public IField Field { get { return @field; } } public override void WriteTo(ITextOutput output, ILAstWritingOptions options) { WriteILRange(output, options); output.Write(OpCode); output.Write(' '); - field.WriteTo(output); + @field.WriteTo(output); } public override void AcceptVisitor(ILVisitor visitor) { @@ -3867,7 +3867,7 @@ namespace ICSharpCode.Decompiler.IL protected internal override bool PerformMatch(ILInstruction? other, ref Patterns.Match match) { var o = other as LdsFlda; - return o != null && field.Equals(o.field); + return o != null && @field.Equals(o.@field); } } } @@ -8789,28 +8789,28 @@ namespace ICSharpCode.Decompiler.IL size = default(ILInstruction); return false; } - public bool MatchLdFlda([NotNullWhen(true)] out ILInstruction? target, [NotNullWhen(true)] out IField? field) + public bool MatchLdFlda([NotNullWhen(true)] out ILInstruction? target, [NotNullWhen(true)] out IField? @field) { var inst = this as LdFlda; if (inst != null) { target = inst.Target; - field = inst.Field; + @field = inst.Field; return true; } target = default(ILInstruction); - field = default(IField); + @field = default(IField); return false; } - public bool MatchLdsFlda([NotNullWhen(true)] out IField? field) + public bool MatchLdsFlda([NotNullWhen(true)] out IField? @field) { var inst = this as LdsFlda; if (inst != null) { - field = inst.Field; + @field = inst.Field; return true; } - field = default(IField); + @field = default(IField); return false; } public bool MatchCastClass([NotNullWhen(true)] out ILInstruction? argument, [NotNullWhen(true)] out IType? type) diff --git a/ICSharpCode.Decompiler/IL/Instructions.tt b/ICSharpCode.Decompiler/IL/Instructions.tt index 8c2a5bf5e..071548ab3 100644 --- a/ICSharpCode.Decompiler/IL/Instructions.tt +++ b/ICSharpCode.Decompiler/IL/Instructions.tt @@ -1081,16 +1081,16 @@ protected override void Disconnected() } static Action HasFieldOperand = opCode => { - opCode.ConstructorParameters.Add("IField field"); - opCode.Members.Add("readonly IField field;"); - opCode.ConstructorBody.Add("this.field = field;"); - opCode.MatchParameters.Add(new MatchParamInfo { TypeName = "IField", Name = "field", FieldName = "Field" }); - opCode.PerformMatchConditions.Add("field.Equals(o.field)"); + opCode.ConstructorParameters.Add("IField @field"); + opCode.Members.Add("readonly IField @field;"); + opCode.ConstructorBody.Add("this.@field = @field;"); + opCode.MatchParameters.Add(new MatchParamInfo { TypeName = "IField", Name = "@field", FieldName = "Field" }); + opCode.PerformMatchConditions.Add("@field.Equals(o.@field)"); opCode.Members.Add("/// Returns the field operand." + Environment.NewLine - + "public IField Field { get { return field; } }"); + + "public IField Field { get { return @field; } }"); opCode.GenerateWriteTo = true; opCode.WriteOperand.Add("output.Write(' ');"); - opCode.WriteOperand.Add("field.WriteTo(output);"); + opCode.WriteOperand.Add("@field.WriteTo(output);"); opCode.Interfaces.Add("IInstructionWithFieldOperand"); };