2 // Mono.ILASM.CalliInstr
5 // Jackson Harper (Jackson@LatitudeGeo.com)
7 // (C) 2003 Jackson Harper, All rights reserved
14 namespace Mono.ILASM {
16 public class CalliInstr : IInstr {
18 private PEAPI.CallConv call_conv;
19 private ITypeRef ret_type;
20 private ITypeRef[] param;
22 public CalliInstr (PEAPI.CallConv call_conv, ITypeRef ret_type,
23 ITypeRef[] param, Location loc)
26 this.call_conv = call_conv;
27 this.ret_type = ret_type;
31 public override void Emit (CodeGen code_gen, MethodDef meth,
32 PEAPI.CILInstructions cil)
34 PEAPI.Type[] param_array;
35 PEAPI.CalliSig callisig;
38 param_array = new PEAPI.Type[param.Length];
40 foreach (ITypeRef typeref in param) {
41 typeref.Resolve (code_gen);
42 param_array[count++] = typeref.PeapiType;
45 param_array = new PEAPI.Type[0];
48 ret_type.Resolve (code_gen);
49 callisig = new PEAPI.CalliSig (call_conv,
50 ret_type.PeapiType, param_array);