tag a couple of obsolete members
[mcs.git] / ilasm / codegen / TypeRef.cs
blob86a95ccd14727eda36c605e27a245e275acf0731
1 //
2 // Mono.ILASM.TypeRef
3 //
4 // Author(s):
5 // Jackson Harper (Jackson@LatitudeGeo.com)
6 //
7 // (C) 2003 Jackson Harper, All rights reserved
8 //
10 using System;
11 using System.Collections;
13 namespace Mono.ILASM {
15 /// <summary>
16 /// Reference to a type in the module being compiled.
17 /// </summary>
18 public class TypeRef : BaseClassRef {
20 private Location location;
21 public static readonly TypeRef Ellipsis = new TypeRef ("ELLIPSIS", false, null);
22 public static readonly TypeRef Any = new TypeRef ("any", false, null);
24 public TypeRef (string full_name, bool is_valuetype, Location location)
25 : this (full_name, is_valuetype, location, null, null)
29 public TypeRef (string full_name, bool is_valuetype, Location location, ArrayList conv_list, string sig_mod)
30 : base (full_name, is_valuetype, conv_list, sig_mod)
32 this.location = location;
35 public override BaseTypeRef Clone ()
37 return new TypeRef (full_name, is_valuetype, location, (ArrayList) ConversionList.Clone (), sig_mod);
40 protected override BaseMethodRef CreateMethodRef (BaseTypeRef ret_type,
41 PEAPI.CallConv call_conv, string name, BaseTypeRef[] param, int gen_param_count)
43 if (SigMod == null | SigMod == "")
44 return new MethodRef (this, call_conv, ret_type, name, param, gen_param_count);
45 else
46 return new TypeSpecMethodRef (this, call_conv, ret_type, name, param, gen_param_count);
49 protected override IFieldRef CreateFieldRef (BaseTypeRef ret_type, string name)
51 return new FieldRef (this, ret_type, name);
54 public override void Resolve (CodeGen code_gen)
56 if (is_resolved)
57 return;
59 PEAPI.Type base_type;
61 base_type = code_gen.TypeManager.GetPeapiType (full_name);
63 if (base_type == null) {
64 Report.Error ("Reference to undefined class '" +
65 FullName + "'");
66 return;
68 type = Modify (code_gen, base_type);
70 is_resolved = true;
73 public BaseClassRef AsClassRef (CodeGen code_gen)
75 return this;
78 public override string ToString ()
80 return FullName;