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 BaseTypeRef ret_type
;
20 private BaseTypeRef
[] param
;
22 public CalliInstr (PEAPI
.CallConv call_conv
, BaseTypeRef ret_type
,
23 BaseTypeRef
[] 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 (BaseTypeRef 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
);