Author: martin
Date: 2006-09-27 05:53:20 -0400 (Wed, 27 Sep 2006)
New Revision: 65953

Modified:
   branches/martin/anonymous-methods/mcs/ChangeLog
   branches/martin/anonymous-methods/mcs/class.cs
   branches/martin/anonymous-methods/mcs/codegen.cs
   branches/martin/anonymous-methods/mcs/const.cs
   branches/martin/anonymous-methods/mcs/cs-tokenizer.cs
   branches/martin/anonymous-methods/mcs/driver.cs
   branches/martin/anonymous-methods/mcs/ecore.cs
   branches/martin/anonymous-methods/mcs/report.cs
Log:
Merged from HEAD.

Modified: branches/martin/anonymous-methods/mcs/ChangeLog
===================================================================
--- branches/martin/anonymous-methods/mcs/ChangeLog     2006-09-27 09:36:59 UTC 
(rev 65952)
+++ branches/martin/anonymous-methods/mcs/ChangeLog     2006-09-27 09:53:20 UTC 
(rev 65953)
@@ -1,3 +1,16 @@
+2006-09-27  Martin Baulig  <[EMAIL PROTECTED]>
+
+       * report.cs
+       (InternalErrorException): Added overloaded ctor taking a params array.
+
+2006-09-26  Marek Safar  <[EMAIL PROTECTED]>
+
+       * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
+       Fixed the cases when same error was reported twice.
+
+       * report.cs (SymbolRelatedToPreviousError): Simplified as all our 
messages
+       now report symbol information.
+
 2006-09-25  Martin Baulig  <[EMAIL PROTECTED]>
 
        * class.cs: Completely unified with the gmcs version.

Modified: branches/martin/anonymous-methods/mcs/class.cs
===================================================================
--- branches/martin/anonymous-methods/mcs/class.cs      2006-09-27 09:36:59 UTC 
(rev 65952)
+++ branches/martin/anonymous-methods/mcs/class.cs      2006-09-27 09:53:20 UTC 
(rev 65953)
@@ -4890,10 +4890,6 @@
                                // but it wont get cleared
                                //
                                if (member.IsExplicitImpl){
-                                       if ((modifiers & (Modifiers.PUBLIC | 
Modifiers.ABSTRACT | Modifiers.VIRTUAL)) != 0){
-                                               Modifiers.Error_InvalidModifier 
(method.Location, "public, virtual or abstract");
-                                               implementing = null;
-                                       }
                                        if (method.ParameterInfo.HasParams && 
!TypeManager.GetParameterData (implementing).HasParams) {
                                                
Report.SymbolRelatedToPreviousError (implementing);
                                                Report.Error (466, 
method.Location, "`{0}': the explicit interface implementation cannot introduce 
the params modifier",
@@ -5335,7 +5331,6 @@
                                if (!Parent.PartialContainer.VerifyImplements 
(this))
                                        return false;
                                
-                               Modifiers.Check 
(Modifiers.AllowedExplicitImplFlags, explicit_mod_flags, 0, Location);
                                
                        }
                        return true;
@@ -6886,8 +6881,10 @@
                        }
 
                        if (a.Target == AttributeTargets.Method) {
+                               int errors = Report.Errors;
                                Add.ApplyAttributeBuilder (a, cb);
-                               Remove.ApplyAttributeBuilder (a, cb);
+                               if (errors == Report.Errors)
+                                       Remove.ApplyAttributeBuilder (a, cb);
                                return;
                        }
 

Modified: branches/martin/anonymous-methods/mcs/codegen.cs
===================================================================
--- branches/martin/anonymous-methods/mcs/codegen.cs    2006-09-27 09:36:59 UTC 
(rev 65952)
+++ branches/martin/anonymous-methods/mcs/codegen.cs    2006-09-27 09:53:20 UTC 
(rev 65953)
@@ -1097,13 +1097,6 @@
 
                protected Attribute ResolveAttribute (Type a_type)
                {
-                       if (OptAttributes == null)
-                               return null;
-
-                       // Ensure that we only have GlobalAttributes, since the 
Search below isn't safe with other types.
-                       if (!OptAttributes.CheckTargets ())
-                               return null;
-
                        Attribute a = OptAttributes.Search (a_type);
                        if (a != null) {
                                a.Resolve ();
@@ -1183,6 +1176,13 @@
 
                public void Resolve ()
                {
+                       if (OptAttributes == null)
+                               return;
+
+                       // Ensure that we only have GlobalAttributes, since the 
Search isn't safe with other types.
+                       if (!OptAttributes.CheckTargets())
+                               return;
+
                        ClsCompliantAttribute = ResolveAttribute 
(TypeManager.cls_compliant_attribute_type);
                        if (ClsCompliantAttribute != null) {
                                is_cls_compliant = 
ClsCompliantAttribute.GetClsCompliantAttributeValue ();
@@ -1558,9 +1558,15 @@
                /// <summary>
                /// It is called very early therefore can resolve only 
predefined attributes
                /// </summary>
-               public void ResolveAttributes ()
+               public void Resolve ()
                {
 #if GMCS_SOURCE
+                       if (OptAttributes == null)
+                               return;
+
+                       if (!OptAttributes.CheckTargets())
+                               return;
+
                        Attribute a = ResolveAttribute 
(TypeManager.default_charset_type);
                        if (a != null) {
                                DefaultCharSet = a.GetCharSetValue ();

Modified: branches/martin/anonymous-methods/mcs/const.cs
===================================================================
--- branches/martin/anonymous-methods/mcs/const.cs      2006-09-27 09:36:59 UTC 
(rev 65952)
+++ branches/martin/anonymous-methods/mcs/const.cs      2006-09-27 09:53:20 UTC 
(rev 65953)
@@ -26,6 +26,7 @@
        public class Const : FieldMember, IConstant {
                Constant value;
                bool in_transit;
+               bool define_called;
 
                public const int AllowedModifiers =
                        Modifiers.NEW |
@@ -58,10 +59,14 @@
                /// </summary>
                public override bool Define ()
                {
-                       // Make Define () idempotent, but ensure that the error 
check happens.
-                       if (FieldBuilder != null)
-                               return base.CheckBase ();
+                       // Because constant define can be called from other 
class
+                       if (define_called) {
+                               CheckBase ();
+                               return FieldBuilder != null;
+                       }
 
+                       define_called = true;
+
                        if (!base.Define ())
                                return false;
 

Modified: branches/martin/anonymous-methods/mcs/cs-tokenizer.cs
===================================================================
--- branches/martin/anonymous-methods/mcs/cs-tokenizer.cs       2006-09-27 
09:36:59 UTC (rev 65952)
+++ branches/martin/anonymous-methods/mcs/cs-tokenizer.cs       2006-09-27 
09:53:20 UTC (rev 65953)
@@ -1565,7 +1565,6 @@
                        bool v = pp_expr (ref s);
                        s = s.Trim ();
                        if (s.Length != 0){
-                               Error_InvalidDirective ();
                                return false;
                        }
 
@@ -2318,10 +2317,9 @@
                                int state = (int) ifstack.Pop ();
                                if ((state & REGION) != 0)
                                        Report.Error (1038, Location, 
"#endregion directive expected");
-                               else 
-                                       Report.Error (1027, Location, "Expected 
`#endif' directive");
+//                             else 
+//                                     Report.Error (1027, Location, "Expected 
`#endif' directive");
                        }
-                               
                }
        }
 

Modified: branches/martin/anonymous-methods/mcs/driver.cs
===================================================================
--- branches/martin/anonymous-methods/mcs/driver.cs     2006-09-27 09:36:59 UTC 
(rev 65952)
+++ branches/martin/anonymous-methods/mcs/driver.cs     2006-09-27 09:53:20 UTC 
(rev 65953)
@@ -1653,7 +1653,7 @@
                        if (timestamps)
                                ShowTime ("   Core Types done");
 
-                       CodeGen.Module.ResolveAttributes ();
+                       CodeGen.Module.Resolve ();
 
                        //
                        // The second pass of the compiler

Modified: branches/martin/anonymous-methods/mcs/ecore.cs
===================================================================
--- branches/martin/anonymous-methods/mcs/ecore.cs      2006-09-27 09:36:59 UTC 
(rev 65952)
+++ branches/martin/anonymous-methods/mcs/ecore.cs      2006-09-27 09:53:20 UTC 
(rev 65953)
@@ -239,9 +239,11 @@
                        if (te == null)
                                return null;
 
-                       ObsoleteAttribute obsolete_attr = 
AttributeTester.GetObsoleteAttribute (te.Type);
-                       if (obsolete_attr != null && !ec.IsInObsoleteScope) {
-                               AttributeTester.Report_ObsoleteMessage 
(obsolete_attr, te.GetSignatureForError (), Location);
+                       if (!silent) {
+                               ObsoleteAttribute obsolete_attr = 
AttributeTester.GetObsoleteAttribute (te.Type);
+                               if (obsolete_attr != null && 
!ec.IsInObsoleteScope) {
+                                       AttributeTester.Report_ObsoleteMessage 
(obsolete_attr, te.GetSignatureForError (), Location);
+                               }
                        }
 
                        // Constrains don't need to be checked for overrides

Modified: branches/martin/anonymous-methods/mcs/report.cs
===================================================================
--- branches/martin/anonymous-methods/mcs/report.cs     2006-09-27 09:36:59 UTC 
(rev 65952)
+++ branches/martin/anonymous-methods/mcs/report.cs     2006-09-27 09:53:20 UTC 
(rev 65953)
@@ -131,7 +131,7 @@
                                Stderr.WriteLine (msg.ToString ());
 
                                foreach (string s in extra_information) 
-                                       Stderr.WriteLine (s + MessageType);
+                                       Stderr.WriteLine (s + MessageType + 
")");
 
                                extra_information.Clear ();
 
@@ -354,7 +354,7 @@
 
                static void SymbolRelatedToPreviousError (string loc, string 
symbol)
                {
-                       extra_information.Add (String.Format ("{0}: `{1}', name 
of symbol related to previous ", loc, symbol));
+                       extra_information.Add (String.Format ("{0} (Location of 
the symbol related to previous ", loc));
                }
 
                public static void ExtraInformation (Location loc, string msg)
@@ -635,6 +635,10 @@
                        : base (message)
                {
                }
+
+               public InternalErrorException (string message, params object[] 
args)
+                       : base (String.Format (message, args))
+               { }
        }
 
        /// <summary>

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

Reply via email to