Author: martin
Date: 2005-04-19 10:56:04 -0400 (Tue, 19 Apr 2005)
New Revision: 43263

Modified:
   trunk/mcs/gmcs/ChangeLog
   trunk/mcs/gmcs/class.cs
   trunk/mcs/gmcs/driver.cs
   trunk/mcs/gmcs/report.cs
Log:
**** Merged r42758 from MCS ****


Modified: trunk/mcs/gmcs/ChangeLog
===================================================================
--- trunk/mcs/gmcs/ChangeLog    2005-04-19 14:54:33 UTC (rev 43262)
+++ trunk/mcs/gmcs/ChangeLog    2005-04-19 14:56:04 UTC (rev 43263)
@@ -1,3 +1,17 @@
+2005-04-10  Miguel de Icaza  <[EMAIL PROTECTED]>
+
+       * driver.cs (CompilerCallableEntryPoint.InvokeCompiler): Always
+       reset after execution;   Take a TextWriter argument for the
+       output.
+
+       * report.cs: Use the error stream instead of hardcoding stderr. 
+
+2005-04-09  Miguel de Icaza  <[EMAIL PROTECTED]>
+
+       * class.cs: Reduce code paths to test, too small of an
+       optimization to make it worth the extra testing.  Always perform
+       it. 
+
 2005-04-08  Raja R Harinath  <[EMAIL PROTECTED]>
 
        Fix #74510.

Modified: trunk/mcs/gmcs/class.cs
===================================================================
--- trunk/mcs/gmcs/class.cs     2005-04-19 14:54:33 UTC (rev 43262)
+++ trunk/mcs/gmcs/class.cs     2005-04-19 14:56:04 UTC (rev 43263)
@@ -873,12 +873,10 @@
                                if (a == null)
                                        return false;
 
-                               if (RootContext.Optimize) {
-                                       Constant c = e as Constant;
-                                       if (c != null) {
-                                               if (c.IsDefaultValue)
-                                                       continue;
-                                       }
+                               Constant c = e as Constant;
+                               if (c != null) {
+                                       if (c.IsDefaultValue)
+                                               continue;
                                }
 
                                a.EmitStatement (ec);

Modified: trunk/mcs/gmcs/driver.cs
===================================================================
--- trunk/mcs/gmcs/driver.cs    2005-04-19 14:54:33 UTC (rev 43262)
+++ trunk/mcs/gmcs/driver.cs    2005-04-19 14:56:04 UTC (rev 43263)
@@ -1765,16 +1765,16 @@
        public class CompilerCallableEntryPoint : MarshalByRefObject {
                static bool used = false;
                
-               public static bool InvokeCompiler (string [] args)
+               public static bool InvokeCompiler (string [] args, TextWriter 
error)
                {
-                       if (used)
-                               Reset ();
-                       else
-                               used = true;
+                       Report.Stderr = error;
+                       bool ret = Driver.MainDriver (args) && Report.Errors == 
0;
+                       Report.Stderr = Console.Error;
 
-                       return Driver.MainDriver (args) && Report.Errors == 0;
+                       Reset ();
+                       return ret;
                }
-
+               
                static void Reset ()
                {
                        Driver.Reset ();

Modified: trunk/mcs/gmcs/report.cs
===================================================================
--- trunk/mcs/gmcs/report.cs    2005-04-19 14:54:33 UTC (rev 43262)
+++ trunk/mcs/gmcs/report.cs    2005-04-19 14:56:04 UTC (rev 43263)
@@ -10,6 +10,7 @@
 // FIXME: currently our class library does not support custom number format 
strings
 //
 using System;
+using System.IO;
 using System.Text;
 using System.Collections;
 using System.Collections.Specialized;
@@ -47,6 +48,8 @@
                ///   Whether to dump a stack trace on errors. 
                /// </summary>
                static public bool Stacktrace;
+
+               static public TextWriter Stderr = Console.Error;
                
                //
                // If the 'expected' error code is reported then the
@@ -100,10 +103,10 @@
                                        msg.Append (' ');
                                }
                                msg.AppendFormat ("{0} CS{1:0000}: {2}", 
MessageType, code, text);
-                               Console.Error.WriteLine (msg.ToString ());
+                               Stderr.WriteLine (msg.ToString ());
 
                                foreach (string s in extra_information) 
-                                       Console.Error.WriteLine (s + 
MessageType);
+                                       Stderr.WriteLine (s + MessageType);
 
                                extra_information.Clear ();
 
@@ -279,7 +282,7 @@
                
                static public void LocationOfPreviousError (Location loc)
                {
-                       Console.Error.WriteLine (String.Format ("{0}({1}) 
(Location of symbol related to previous error)", loc.Name, loc.Row));
+                       Stderr.WriteLine (String.Format ("{0}({1}) (Location of 
symbol related to previous error)", loc.Name, loc.Row));
                }    
         
                static public void RuntimeMissingSupport (Location loc, string 
feature) 

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

Reply via email to