Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/mcs/ilasm
diff options
context:
space:
mode:
authorAnkit Jain <radical@corewars.org>2007-01-09 21:42:33 +0300
committerAnkit Jain <radical@corewars.org>2007-01-09 21:42:33 +0300
commitf95a20d10819d33ed8ddcfceed5a2ef340287da9 (patch)
treedb41a3b1434d08e3f1e97aabe6e6d15551108748 /mcs/ilasm
parent4ba81c8a7ecf33a2105b7f3a7062d703f9285644 (diff)
In ilasm/codegen:
* BaseClassRef.cs (Clone): Move to .. * BaseTypeRef.cs (Clone): .. here. * Sentinel.cs: Implement abstract Clone method. * MethodPointerTypeRef.cs: Likewise. * PrimitiveTypeRef.cs: Likewise. * ModifiableType (MakeCustomModified): Add to SigMod. * GenericTypeInst.cs: * GenericParamRef.cs: * TypeRef.cs: * ExternTypeRef.cs: Update. In ilasm/parser: * ILParser.jay (GetTypeRef): Use BaseTypeRef.Clone svn path=/trunk/mcs/; revision=70730
Diffstat (limited to 'mcs/ilasm')
-rw-r--r--mcs/ilasm/codegen/BaseClassRef.cs2
-rw-r--r--mcs/ilasm/codegen/BaseTypeRef.cs2
-rw-r--r--mcs/ilasm/codegen/ChangeLog12
-rw-r--r--mcs/ilasm/codegen/ExternTypeRef.cs2
-rw-r--r--mcs/ilasm/codegen/GenericParamRef.cs2
-rw-r--r--mcs/ilasm/codegen/GenericTypeInst.cs2
-rw-r--r--mcs/ilasm/codegen/MethodPointerTypeRef.cs15
-rw-r--r--mcs/ilasm/codegen/ModifiableType.cs5
-rw-r--r--mcs/ilasm/codegen/PrimitiveTypeRef.cs16
-rw-r--r--mcs/ilasm/codegen/Sentinel.cs13
-rw-r--r--mcs/ilasm/codegen/TypeRef.cs2
-rw-r--r--mcs/ilasm/parser/ChangeLog4
-rw-r--r--mcs/ilasm/parser/ILParser.jay5
13 files changed, 68 insertions, 14 deletions
diff --git a/mcs/ilasm/codegen/BaseClassRef.cs b/mcs/ilasm/codegen/BaseClassRef.cs
index 0be33e7be17..e59e3b8575e 100644
--- a/mcs/ilasm/codegen/BaseClassRef.cs
+++ b/mcs/ilasm/codegen/BaseClassRef.cs
@@ -33,8 +33,6 @@ namespace Mono.ILASM {
get { return type as PEAPI.Class; }
}
- public abstract BaseClassRef Clone ();
-
public virtual void MakeValueClass ()
{
is_valuetype = true;
diff --git a/mcs/ilasm/codegen/BaseTypeRef.cs b/mcs/ilasm/codegen/BaseTypeRef.cs
index 117a629c7c8..293007fb6fd 100644
--- a/mcs/ilasm/codegen/BaseTypeRef.cs
+++ b/mcs/ilasm/codegen/BaseTypeRef.cs
@@ -53,6 +53,8 @@ namespace Mono.ILASM {
public abstract void Resolve (CodeGen code_gen);
+ public abstract BaseTypeRef Clone ();
+
protected abstract BaseMethodRef CreateMethodRef (BaseTypeRef ret_type,
PEAPI.CallConv call_conv, string name, BaseTypeRef[] param, int gen_param_count);
diff --git a/mcs/ilasm/codegen/ChangeLog b/mcs/ilasm/codegen/ChangeLog
index efe24223056..6931ec18eff 100644
--- a/mcs/ilasm/codegen/ChangeLog
+++ b/mcs/ilasm/codegen/ChangeLog
@@ -1,3 +1,15 @@
+2007-01-10 Ankit Jain <jankit@novell.com>
+
+ * BaseClassRef.cs (Clone): Move to ..
+ * BaseTypeRef.cs (Clone): .. here.
+ * Sentinel.cs: Implement abstract Clone method.
+ * MethodPointerTypeRef.cs: Likewise.
+ * PrimitiveTypeRef.cs: Likewise.
+ * ModifiableType (MakeCustomModified): Add to SigMod.
+ * GenericTypeInst.cs:
+ * GenericParamRef.cs:
+ * TypeRef.cs:
+ * ExternTypeRef.cs: Update.
Tue Dec 12 19:23:34 CET 2006 Paolo Molaro <lupus@ximian.com>
diff --git a/mcs/ilasm/codegen/ExternTypeRef.cs b/mcs/ilasm/codegen/ExternTypeRef.cs
index 1480a024115..1e4d01d0cf8 100644
--- a/mcs/ilasm/codegen/ExternTypeRef.cs
+++ b/mcs/ilasm/codegen/ExternTypeRef.cs
@@ -37,7 +37,7 @@ namespace Mono.ILASM {
nestedtypes_table = new Hashtable ();
}
- public override BaseClassRef Clone ()
+ public override BaseTypeRef Clone ()
{
return new ExternTypeRef (extern_ref, full_name, is_valuetype,
(ArrayList) ConversionList.Clone (), sig_mod);
diff --git a/mcs/ilasm/codegen/GenericParamRef.cs b/mcs/ilasm/codegen/GenericParamRef.cs
index cbebce70a04..3ba01e15625 100644
--- a/mcs/ilasm/codegen/GenericParamRef.cs
+++ b/mcs/ilasm/codegen/GenericParamRef.cs
@@ -48,7 +48,7 @@ namespace Mono.ILASM {
throw new InternalErrorException ("Not supported");
}
- public override BaseClassRef Clone ()
+ public override BaseTypeRef Clone ()
{
return new GenericParamRef (param, full_name, (ArrayList) ConversionList.Clone ());
}
diff --git a/mcs/ilasm/codegen/GenericTypeInst.cs b/mcs/ilasm/codegen/GenericTypeInst.cs
index 1982cd5ba27..94a29bc30aa 100644
--- a/mcs/ilasm/codegen/GenericTypeInst.cs
+++ b/mcs/ilasm/codegen/GenericTypeInst.cs
@@ -48,7 +48,7 @@ namespace Mono.ILASM {
get { return class_ref.FullName + gen_args.ToString () + SigMod; }
}
- public override BaseClassRef Clone ()
+ public override BaseTypeRef Clone ()
{
//Clone'd instance shares the class_ref and gen_args,
//as its basically used to create modified types (arrays etc)
diff --git a/mcs/ilasm/codegen/MethodPointerTypeRef.cs b/mcs/ilasm/codegen/MethodPointerTypeRef.cs
index 83364ffa4bc..2fd74f21d0d 100644
--- a/mcs/ilasm/codegen/MethodPointerTypeRef.cs
+++ b/mcs/ilasm/codegen/MethodPointerTypeRef.cs
@@ -20,7 +20,12 @@ namespace Mono.ILASM {
private ArrayList param_list;
public MethodPointerTypeRef (PEAPI.CallConv callconv, BaseTypeRef ret, ArrayList param_list)
- : base (String.Empty)
+ : this (callconv, ret, param_list, null, String.Empty)
+ {
+ }
+
+ public MethodPointerTypeRef (PEAPI.CallConv callconv, BaseTypeRef ret, ArrayList param_list, ArrayList conv_list, string sig_mod)
+ : base (String.Empty, conv_list, sig_mod)
{
this.callconv = callconv;
this.ret = ret;
@@ -28,7 +33,13 @@ namespace Mono.ILASM {
// We just need these to not break the interface
//full_name = String.Empty;
- sig_mod = String.Empty;
+ //sig_mod = String.Empty;
+ }
+
+ public override BaseTypeRef Clone ()
+ {
+ return new MethodPointerTypeRef (callconv, ret, (ArrayList) param_list.Clone (),
+ (ArrayList) ConversionList.Clone (), sig_mod);
}
public override void Resolve (CodeGen code_gen)
diff --git a/mcs/ilasm/codegen/ModifiableType.cs b/mcs/ilasm/codegen/ModifiableType.cs
index 463f59235a3..6506aa2eac3 100644
--- a/mcs/ilasm/codegen/ModifiableType.cs
+++ b/mcs/ilasm/codegen/ModifiableType.cs
@@ -110,6 +110,11 @@ namespace Mono.ILASM {
conversion_list.Add (ConversionMethod.MakeCustomModified);
conversion_list.Add (modifier);
conversion_list.Add (klass);
+
+ if (modifier == PEAPI.CustomModifier.modreq)
+ SigMod += ("modreq (" + klass.FullName + ")");
+ else if (modifier == PEAPI.CustomModifier.modopt)
+ SigMod += ("modopt (" + klass.FullName + ")");
}
public void MakePinned ()
diff --git a/mcs/ilasm/codegen/PrimitiveTypeRef.cs b/mcs/ilasm/codegen/PrimitiveTypeRef.cs
index 5df416f06d4..0280725d245 100644
--- a/mcs/ilasm/codegen/PrimitiveTypeRef.cs
+++ b/mcs/ilasm/codegen/PrimitiveTypeRef.cs
@@ -21,10 +21,22 @@ namespace Mono.ILASM {
private static Hashtable s_method_table = new Hashtable ();
public PrimitiveTypeRef (PEAPI.PrimitiveType type, string full_name)
- : base (full_name)
+ : this (type, full_name, null, String.Empty)
+ {
+ }
+
+ public PrimitiveTypeRef (PEAPI.PrimitiveType type, string full_name, ArrayList conv_list, string sig_mod)
+ : base (full_name, conv_list, sig_mod)
{
this.type = type;
- SigMod = String.Empty;
+ if (SigMod == null)
+ SigMod = String.Empty;
+ }
+
+ public override BaseTypeRef Clone ()
+ {
+ return new PrimitiveTypeRef ((PEAPI.PrimitiveType) type, full_name,
+ (ArrayList) ConversionList.Clone (), sig_mod);
}
public string Name {
diff --git a/mcs/ilasm/codegen/Sentinel.cs b/mcs/ilasm/codegen/Sentinel.cs
index 6bbaa38923e..e94a3bad5b4 100644
--- a/mcs/ilasm/codegen/Sentinel.cs
+++ b/mcs/ilasm/codegen/Sentinel.cs
@@ -8,16 +8,27 @@
//
using System;
+using System.Collections;
namespace Mono.ILASM {
public class SentinelTypeRef : BaseTypeRef {
public SentinelTypeRef ()
- : base ("...")
+ : this (null, null)
{
}
+ public SentinelTypeRef (ArrayList conv_list, string sig_mod)
+ : base ("...", conv_list, sig_mod)
+ {
+ }
+
+ public override BaseTypeRef Clone ()
+ {
+ return new SentinelTypeRef ((ArrayList) ConversionList.Clone (), sig_mod);
+ }
+
public override void Resolve (CodeGen code_gen)
{
if (is_resolved)
diff --git a/mcs/ilasm/codegen/TypeRef.cs b/mcs/ilasm/codegen/TypeRef.cs
index 08846715f99..86a95ccd147 100644
--- a/mcs/ilasm/codegen/TypeRef.cs
+++ b/mcs/ilasm/codegen/TypeRef.cs
@@ -32,7 +32,7 @@ namespace Mono.ILASM {
this.location = location;
}
- public override BaseClassRef Clone ()
+ public override BaseTypeRef Clone ()
{
return new TypeRef (full_name, is_valuetype, location, (ArrayList) ConversionList.Clone (), sig_mod);
}
diff --git a/mcs/ilasm/parser/ChangeLog b/mcs/ilasm/parser/ChangeLog
index a321058e29b..5059062998b 100644
--- a/mcs/ilasm/parser/ChangeLog
+++ b/mcs/ilasm/parser/ChangeLog
@@ -1,3 +1,7 @@
+2007-01-10 Ankit Jain <jankit@novell.com>
+
+ * ILParser.jay (GetTypeRef): Use BaseTypeRef.Clone
+
2006-11-09 Ankit Jain <jankit@novell.com>
* ILParser.jay (K_RETARGETABLE): New.
diff --git a/mcs/ilasm/parser/ILParser.jay b/mcs/ilasm/parser/ILParser.jay
index 40c09f14eb2..5fbdb1edf0d 100644
--- a/mcs/ilasm/parser/ILParser.jay
+++ b/mcs/ilasm/parser/ILParser.jay
@@ -129,9 +129,8 @@ namespace Mono.ILASM {
private BaseTypeRef GetTypeRef (BaseTypeRef b)
{
- if (b is BaseClassRef)
- return ((BaseClassRef) b).Clone ();
- return b;
+ //FIXME: Caching required..
+ return b.Clone ();
}
%}