2 // Mono.ILASM.GlobalMethodRef
5 // Jackson Harper (Jackson@LatitudeGeo.com)
7 // (C) 2003 Jackson Harper, All rights reserved
12 using System.Collections;
14 namespace Mono.ILASM {
16 public class GlobalMethodRef : BaseMethodRef {
18 public GlobalMethodRef (BaseTypeRef ret_type, PEAPI.CallConv call_conv,
19 string name, BaseTypeRef[] param, int gen_param_count)
20 : base (null, call_conv, ret_type, name, param, gen_param_count)
24 public override void Resolve (CodeGen code_gen)
31 if ((call_conv & PEAPI.CallConv.Vararg) == 0) {
32 sig = MethodDef.CreateSignature (ret_type, name, param, gen_param_count);
33 peapi_method = code_gen.ResolveMethod (sig);
35 ArrayList opt_list = new ArrayList ();
37 foreach (BaseTypeRef type in param) {
38 if (type is SentinelTypeRef) {
41 type.Resolve (code_gen);
42 opt_list.Add (type.PeapiType);
45 sig = MethodDef.CreateVarargSignature (ret_type, name, param);
46 peapi_method = code_gen.ResolveVarargMethod (sig, code_gen,
47 (PEAPI.Type[]) opt_list.ToArray (typeof (PEAPI.Type)));
50 peapi_method.AddCallConv (call_conv);