Author: martin
Date: 2005-03-21 13:14:39 -0500 (Mon, 21 Mar 2005)
New Revision: 42053

Modified:
   trunk/mcs/gmcs/ChangeLog
   trunk/mcs/gmcs/delegate.cs
   trunk/mcs/gmcs/driver.cs
   trunk/mcs/gmcs/location.cs
   trunk/mcs/gmcs/rootcontext.cs
   trunk/mcs/gmcs/statement.cs
Log:
**** Merged r39979-r40298 from MCS ****


Modified: trunk/mcs/gmcs/ChangeLog
===================================================================
--- trunk/mcs/gmcs/ChangeLog    2005-03-21 18:12:45 UTC (rev 42052)
+++ trunk/mcs/gmcs/ChangeLog    2005-03-21 18:14:39 UTC (rev 42053)
@@ -1,3 +1,34 @@
+2005-02-08  Raja R Harinath  <[EMAIL PROTECTED]>
+
+       Fix #72015.
+       * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
+       TypeManager.multicast_delegate_type is null, resolve it by looking
+       up "System.MulticastDelegate".
+       * rootcontext.cs (RootContext.ResolveCore): Simplify.
+
+2005-02-07  Abin Thomas (NOSIP)  <[EMAIL PROTECTED]>
+           Anoob V.E (NOSIP)  <[EMAIL PROTECTED]>
+           Harilal P.R (NOSIP)  <[EMAIL PROTECTED]>
+
+       Fix cs0164.cs.
+       * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
+       (LabeledStatement.AddReference): New.  Set 'referenced'.
+       (Goto.Resolve): Use it.
+
+2005-02-05  John Luke  <[EMAIL PROTECTED]>
+
+       * driver.cs: remove duplicate -doc line in Usage ()
+
+2005-02-04  Raja R Harinath  <[EMAIL PROTECTED]>
+
+       * location.cs (Location.AddFile): Fix CS2002 error report.
+
+2005-02-02  Martin Baulig  <[EMAIL PROTECTED]>
+
+       * delegate.cs (Delegate.DefineType): Report an internal error if
+       TypeManager.multicast_delegate_type is null.  See bug #72015 for
+       details.        
+
 2005-02-02  Raja R Harinath  <[EMAIL PROTECTED]>
 
        Fix a crasher in a variant of #31984.

Modified: trunk/mcs/gmcs/delegate.cs
===================================================================
--- trunk/mcs/gmcs/delegate.cs  2005-03-21 18:12:45 UTC (rev 42052)
+++ trunk/mcs/gmcs/delegate.cs  2005-03-21 18:14:39 UTC (rev 42053)
@@ -90,6 +90,11 @@
                        TypeAttributes attr = Modifiers.TypeAttr (ModFlags, 
IsTopLevel) |
                                TypeAttributes.Class | TypeAttributes.Sealed;
 
+                       if (TypeManager.multicast_delegate_type == null && 
!RootContext.StdLib) {
+                               TypeExpr expr = new TypeLookupExpression 
("System.MulticastDelegate");
+                               TypeManager.multicast_delegate_type = 
expr.ResolveType (ec);
+                       }
+
                        if (TypeManager.multicast_delegate_type == null)
                                Report.Error (-100, Location, "Internal error: 
delegate used before " +
                                              "System.MulticastDelegate is 
resolved.  This can only " +
@@ -154,13 +159,15 @@
                {
                        MethodAttributes mattr;
                        int i;
-                       ec = new EmitContext (this, this, Location, null, null, 
ModFlags, false);
 
                        if (IsGeneric) {
                                foreach (TypeParameter type_param in 
TypeParameters)
                                        type_param.DefineType (ec);
                        }
 
+                       if (ec == null)
+                               throw new InternalErrorException ("Define 
called before DefineType?");
+
                        // FIXME: POSSIBLY make this static, as it is always 
constant
                        //
                        Type [] const_arg_types = new Type [2];

Modified: trunk/mcs/gmcs/driver.cs
===================================================================
--- trunk/mcs/gmcs/driver.cs    2005-03-21 18:12:45 UTC (rev 42052)
+++ trunk/mcs/gmcs/driver.cs    2005-03-21 18:14:39 UTC (rev 42053)
@@ -221,7 +221,6 @@
                                "   -nostdlib[+|-]     Does not load core 
libraries\n" +
                                "   -nowarn:W1[,W2]    Disables one or more 
warnings\n" + 
                                "   -out:FNAME         Specifies output file\n" 
+
-                               "   -doc:XMLFILE         Generates xml 
documentation into specified file\n" +
                                "   -pkg:P1[,Pn]       References packages 
P1..Pn\n" + 
                                "   --expect-error X   Expect that error X will 
be encountered\n" +
                                "   -recurse:SPEC      Recursively compiles the 
files in SPEC ([dir]/file)\n" + 

Modified: trunk/mcs/gmcs/location.cs
===================================================================
--- trunk/mcs/gmcs/location.cs  2005-03-21 18:12:45 UTC (rev 42052)
+++ trunk/mcs/gmcs/location.cs  2005-03-21 18:14:39 UTC (rev 42053)
@@ -84,7 +84,12 @@
                        string path = Path.GetFullPath (name);
 
                        if (source_files.Contains (path)){
-                               Report.Warning (2002, name, "Source file '{0}' 
specified multiple times", path);
+                               int id = (int) source_files [path];
+                               string other_name = ((SourceFile) source_list 
[id - 1]).Name;
+                               if (name.Equals (other_name))
+                                       Report.Warning (2002, "Source file 
'{0}' specified multiple times", name);
+                               else
+                                       Report.Warning (2002, "Source filenames 
'{0}' and '{1}' both refer to the same file: {2}", name, other_name, path);
                                return;
                        }
 

Modified: trunk/mcs/gmcs/rootcontext.cs
===================================================================
--- trunk/mcs/gmcs/rootcontext.cs       2005-03-21 18:12:45 UTC (rev 42052)
+++ trunk/mcs/gmcs/rootcontext.cs       2005-03-21 18:14:39 UTC (rev 42053)
@@ -364,6 +364,9 @@
                        // These are classes that depends on the core interfaces
                        //
                        string [] classes_second_stage = {
+                               "System.Enum",
+                               "System.String",
+                               "System.Array",
                                "System.Reflection.MemberInfo",
                                "System.Type",
                                "System.Exception",
@@ -400,19 +403,18 @@
                                "System.Security.CodeAccessPermission"
                        };
 
-                       // We must store them here before calling 
BootstrapCorlib_ResolveDelegate.
-                       TypeManager.string_type = BootstrapCorlib_ResolveClass 
(root, "System.String");
-                       TypeManager.enum_type = BootstrapCorlib_ResolveClass 
(root, "System.Enum");
-                       TypeManager.array_type = BootstrapCorlib_ResolveClass 
(root, "System.Array");
-                       TypeManager.multicast_delegate_type = 
BootstrapCorlib_ResolveClass (root, "System.MulticastDelegate");
-                       TypeManager.delegate_type = 
BootstrapCorlib_ResolveClass (root, "System.Delegate");
-                       
                        foreach (string cname in classes_second_stage)
                                BootstrapCorlib_ResolveClass (root, cname);
 
                        BootstrapCorlib_ResolveStruct (root, 
"System.Nullable`1");
 
                        BootstrapCorlib_ResolveDelegate (root, 
"System.AsyncCallback");
+
+                       // These will be defined indirectly during the previous 
ResolveDelegate.
+                       // However make sure the rest of the checks happen.
+                       string [] delegate_types = { "System.Delegate", 
"System.MulticastDelegate" };
+                       foreach (string cname in delegate_types)
+                               BootstrapCorlib_ResolveClass (root, cname);
                }
                        
                // <summary>

Modified: trunk/mcs/gmcs/statement.cs
===================================================================
--- trunk/mcs/gmcs/statement.cs 2005-03-21 18:12:45 UTC (rev 42052)
+++ trunk/mcs/gmcs/statement.cs 2005-03-21 18:14:39 UTC (rev 42053)
@@ -646,6 +646,7 @@
                                label.AddUsageVector 
(ec.CurrentBranching.CurrentUsageVector);
 
                        ec.CurrentBranching.CurrentUsageVector.Goto ();
+                       label.AddReference ();
 
                        return true;
                }
@@ -718,8 +719,6 @@
                {
                        ec.CurrentBranching.Label (vectors);
 
-                       referenced = true;
-
                        return true;
                }
 
@@ -732,6 +731,11 @@
                        LabelTarget (ec);
                        ec.ig.MarkLabel (label);
                }
+
+               public void AddReference ()
+               {
+                       referenced = true;
+               }
        }
        
 

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to