Browse Source

Add IInstructionWithMethodOperand for LdFtn and LdVirtFtn

pull/734/head
Siegfried Pammer 9 years ago
parent
commit
0e87dfb9aa
  1. 4
      ICSharpCode.Decompiler/IL/Instructions.cs
  2. 1
      ICSharpCode.Decompiler/IL/Instructions.tt
  3. 5
      ICSharpCode.Decompiler/IL/Instructions/ILInstruction.cs

4
ICSharpCode.Decompiler/IL/Instructions.cs

@ -1680,7 +1680,7 @@ namespace ICSharpCode.Decompiler.IL @@ -1680,7 +1680,7 @@ namespace ICSharpCode.Decompiler.IL
}
/// <summary>Load method pointer</summary>
public sealed partial class LdFtn : SimpleInstruction
public sealed partial class LdFtn : SimpleInstruction, IInstructionWithMethodOperand
{
public LdFtn(IMethod method) : base(OpCode.LdFtn)
{
@ -1707,7 +1707,7 @@ namespace ICSharpCode.Decompiler.IL @@ -1707,7 +1707,7 @@ namespace ICSharpCode.Decompiler.IL
}
/// <summary>Load method pointer</summary>
public sealed partial class LdVirtFtn : UnaryInstruction
public sealed partial class LdVirtFtn : UnaryInstruction, IInstructionWithMethodOperand
{
public LdVirtFtn(ILInstruction argument, IMethod method) : base(OpCode.LdVirtFtn, argument)
{

1
ICSharpCode.Decompiler/IL/Instructions.tt

@ -826,6 +826,7 @@ namespace ICSharpCode.Decompiler.IL @@ -826,6 +826,7 @@ namespace ICSharpCode.Decompiler.IL
opCode.GenerateWriteTo = true;
opCode.WriteOperand.Add("output.Write(' ');");
opCode.WriteOperand.Add("Disassembler.DisassemblerHelpers.WriteOperand(output, method);");
opCode.Interfaces.Add("IInstructionWithMethodOperand");
};
static Action<OpCode> HasMemberOperand = opCode => {

5
ICSharpCode.Decompiler/IL/Instructions/ILInstruction.cs

@ -604,4 +604,9 @@ namespace ICSharpCode.Decompiler.IL @@ -604,4 +604,9 @@ namespace ICSharpCode.Decompiler.IL
{
ICSharpCode.NRefactory.TypeSystem.IField Field { get; }
}
public interface IInstructionWithMethodOperand
{
ICSharpCode.NRefactory.TypeSystem.IMethod Method { get; }
}
}

Loading…
Cancel
Save