2010-04-07 Jb Evain <jbevain@novell.com>
[mcs.git] / ilasm / codegen / MethodInstr.cs
blob62c291c8900ca52ef23e9b693d4937770a038fd8
1 //
2 // Mono.ILASM.MethodInstr
3 //
4 // Author(s):
5 // Jackson Harper (Jackson@LatitudeGeo.com)
6 //
7 // (C) 2003 Jackson Harper, All rights reserved
8 //
11 using System;
14 namespace Mono.ILASM {
16 public class MethodInstr : IInstr {
18 private PEAPI.MethodOp op;
19 private BaseMethodRef operand;
21 public MethodInstr (PEAPI.MethodOp op, BaseMethodRef operand, Location loc)
22 : base (loc)
24 this.op = op;
25 this.operand = operand;
27 if (op == PEAPI.MethodOp.newobj || op == PEAPI.MethodOp.callvirt)
28 operand.CallConv |= PEAPI.CallConv.Instance;
31 public override void Emit (CodeGen code_gen, MethodDef meth,
32 PEAPI.CILInstructions cil)
34 operand.Resolve (code_gen);
35 cil.MethInst (op, operand.PeapiMethod);