2 // Mono.ILASM.TypeSpecMethodRef
5 // Jackson Harper (Jackson@LatitudeGeo.com)
7 // (C) 2003 Jackson Harper, All rights reserved
14 namespace Mono.ILASM {
16 public class TypeSpecMethodRef : IMethodRef {
18 private PEAPI.MethodRef peapi_method;
19 private ITypeRef owner;
21 private PEAPI.CallConv call_conv;
22 private ITypeRef ret_type;
24 private ITypeRef[] param;
26 private bool is_resolved;
28 public TypeSpecMethodRef (ITypeRef owner,
29 ITypeRef ret_type, PEAPI.CallConv call_conv,
30 string name, ITypeRef[] param)
33 this.call_conv = call_conv;
34 this.ret_type = ret_type;
40 public PEAPI.Method PeapiMethod {
46 public PEAPI.CallConv CallConv {
47 get { return call_conv; }
48 set { call_conv = value; }
51 public ITypeRef Owner {
55 public void Resolve (CodeGen code_gen)
60 PEAPI.Type[] param_list = new PEAPI.Type[param.Length];
63 ret_type.Resolve (code_gen);
66 foreach (ITypeRef typeref in param) {
67 typeref.Resolve (code_gen);
68 param_list[count++] = typeref.PeapiType;
76 owner.Resolve (code_gen);
77 peapi_method = code_gen.PEFile.AddMethodToTypeSpec (owner.PeapiType, write_name,
78 ret_type.PeapiType, param_list);
80 peapi_method.AddCallConv (call_conv);