This commit was manufactured by cvs2svn to create branch 'mono-1-0'.
[mono.git] / mcs / ilasm / codegen / MethodInstr.cs
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 //
9
10
11 using System;
12
13
14 namespace Mono.ILASM {
15
16         public class MethodInstr : IInstr {
17
18                 private PEAPI.MethodOp op;
19                 private IMethodRef operand;
20
21                 public MethodInstr (PEAPI.MethodOp op, IMethodRef operand)
22                 {
23                         this.op = op;
24                         this.operand = operand;
25
26                         if (op == PEAPI.MethodOp.newobj || op == PEAPI.MethodOp.callvirt)
27                                 operand.CallConv |= PEAPI.CallConv.Instance;
28                 }
29
30                 public void Emit (CodeGen code_gen, MethodDef meth,
31                                   PEAPI.CILInstructions cil)
32                 {
33                         operand.Resolve (code_gen);
34                         cil.MethInst (op, operand.PeapiMethod);
35                 }
36         }
37
38 }
39
40