Removed hack for compilation of enums inside corlib
authorMarek Safar <marek.safar@gmail.com>
Wed, 19 Jan 2011 08:41:31 +0000 (08:41 +0000)
committerMarek Safar <marek.safar@gmail.com>
Wed, 19 Jan 2011 17:58:04 +0000 (17:58 +0000)
mcs/mcs/enum.cs
mcs/mcs/roottypes.cs

index 0e20165ef6de293cf3cfb7288f36a25d2151b378..a7ed0e2107a3b4b619ad462f0c9ce60b95a3ab80 100644 (file)
@@ -207,9 +207,6 @@ namespace Mono.CSharp {
                        TypeBuilder.DefineField (UnderlyingValueField, UnderlyingType.GetMetaInfo (),
                                FieldAttributes.Public | FieldAttributes.SpecialName | FieldAttributes.RTSpecialName);
 
-                       if (!RootContext.StdLib)
-                               Module.hack_corlib_enums.Add (this);
-
                        return true;
                }
 
index 245a6d7a3950886f38c9bb4ab25410d8795f7509..b6915455a4f212e226fff4bb3276f70fa186f45c 100644 (file)
@@ -123,9 +123,6 @@ namespace Mono.CSharp
 
                ModuleBuilder builder;
 
-               // HACK
-               public List<Enum> hack_corlib_enums = new List<Enum> ();
-
                bool has_default_charset;
                bool has_extenstion_method;
 
@@ -282,8 +279,6 @@ namespace Mono.CSharp
 
                public override void CloseType ()
                {
-                       HackCorlibEnums ();
-
                        foreach (TypeContainer tc in types) {
                                tc.CloseType ();
                        }
@@ -444,18 +439,6 @@ namespace Mono.CSharp
 #endif
                }
 
-               void HackCorlibEnums ()
-               {
-                       if (RootContext.StdLib)
-                               return;
-
-                       // Another Mono corlib HACK
-                       // mono_class_layout_fields requires to have enums created
-                       // before creating a class which used the enum for any of its fields
-                       foreach (var e in hack_corlib_enums)
-                               e.CloseType ();
-               }
-
                public void InitializePredefinedTypes ()
                {
                        predefined_attributes = new PredefinedAttributes (this);