diff options
Diffstat (limited to 'mcs/ilasm/codegen/MethodInstr.cs')
-rw-r--r-- | mcs/ilasm/codegen/MethodInstr.cs | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/mcs/ilasm/codegen/MethodInstr.cs b/mcs/ilasm/codegen/MethodInstr.cs new file mode 100644 index 00000000000..62c291c8900 --- /dev/null +++ b/mcs/ilasm/codegen/MethodInstr.cs @@ -0,0 +1,41 @@ +// +// Mono.ILASM.MethodInstr +// +// Author(s): +// Jackson Harper (Jackson@LatitudeGeo.com) +// +// (C) 2003 Jackson Harper, All rights reserved +// + + +using System; + + +namespace Mono.ILASM { + + public class MethodInstr : IInstr { + + private PEAPI.MethodOp op; + private BaseMethodRef operand; + + public MethodInstr (PEAPI.MethodOp op, BaseMethodRef operand, Location loc) + : base (loc) + { + this.op = op; + this.operand = operand; + + if (op == PEAPI.MethodOp.newobj || op == PEAPI.MethodOp.callvirt) + operand.CallConv |= PEAPI.CallConv.Instance; + } + + public override void Emit (CodeGen code_gen, MethodDef meth, + PEAPI.CILInstructions cil) + { + operand.Resolve (code_gen); + cil.MethInst (op, operand.PeapiMethod); + } + } + +} + + |