* roottypes.cs: Rename from tree.cs.
[mono.git] / mcs / ilasm / codegen / GlobalMethodRef.cs
index 2efabf2fa2dc8ccda80795120e419f8936df9872..fb85d1af4b6b9e8d16a7499146dd54a3b1f0abab 100644 (file)
@@ -13,41 +13,15 @@ using System.Collections;
 
 namespace Mono.ILASM {
 
-        public class GlobalMethodRef : IMethodRef {
+        public class GlobalMethodRef : BaseMethodRef {
 
-                private ITypeRef ret_type;
-                private string name;
-                private ITypeRef[] param;
-                private PEAPI.CallConv call_conv;
-
-                private PEAPI.Method peapi_method;
-               private bool is_resolved;
-
-                public GlobalMethodRef (ITypeRef ret_type, PEAPI.CallConv call_conv,
-                                string name, ITypeRef[] param)
+                public GlobalMethodRef (BaseTypeRef ret_type, PEAPI.CallConv call_conv,
+                                string name, BaseTypeRef[] param, int gen_param_count)
+                        : base (null, call_conv, ret_type, name, param, gen_param_count)
                 {
-                        this.ret_type = ret_type;
-                        this.call_conv = call_conv;
-                        this.name = name;
-                        this.param = param;
-
-                       is_resolved = false;
                 }
 
-                public PEAPI.Method PeapiMethod {
-                        get { return peapi_method; }
-                }
-
-               public PEAPI.CallConv CallConv {
-                       get { return call_conv; }
-                       set { call_conv = value; }
-               }
-
-               public ITypeRef Owner {
-                       get { return null; }
-               }
-
-                public void Resolve (CodeGen code_gen)
+                public override void Resolve (CodeGen code_gen)
                 {
                        if (is_resolved)
                                return;
@@ -55,12 +29,12 @@ namespace Mono.ILASM {
                         string sig;
 
                         if ((call_conv & PEAPI.CallConv.Vararg) == 0) {
-                                sig = MethodDef.CreateSignature (ret_type, name, param);
+                                sig = MethodDef.CreateSignature (ret_type, name, param, gen_param_count);
                                 peapi_method = code_gen.ResolveMethod (sig);
                         } else {
                                 ArrayList opt_list = new ArrayList ();
                                 bool in_opt = false;
-                                foreach (ITypeRef type in param) {
+                                foreach (BaseTypeRef type in param) {
                                         if (type is SentinelTypeRef) {
                                                 in_opt = true;
                                         } else if (in_opt) {