In mcs:
authorRaja R Harinath <harinath@hurrynot.org>
Wed, 1 Feb 2006 10:33:33 +0000 (10:33 -0000)
committerRaja R Harinath <harinath@hurrynot.org>
Wed, 1 Feb 2006 10:33:33 +0000 (10:33 -0000)
* typemanager.cs (NoTypes, NoTypeExprs): Remove.
(Reset): Update.
* *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.

In gmcs:
* typemanager.cs (NoTypes, NoTypeExprs): Remove.
(Reset): Update.
* *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.

svn path=/trunk/mcs/; revision=56378

14 files changed:
mcs/gmcs/ChangeLog
mcs/gmcs/anonymous.cs
mcs/gmcs/class.cs
mcs/gmcs/codegen.cs
mcs/gmcs/pending.cs
mcs/gmcs/support.cs
mcs/gmcs/typemanager.cs
mcs/mcs/ChangeLog
mcs/mcs/anonymous.cs
mcs/mcs/class.cs
mcs/mcs/codegen.cs
mcs/mcs/pending.cs
mcs/mcs/support.cs
mcs/mcs/typemanager.cs

index 6d70397e7612506ab5c485316c01c1dd3103e498..cf9b45128309f50e63b8d4a647cbcb58ed8681ce 100644 (file)
@@ -1,5 +1,9 @@
 2006-02-01  Raja R Harinath  <rharinath@novell.com>
 
+       * typemanager.cs (NoTypes, NoTypeExprs): Remove.
+       (Reset): Update.
+       * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
+
        * typemanager.cs (cons_param_array_attribute): Make private.
        (Reset): Set it to null.
        (InitCoreHelpers): Don't initialize it.
index a9c2223d294a06f6287281884307f42fdc60e64a..16f896c5705bdc6749a4707e02c866bd0d0f7e4a 100644 (file)
@@ -473,7 +473,7 @@ namespace Mono.CSharp {
                                name, TypeAttributes.AutoLayout | TypeAttributes.Class |
                                TypeAttributes.NestedAssembly, TypeManager.object_type, null);
 
-                       Type [] constructor_types = TypeManager.NoTypes;
+                       Type [] constructor_types = Type.EmptyTypes;
                        ConstructorBuilder ctor = scope.ScopeTypeBuilder.DefineConstructor (
                                MethodAttributes.Public | MethodAttributes.HideBySig |
                                MethodAttributes.SpecialName | MethodAttributes.RTSpecialName,
index 7b53560dff330226d635ef51269f681d67dea421..236c263f77a061d580fc6fff07e3c5c0bc1f52ac 100644 (file)
@@ -7995,7 +7995,7 @@ namespace Mono.CSharp {
                        RetType = ret_type;
 
                        if (parameters == null)
-                               Parameters = TypeManager.NoTypes;
+                               Parameters = Type.EmptyTypes;
                        else
                                Parameters = parameters;
                }
index f903e99504ddfb335fca4b5a190d32d38aad7d91..f951b49ad06d916af682eca6bff8e0cc447aa9f9 100644 (file)
@@ -1313,7 +1313,7 @@ namespace Mono.CSharp {
                        // FIXME: Does this belong inside SRE.AssemblyBuilder instead?
                        if (OptAttributes == null || !OptAttributes.Contains (TypeManager.runtime_compatibility_attr_type, null)) {
                                if (RootContext.StdLib) {
-                                       ConstructorInfo ci = TypeManager.runtime_compatibility_attr_type.GetConstructor (TypeManager.NoTypes);
+                                       ConstructorInfo ci = TypeManager.runtime_compatibility_attr_type.GetConstructor (Type.EmptyTypes);
                                        PropertyInfo pi = TypeManager.runtime_compatibility_attr_type.GetProperty ("WrapNonExceptionThrows");
                                        Builder.SetCustomAttribute (new CustomAttributeBuilder (ci, new object [0], 
                                                new PropertyInfo [] { pi }, new object[] { true } ));
index afbfd561875fc501121b0e5d30c88f5ac148c244..c45c8e8f277ce85fe2e268d2f9d6ebde93257fa6 100644 (file)
@@ -179,7 +179,7 @@ namespace Mono.CSharp {
                                
                                int j = 0;
                                foreach (MethodInfo m in mi){
-                                       pending_implementations [i].args [j] = TypeManager.NoTypes;
+                                       pending_implementations [i].args [j] = Type.EmptyTypes;
                                        pending_implementations [i].mods [j] = null;
 
                                        // If there is a previous error, just ignore
index 8db22782050f0f97b348a63f4c562a10c3da3aae..a3cbee0a5f19b1bf4c7b3fce5356cf1848b38b02 100644 (file)
@@ -47,7 +47,7 @@ namespace Mono.CSharp {
                        int count = pi.Length-1;
 
                        if (pi.Length == 0) {
-                               types = TypeManager.NoTypes;
+                               types = Type.EmptyTypes;
                        } else {
                                types = new Type [pi.Length];
                                for (int i = 0; i < pi.Length; i++)
index 78c32fad51e90548ca5f6310412967b5f83be8f9..50d7521a0691c91ba3d56936e07646d148e2a2a0 100644 (file)
@@ -113,13 +113,6 @@ public partial class TypeManager {
        static internal Type default_charset_type;
        static internal Type internals_visible_attr_type;
 
-       //
-       // An empty array of types
-       //
-       static public Type [] NoTypes;
-       static public TypeExpr [] NoTypeExprs;
-
-
        // 
        // Expressions representing the internal types.  Used during declaration
        // definition.
@@ -369,9 +362,6 @@ public partial class TypeManager {
                indexer_arguments = new PtrHashtable ();
                builder_to_ifaces = new PtrHashtable ();
                
-               NoTypes = new Type [0];
-               NoTypeExprs = new TypeExpr [0];
-
                fieldbuilders_to_fields = new Hashtable ();
                fields = new Hashtable ();
                type_hash = new DoubleHash ();
@@ -1032,13 +1022,12 @@ public partial class TypeManager {
                        system_type_type = typeof (System.Type);
                        system_assemblybuilder_type = typeof (System.Reflection.Emit.AssemblyBuilder);
 
-                       Type [] void_arg = {  };
                        system_int_array_get_length = GetMethod (
-                               system_array_type, "get_Length", void_arg);
+                               system_array_type, "get_Length", Type.EmptyTypes);
                        system_int_array_get_rank = GetMethod (
-                               system_array_type, "get_Rank", void_arg);
+                               system_array_type, "get_Rank", Type.EmptyTypes);
                        system_object_array_clone = GetMethod (
-                               system_array_type, "Clone", void_arg);
+                               system_array_type, "Clone", Type.EmptyTypes);
 
                        Type [] system_int_arg = { system_int32_type };
                        system_int_array_get_length_int = GetMethod (
@@ -1165,23 +1154,22 @@ public partial class TypeManager {
                //
                // Void arguments
                //
-               Type [] void_arg = {  };
                ienumerator_getcurrent = GetProperty (
                        ienumerator_type, "Current");
                bool_movenext_void = GetMethod (
-                       ienumerator_type, "MoveNext", void_arg);
+                       ienumerator_type, "MoveNext", Type.EmptyTypes);
                void_reset_void = GetMethod (
-                       ienumerator_type, "Reset", void_arg);
+                       ienumerator_type, "Reset", Type.EmptyTypes);
                void_dispose_void = GetMethod (
-                       idisposable_type, "Dispose", void_arg);
+                       idisposable_type, "Dispose", Type.EmptyTypes);
                int_get_offset_to_string_data = GetMethod (
-                       runtime_helpers_type, "get_OffsetToStringData", void_arg);
+                       runtime_helpers_type, "get_OffsetToStringData", Type.EmptyTypes);
                int_array_get_length = GetMethod (
-                       array_type, "get_Length", void_arg);
+                       array_type, "get_Length", Type.EmptyTypes);
                int_array_get_rank = GetMethod (
-                       array_type, "get_Rank", void_arg);
+                       array_type, "get_Rank", Type.EmptyTypes);
                ienumerable_getenumerator_void = GetMethod (
-                       ienumerable_type, "GetEnumerator", void_arg);
+                       ienumerable_type, "GetEnumerator", Type.EmptyTypes);
                
                //
                // Int32 arguments
@@ -1198,7 +1186,7 @@ public partial class TypeManager {
                // System.Array methods
                //
                object_array_clone = GetMethod (
-                       array_type, "Clone", void_arg);
+                       array_type, "Clone", Type.EmptyTypes);
                Type [] array_int_arg = { array_type, int32_type };
                void_array_copyto_array_int = GetMethod (
                        array_type, "CopyTo", array_int_arg);
@@ -1235,7 +1223,7 @@ public partial class TypeManager {
                //
                // Attributes
                //
-               unverifiable_code_ctor = GetConstructor (unverifiable_code_type, void_arg);
+               unverifiable_code_ctor = GetConstructor (unverifiable_code_type, Type.EmptyTypes);
                default_member_ctor = GetConstructor (default_member_type, string_);
 
                Type[] short_arg = { short_type };
@@ -1251,13 +1239,13 @@ public partial class TypeManager {
                // .NET 2.0 types
                //
                compiler_generated_attr = new CustomAttributeBuilder (
-                       GetConstructor (compiler_generated_attr_type, void_arg), new object[0]);
+                       GetConstructor (compiler_generated_attr_type, Type.EmptyTypes), new object[0]);
 
                Type[] type_int_arg = { type_type, int32_type };
                fixed_buffer_attr_ctor = GetConstructor (fixed_buffer_attr_type, type_int_arg);
 
                // Object
-               object_ctor = GetConstructor (object_type, void_arg);
+               object_ctor = GetConstructor (object_type, Type.EmptyTypes);
 
                InitGenericCodeHelpers ();
        }
@@ -1821,12 +1809,12 @@ public partial class TypeManager {
                        // If we're a PropertyBuilder and not in the
                        // `indexer_arguments' hash, then we're a property and
                        // not an indexer.
-                       return NoTypes;
+                       return Type.EmptyTypes;
                else {
                        ParameterInfo [] pi = indexer.GetIndexParameters ();
                        // Property, not an indexer.
                        if (pi == null)
-                               return NoTypes;
+                               return Type.EmptyTypes;
                        int c = pi.Length;
                        Type [] types = new Type [c];
                        
@@ -2082,7 +2070,7 @@ public partial class TypeManager {
                        Type [] base_ifaces;
                        
                        if (t.BaseType == null)
-                               base_ifaces = NoTypes;
+                               base_ifaces = Type.EmptyTypes;
                        else
                                base_ifaces = GetInterfaces (t.BaseType);
                        Type[] type_ifaces;
@@ -2091,7 +2079,7 @@ public partial class TypeManager {
                        else
                                type_ifaces = (Type []) builder_to_ifaces [t];
                        if (type_ifaces == null)
-                               type_ifaces = NoTypes;
+                               type_ifaces = Type.EmptyTypes;
 
                        int base_count = base_ifaces.Length;
                        Type [] result = new Type [base_count + type_ifaces.Length];
@@ -2103,7 +2091,7 @@ public partial class TypeManager {
                } else if (t is GenericTypeParameterBuilder){
                        Type[] type_ifaces = (Type []) builder_to_ifaces [t];
                        if (type_ifaces == null)
-                               type_ifaces = NoTypes;
+                               type_ifaces = Type.EmptyTypes;
 
                        iface_cache [t] = type_ifaces;
                        return type_ifaces;
index ad1867cdb2f511853ee67402a75138db259d0aae..f68ced123a272b2a56a8a88ae0c0a3190c021ec2 100644 (file)
@@ -1,5 +1,9 @@
 2006-02-01  Raja R Harinath  <rharinath@novell.com>
 
+       * typemanager.cs (NoTypes, NoTypeExprs): Remove.
+       (Reset): Update.
+       * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
+
        * typemanager.cs (cons_param_array_attribute): Make private.
        (Reset): Set it to null.
        (InitCoreHelpers): Don't initialize it.
index a8930869edb1bd2355a0d014222808cde34fc2a8..57fb8e98f61c867ff82c45187b35240affc2aec0 100644 (file)
@@ -424,7 +424,7 @@ namespace Mono.CSharp {
                                name, TypeAttributes.AutoLayout | TypeAttributes.Class |
                                TypeAttributes.NestedAssembly, TypeManager.object_type, null);
 
-                       Type [] constructor_types = TypeManager.NoTypes;
+                       Type [] constructor_types = Type.EmptyTypes;
                        scope.ScopeConstructor = scope.ScopeTypeBuilder.DefineConstructor (
                                MethodAttributes.Public | MethodAttributes.HideBySig |
                                MethodAttributes.SpecialName | MethodAttributes.RTSpecialName,
index 36f2a6be630e15fc0520f25b4ce89fc56be46047..113b6f3440dd6a0ecfcb75f288125d289834bee7 100644 (file)
@@ -7617,7 +7617,7 @@ namespace Mono.CSharp {
                        RetType = ret_type;
 
                        if (parameters == null)
-                               Parameters = TypeManager.NoTypes;
+                               Parameters = Type.EmptyTypes;
                        else
                                Parameters = parameters;
                }
index a05e2853f4241ac2bbd610c1d14165a70607ff2f..3eb4d66a640a6e2afcfc5aa3eb148184d46ef8ae 100644 (file)
@@ -1254,7 +1254,7 @@ namespace Mono.CSharp {
 
 #if NET_2_0
                        if (!OptAttributes.Contains (TypeManager.runtime_compatibility_attr_type, null)) {
-                               ConstructorInfo ci = TypeManager.runtime_compatibility_attr_type.GetConstructor (TypeManager.NoTypes);
+                               ConstructorInfo ci = TypeManager.runtime_compatibility_attr_type.GetConstructor (Type.EmptyTypes);
                                PropertyInfo pi = TypeManager.runtime_compatibility_attr_type.GetProperty ("WrapNonExceptionThrows");
                                Builder.SetCustomAttribute (new CustomAttributeBuilder (ci, new object [0], 
                                        new PropertyInfo [] { pi }, new object[] { true } ));
index d859ffdd2070bec9bc97cfb504fb6492cb7afbea..c58372f2ef71015910d779b4be4f99746219f9bb 100644 (file)
@@ -179,7 +179,7 @@ namespace Mono.CSharp {
                                
                                int j = 0;
                                foreach (MethodInfo m in mi){
-                                       pending_implementations [i].args [j] = TypeManager.NoTypes;
+                                       pending_implementations [i].args [j] = Type.EmptyTypes;
                                        pending_implementations [i].mods [j] = null;
 
                                        // If there is a previous error, just ignore
index 5d227bf3f442c5b4f23e894d60a420e0ed9e4ab8..4e1c10410f88c48cca414ef13944fbe86214e339 100644 (file)
@@ -46,7 +46,7 @@ namespace Mono.CSharp {
                        int count = pi.Length-1;
 
                        if (pi.Length == 0) {
-                               types = TypeManager.NoTypes;
+                               types = Type.EmptyTypes;
                        } else {
                                types = new Type [pi.Length];
                                for (int i = 0; i < pi.Length; i++)
index abe51e5b5059434a6782af3e20f49c5f9495b9b5..200a4581f6ffac19dd02841b08f4bb74cd2bb203 100644 (file)
@@ -114,13 +114,6 @@ public class TypeManager {
        static internal Type default_charset_type;
 #endif
 
-       //
-       // An empty array of types
-       //
-       static public Type [] NoTypes;
-       static public TypeExpr [] NoTypeExprs;
-
-
        // 
        // Expressions representing the internal types.  Used during declaration
        // definition.
@@ -366,9 +359,6 @@ public class TypeManager {
                indexer_arguments = new PtrHashtable ();
                builder_to_ifaces = new PtrHashtable ();
                
-               NoTypes = new Type [0];
-               NoTypeExprs = new TypeExpr [0];
-
                fieldbuilders_to_fields = new Hashtable ();
                fields = new Hashtable ();
                type_hash = new DoubleHash ();
@@ -894,13 +884,12 @@ public class TypeManager {
                        system_type_type = typeof (System.Type);
                        system_assemblybuilder_type = typeof (System.Reflection.Emit.AssemblyBuilder);
 
-                       Type [] void_arg = {  };
                        system_int_array_get_length = GetMethod (
-                               system_array_type, "get_Length", void_arg);
+                               system_array_type, "get_Length", Type.EmptyTypes);
                        system_int_array_get_rank = GetMethod (
-                               system_array_type, "get_Rank", void_arg);
+                               system_array_type, "get_Rank", Type.EmptyTypes);
                        system_object_array_clone = GetMethod (
-                               system_array_type, "Clone", void_arg);
+                               system_array_type, "Clone", Type.EmptyTypes);
 
                        Type [] system_int_arg = { system_int32_type };
                        system_int_array_get_length_int = GetMethod (
@@ -1027,23 +1016,22 @@ public class TypeManager {
                //
                // Void arguments
                //
-               Type [] void_arg = {  };
                ienumerator_getcurrent = GetProperty (
                        ienumerator_type, "Current");
                bool_movenext_void = GetMethod (
-                       ienumerator_type, "MoveNext", void_arg);
+                       ienumerator_type, "MoveNext", Type.EmptyTypes);
                void_reset_void = GetMethod (
-                       ienumerator_type, "Reset", void_arg);
+                       ienumerator_type, "Reset", Type.EmptyTypes);
                void_dispose_void = GetMethod (
-                       idisposable_type, "Dispose", void_arg);
+                       idisposable_type, "Dispose", Type.EmptyTypes);
                int_get_offset_to_string_data = GetMethod (
-                       runtime_helpers_type, "get_OffsetToStringData", void_arg);
+                       runtime_helpers_type, "get_OffsetToStringData", Type.EmptyTypes);
                int_array_get_length = GetMethod (
-                       array_type, "get_Length", void_arg);
+                       array_type, "get_Length", Type.EmptyTypes);
                int_array_get_rank = GetMethod (
-                       array_type, "get_Rank", void_arg);
+                       array_type, "get_Rank", Type.EmptyTypes);
                ienumerable_getenumerator_void = GetMethod (
-                       ienumerable_type, "GetEnumerator", void_arg);
+                       ienumerable_type, "GetEnumerator", Type.EmptyTypes);
                
                //
                // Int32 arguments
@@ -1060,7 +1048,7 @@ public class TypeManager {
                // System.Array methods
                //
                object_array_clone = GetMethod (
-                       array_type, "Clone", void_arg);
+                       array_type, "Clone", Type.EmptyTypes);
                Type [] array_int_arg = { array_type, int32_type };
                void_array_copyto_array_int = GetMethod (
                        array_type, "CopyTo", array_int_arg);
@@ -1097,7 +1085,7 @@ public class TypeManager {
                //
                // Attributes
                //
-               unverifiable_code_ctor = GetConstructor (unverifiable_code_type, void_arg);
+               unverifiable_code_ctor = GetConstructor (unverifiable_code_type, Type.EmptyTypes);
                default_member_ctor = GetConstructor (default_member_type, string_);
 
                Type[] short_arg = { short_type };
@@ -1114,14 +1102,14 @@ public class TypeManager {
                //
 #if NET_2_0
                compiler_generated_attr = new CustomAttributeBuilder (
-                       GetConstructor (compiler_generated_attr_type, void_arg), new object[0]);
+                       GetConstructor (compiler_generated_attr_type, Type.EmptyTypes), new object[0]);
 
                Type[] type_int_arg = { type_type, int32_type };
                fixed_buffer_attr_ctor = GetConstructor (fixed_buffer_attr_type, type_int_arg);
 #endif
 
                // Object
-               object_ctor = GetConstructor (object_type, void_arg);
+               object_ctor = GetConstructor (object_type, Type.EmptyTypes);
 
        }
 
@@ -1535,12 +1523,12 @@ public class TypeManager {
                        // If we're a PropertyBuilder and not in the
                        // `indexer_arguments' hash, then we're a property and
                        // not an indexer.
-                       return NoTypes;
+                       return Type.EmptyTypes;
                else {
                        ParameterInfo [] pi = indexer.GetIndexParameters ();
                        // Property, not an indexer.
                        if (pi == null)
-                               return NoTypes;
+                               return Type.EmptyTypes;
                        int c = pi.Length;
                        Type [] types = new Type [c];
                        
@@ -1768,12 +1756,12 @@ public class TypeManager {
                        Type [] base_ifaces;
                        
                        if (t.BaseType == null)
-                               base_ifaces = NoTypes;
+                               base_ifaces = Type.EmptyTypes;
                        else
                                base_ifaces = GetInterfaces (t.BaseType);
                        Type [] type_ifaces = (Type []) builder_to_ifaces [t];
                        if (type_ifaces == null)
-                               type_ifaces = NoTypes;
+                               type_ifaces = Type.EmptyTypes;
 
                        int base_count = base_ifaces.Length;
                        Type [] result = new Type [base_count + type_ifaces.Length];