*** merged revision 58196 from mcs
authorRaja R Harinath <harinath@hurrynot.org>
Tue, 28 Mar 2006 09:41:30 +0000 (09:41 -0000)
committerRaja R Harinath <harinath@hurrynot.org>
Tue, 28 Mar 2006 09:41:30 +0000 (09:41 -0000)
svn path=/trunk/mcs/; revision=58645

22 files changed:
mcs/gmcs/ChangeLog
mcs/gmcs/assign.cs
mcs/gmcs/attribute.cs
mcs/gmcs/class.cs
mcs/gmcs/codegen.cs
mcs/gmcs/constant.cs
mcs/gmcs/cs-parser.jay
mcs/gmcs/cs-tokenizer.cs
mcs/gmcs/decl.cs
mcs/gmcs/delegate.cs
mcs/gmcs/doc.cs
mcs/gmcs/driver.cs
mcs/gmcs/ecore.cs
mcs/gmcs/enum.cs
mcs/gmcs/expression.cs
mcs/gmcs/flowanalysis.cs
mcs/gmcs/iterators.cs
mcs/gmcs/location.cs
mcs/gmcs/namespace.cs
mcs/gmcs/report.cs
mcs/gmcs/statement.cs
mcs/gmcs/typemanager.cs

index a0df069896fae6609b08acf3448c236208e1527b..de0c3475664c190986eb5f9cfc454f56b68ec39c 100644 (file)
@@ -1,3 +1,60 @@
+2006-03-20  Marek Safar  <marek.safar@seznam.cz>
+
+       * assign.cs (CompoundAssign.ResolveSource): Removed.
+
+       * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
+       clean up.
+
+       * class.cs (TypeContainer.FindMethods): Removed.
+       (TypeContainer.CheckMemberUsage): Made static.
+
+       * codegen.cs (GetAssemblyName): Uses Length for empty string test.
+
+       * constant.cs (CheckRange): Removed unused type argument.
+       (CheckUnsigned): Removed unused type argument.
+
+       * cs-parser.jay: Updated after MemberAccess clean up.
+       Uses Length for empty string test.
+
+       * cs-tokenizer.cs: Uses Length for empty string test.
+       (IsCastToken): Made static.
+       (is_hex): Made static.
+       (real_type_suffix): Made static.
+
+       * decl.cs (SetupCache): Made static.
+       (OnGenerateDocComment): Removed unused ds argument.
+
+       * delegate.cs (VerifyDelegate): Removed unused argument.
+
+       * doc.cs: Uses Length for empty string test.
+
+       * driver.cs: Uses Length for empty string test.
+
+       * enum.cs (IsValidEnumType): Made static
+
+       * expression.cs (EnumLiftUp): Removed unused argument.
+       (ResolveMethodGroup): Ditto.
+       (BetterConversion): Ditto.
+       (GetVarargsTypes): Ditto.
+       (UpdateIndices): Ditto.
+       (ValidateInitializers): Ditto.
+       (MemberAccess.ctor): Ditto.
+       (GetIndexersForType): Ditto.
+
+       * flowanalysis.cs: (MergeFinally): Removed unused argument.
+
+       * iterators.cs: Updated after MemberAccess clean up.
+
+       * location.cs: Uses Length for empty string test.
+
+       * namespace.cs: Uses Length for empty string test.
+
+        * report.cs (CheckWarningCode): Made static.
+
+       * statement.cs (LabeledStatement): Removed unused argument.
+
+       * typemanager.cs (FilterNone): Removed.
+
 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
 
        * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
index 618635a473beed72d274acae4846f42ce09ca224..7c835434c2d350b568af83c610078ba52bbb8217 100644 (file)
@@ -604,11 +604,6 @@ namespace Mono.CSharp {
                        return new CompoundAssign (this, loc);
                }
 
-               public Expression ResolveSource (EmitContext ec)
-               {
-                       return original_source.Resolve (ec);
-               }
-
                public override Expression DoResolve (EmitContext ec)
                {
                        original_source = original_source.Resolve (ec);
index 8c7315b64e3190b208d947c4c170d13f50217f32..a6eb8607d8bb9763f8ca60398a24e1d4cb67aed9 100644 (file)
@@ -184,7 +184,7 @@ namespace Mono.CSharp {
                        if (LeftExpr == null) {
                                te = ResolveAsTypeTerminal (new SimpleName (name, Location), rc, silent);
                        } else {
-                               te = ResolveAsTypeTerminal (new MemberAccess (LeftExpr, name, Location), rc, silent);
+                               te = ResolveAsTypeTerminal (new MemberAccess (LeftExpr, name), rc, silent);
                        }
 
                        if (te == null)
@@ -951,7 +951,7 @@ namespace Mono.CSharp {
                        ps.AddPermission (perm);
                }
 
-               object GetValue (object value)
+               static object GetValue (object value)
                {
                        if (value is EnumConstant)
                                return ((EnumConstant) value).GetValue ();
index 97417bf8bf90b9c62f133cbe11a02e95bb21f541..01ab084f1e80d60043af4fbf8b1ccb55580d7fef 100644 (file)
@@ -2097,16 +2097,6 @@ namespace Mono.CSharp {
                                return new MemberList (t.FindMembers (mt, bf, filter, criteria));
                }
 
-               //
-               // FindMethods will look for methods not only in the type `t', but in
-               // any interfaces implemented by the type.
-               //
-               public static MethodInfo [] FindMethods (Type t, BindingFlags bf,
-                                                        MemberFilter filter, object criteria)
-               {
-                       return null;
-               }
-
                /// <summary>
                ///   Emits the values for the constants
                /// </summary>
@@ -2118,7 +2108,7 @@ namespace Mono.CSharp {
                        return;
                }
 
-               void CheckMemberUsage (MemberCoreArrayList al, string member_type)
+               static void CheckMemberUsage (MemberCoreArrayList al, string member_type)
                {
                        if (al == null)
                                return;
@@ -3560,9 +3550,9 @@ namespace Mono.CSharp {
                // FIXME: with a few effort, it could be done with XmlReader,
                // that means removal of DOM use.
                //
-               internal override void OnGenerateDocComment (DeclSpace ds, XmlElement el)
+               internal override void OnGenerateDocComment (XmlElement el)
                {
-                       DocUtil.OnMethodGenerateDocComment (this, ds, el);
+                       DocUtil.OnMethodGenerateDocComment (this, el);
                }
 
                //
@@ -3983,7 +3973,7 @@ namespace Mono.CSharp {
                        if (ParameterInfo.Count > 0) {
                                ArrayList al = (ArrayList)ParentContainer.MemberCache.Members [Name];
                                if (al.Count > 1)
-                                       ParentContainer.MemberCache.VerifyClsParameterConflict (al, this, MethodBuilder);
+                                       MemberCache.VerifyClsParameterConflict (al, this, MethodBuilder);
                        }
 
                        return true;
@@ -4495,7 +4485,7 @@ namespace Mono.CSharp {
                        if (ParameterInfo.Count > 0) {
                                ArrayList al = (ArrayList)Parent.MemberCache.Members [".ctor"];
                                if (al.Count > 3)
-                                       Parent.MemberCache.VerifyClsParameterConflict (al, this, ConstructorBuilder);
+                                       MemberCache.VerifyClsParameterConflict (al, this, ConstructorBuilder);
  
                                if (Parent.TypeBuilder.IsSubclassOf (TypeManager.attribute_type)) {
                                        foreach (Type param in ParameterTypes) {
index 0abc3bc1cefb72f2fdbd4faa493332cd1f72e3f6..203a876ca9aecf6f3027db6efd3b105779ccaaa4 100644 (file)
@@ -1169,7 +1169,7 @@ namespace Mono.CSharp {
                                                        }
                                                        else {
                                                                string value = a.GetString ();
-                                                               if (value != String.Empty)
+                                                               if (value.Length != 0)
                                                                        RootContext.StrongNameKeyFile = value;
                                                        }
                                                        break;
@@ -1183,7 +1183,7 @@ namespace Mono.CSharp {
                                                        }
                                                        else {
                                                                string value = a.GetString ();
-                                                               if (value != String.Empty)
+                                                               if (value.Length != 0)
                                                                        RootContext.StrongNameKeyContainer = value;
                                                        }
                                                        break;
index 339b97d870076ce439d66b3449ea2f477c96130d..7b6d9d25e360010aaa27a29dcfa65ceb9f15e619 100644 (file)
@@ -212,7 +212,7 @@ namespace Mono.CSharp {
                        return retval;
                }
 
-               protected void CheckRange (EmitContext ec, ulong value, Type type, ulong max)
+               protected static void CheckRange (EmitContext ec, ulong value, ulong max)
                {
                        if (!ec.ConstantCheckState)
                                return;
@@ -221,7 +221,7 @@ namespace Mono.CSharp {
                                throw new OverflowException ();
                }
 
-               protected void CheckRange (EmitContext ec, double value, Type type, long min, long max)
+               protected static void CheckRange (EmitContext ec, double value, long min, long max)
                {
                        if (!ec.ConstantCheckState)
                                return;
@@ -230,7 +230,7 @@ namespace Mono.CSharp {
                                throw new OverflowException ();
                }
 
-               protected void CheckUnsigned (EmitContext ec, long value, Type type)
+               protected static void CheckUnsigned (EmitContext ec, long value)
                {
                        if (!ec.ConstantCheckState)
                                return;
@@ -470,7 +470,7 @@ namespace Mono.CSharp {
                public override Constant Reduce (EmitContext ec, Type target_type)
                {
                        if (target_type == TypeManager.sbyte_type) {
-                               CheckRange (ec, Value, target_type, SByte.MinValue, SByte.MaxValue);
+                               CheckRange (ec, Value, SByte.MinValue, SByte.MaxValue);
                                return new SByteConstant ((sbyte) Value, Location);
                        }
                        if (target_type == TypeManager.short_type)
@@ -608,15 +608,15 @@ namespace Mono.CSharp {
                public override Constant Reduce (EmitContext ec, Type target_type)
                {
                        if (target_type == TypeManager.byte_type) {
-                               CheckRange (ec, Value, target_type, Byte.MinValue, Byte.MaxValue);
+                               CheckRange (ec, Value, Byte.MinValue, Byte.MaxValue);
                                return new ByteConstant ((byte) Value, Location);
                        }
                        if (target_type == TypeManager.sbyte_type) {
-                               CheckRange (ec, Value, target_type, SByte.MinValue, SByte.MaxValue);
+                               CheckRange (ec, Value, SByte.MinValue, SByte.MaxValue);
                                return new SByteConstant ((sbyte) Value, Location);
                        }
                        if (target_type == TypeManager.short_type) {
-                               CheckRange (ec, Value, target_type, Int16.MinValue, Int16.MaxValue);
+                               CheckRange (ec, Value, Int16.MinValue, Int16.MaxValue);
                                return new ShortConstant ((short) Value, Location);
                        }
                        if (target_type == TypeManager.int32_type)
@@ -722,23 +722,23 @@ namespace Mono.CSharp {
                public override Constant Reduce (EmitContext ec, Type target_type)
                {
                        if (target_type == TypeManager.byte_type) {
-                               CheckUnsigned (ec, Value, target_type);
+                               CheckUnsigned (ec, Value);
                                return new ByteConstant ((byte) Value, Location);
                        }
                        if (target_type == TypeManager.short_type)
                                return new ShortConstant ((short) Value, Location);
                        if (target_type == TypeManager.ushort_type) {
-                               CheckUnsigned (ec, Value, target_type);
+                               CheckUnsigned (ec, Value);
                                return new UShortConstant ((ushort) Value, Location);
                        } if (target_type == TypeManager.int32_type)
                                  return new IntConstant ((int) Value, Location);
                        if (target_type == TypeManager.uint32_type) {
-                               CheckUnsigned (ec, Value, target_type);
+                               CheckUnsigned (ec, Value);
                                return new UIntConstant ((uint) Value, Location);
                        } if (target_type == TypeManager.int64_type)
                                  return new LongConstant ((long) Value, Location);
                        if (target_type == TypeManager.uint64_type) {
-                               CheckUnsigned (ec, Value, target_type);
+                               CheckUnsigned (ec, Value);
                                return new ULongConstant ((ulong) Value, Location);
                        }
                        if (target_type == TypeManager.float_type)
@@ -746,7 +746,7 @@ namespace Mono.CSharp {
                        if (target_type == TypeManager.double_type)
                                return new DoubleConstant ((double) Value, Location);
                        if (target_type == TypeManager.char_type) {
-                               CheckUnsigned (ec, Value, target_type);
+                               CheckUnsigned (ec, Value);
                                return new CharConstant ((char) Value, Location);
                        }
                        if (target_type == TypeManager.decimal_type)
@@ -837,27 +837,27 @@ namespace Mono.CSharp {
                public override Constant Reduce (EmitContext ec, Type target_type)
                {
                        if (target_type == TypeManager.byte_type) {
-                               CheckRange (ec, Value, target_type, Byte.MinValue, Byte.MaxValue);
+                               CheckRange (ec, Value, Byte.MinValue, Byte.MaxValue);
                                return new ByteConstant ((byte) Value, Location);
                        }
                        if (target_type == TypeManager.sbyte_type) {
-                               CheckRange (ec, Value, target_type, SByte.MinValue, SByte.MaxValue);
+                               CheckRange (ec, Value, SByte.MinValue, SByte.MaxValue);
                                return new SByteConstant ((sbyte) Value, Location);
                        }
                        if (target_type == TypeManager.ushort_type) {
-                               CheckUnsigned (ec, Value, target_type);
+                               CheckUnsigned (ec, Value);
                                return new UShortConstant ((ushort) Value, Location);
                        }
                        if (target_type == TypeManager.int32_type)
                                return new IntConstant ((int) Value, Location);
                        if (target_type == TypeManager.uint32_type) {
-                               CheckUnsigned (ec, Value, target_type);
+                               CheckUnsigned (ec, Value);
                                return new UIntConstant ((uint) Value, Location);
                        }
                        if (target_type == TypeManager.int64_type)
                                return new LongConstant ((long) Value, Location);
                        if (target_type == TypeManager.uint64_type) {
-                               CheckUnsigned (ec, Value, target_type);
+                               CheckUnsigned (ec, Value);
                                return new ULongConstant ((ulong) Value, Location);
                        }
                        if (target_type == TypeManager.float_type)
@@ -865,7 +865,7 @@ namespace Mono.CSharp {
                        if (target_type == TypeManager.double_type)
                                return new DoubleConstant ((double) Value, Location);
                        if (target_type == TypeManager.char_type) {
-                               CheckRange (ec, Value, target_type, Char.MinValue, Char.MaxValue);
+                               CheckRange (ec, Value, Char.MinValue, Char.MaxValue);
                                return new CharConstant ((char) Value, Location);
                        }
                        if (target_type == TypeManager.decimal_type)
@@ -956,15 +956,15 @@ namespace Mono.CSharp {
                public override Constant Reduce (EmitContext ec, Type target_type)
                {
                        if (target_type == TypeManager.byte_type) {
-                               CheckRange (ec, Value, target_type, Byte.MinValue, Byte.MaxValue);
+                               CheckRange (ec, Value, Byte.MinValue, Byte.MaxValue);
                                return new ByteConstant ((byte) Value, Location);
                        }
                        if (target_type == TypeManager.sbyte_type) {
-                               CheckRange (ec, Value, target_type, SByte.MinValue, SByte.MaxValue);
+                               CheckRange (ec, Value, SByte.MinValue, SByte.MaxValue);
                                return new SByteConstant ((sbyte) Value, Location);
                        }
                        if (target_type == TypeManager.short_type) {
-                               CheckRange (ec, Value, target_type, Int16.MinValue, Int16.MaxValue);
+                               CheckRange (ec, Value, Int16.MinValue, Int16.MaxValue);
                                return new ShortConstant ((short) Value, Location);
                        }
                        if (target_type == TypeManager.int32_type)
@@ -980,7 +980,7 @@ namespace Mono.CSharp {
                        if (target_type == TypeManager.double_type)
                                return new DoubleConstant ((double) Value, Location);
                        if (target_type == TypeManager.char_type) {
-                               CheckRange (ec, Value, target_type, Char.MinValue, Char.MaxValue);
+                               CheckRange (ec, Value, Char.MinValue, Char.MaxValue);
                                return new CharConstant ((char) Value, Location);
                        }
                        if (target_type == TypeManager.decimal_type)
@@ -1133,29 +1133,29 @@ namespace Mono.CSharp {
                public override Constant Reduce (EmitContext ec, Type target_type)
                {
                        if (target_type == TypeManager.byte_type) {
-                               CheckRange (ec, Value, target_type, Byte.MinValue, Byte.MaxValue);
+                               CheckRange (ec, Value, Byte.MinValue, Byte.MaxValue);
                                return new ByteConstant ((byte) Value, Location);
                        }
                        if (target_type == TypeManager.sbyte_type) {
-                               CheckRange (ec, Value, target_type, SByte.MinValue, SByte.MaxValue);
+                               CheckRange (ec, Value, SByte.MinValue, SByte.MaxValue);
                                return new SByteConstant ((sbyte) Value, Location);
                        }
                        if (target_type == TypeManager.short_type) {
-                               CheckRange (ec, Value, target_type, Int16.MinValue, Int16.MaxValue);
+                               CheckRange (ec, Value, Int16.MinValue, Int16.MaxValue);
                                return new ShortConstant ((short) Value, Location);
                        }
                        if (target_type == TypeManager.ushort_type) {
-                               CheckRange (ec, Value, target_type, UInt16.MinValue, UInt16.MaxValue);
+                               CheckRange (ec, Value, UInt16.MinValue, UInt16.MaxValue);
                                return new UShortConstant ((ushort) Value, Location);
                        }
                        if (target_type == TypeManager.uint32_type) {
-                               CheckRange (ec, Value, target_type, Int32.MinValue, Int32.MaxValue);
+                               CheckRange (ec, Value, Int32.MinValue, Int32.MaxValue);
                                return new UIntConstant ((uint) Value, Location);
                        }
                        if (target_type == TypeManager.int64_type)
                                return new LongConstant ((long) Value, Location);
                        if (target_type == TypeManager.uint64_type) {
-                               CheckUnsigned (ec, Value, target_type);
+                               CheckUnsigned (ec, Value);
                                return new ULongConstant ((ulong) Value, Location);
                        }
                        if (target_type == TypeManager.float_type)
@@ -1163,7 +1163,7 @@ namespace Mono.CSharp {
                        if (target_type == TypeManager.double_type)
                                return new DoubleConstant ((double) Value, Location);
                        if (target_type == TypeManager.char_type) {
-                               CheckRange (ec, Value, target_type, Char.MinValue, Char.MaxValue);
+                               CheckRange (ec, Value, Char.MinValue, Char.MaxValue);
                                return new CharConstant ((char) Value, Location);
                        }
                        if (target_type == TypeManager.decimal_type)
@@ -1253,23 +1253,23 @@ namespace Mono.CSharp {
                public override Constant Reduce (EmitContext ec, Type target_type)
                {
                        if (target_type == TypeManager.byte_type) {
-                               CheckRange (ec, Value, target_type, Char.MinValue, Char.MaxValue);
+                               CheckRange (ec, Value, Char.MinValue, Char.MaxValue);
                                return new ByteConstant ((byte) Value, Location);
                        }
                        if (target_type == TypeManager.sbyte_type) {
-                               CheckRange (ec, Value, target_type, SByte.MinValue, SByte.MaxValue);
+                               CheckRange (ec, Value, SByte.MinValue, SByte.MaxValue);
                                return new SByteConstant ((sbyte) Value, Location);
                        }
                        if (target_type == TypeManager.short_type) {
-                               CheckRange (ec, Value, target_type, Int16.MinValue, Int16.MaxValue);
+                               CheckRange (ec, Value, Int16.MinValue, Int16.MaxValue);
                                return new ShortConstant ((short) Value, Location);
                        }
                        if (target_type == TypeManager.ushort_type) {
-                               CheckRange (ec, Value, target_type, UInt16.MinValue, UInt16.MaxValue);
+                               CheckRange (ec, Value, UInt16.MinValue, UInt16.MaxValue);
                                return new UShortConstant ((ushort) Value, Location);
                        }
                        if (target_type == TypeManager.int32_type) {
-                               CheckRange (ec, Value, target_type, Int32.MinValue, Int32.MaxValue);
+                               CheckRange (ec, Value, Int32.MinValue, Int32.MaxValue);
                                return new IntConstant ((int) Value, Location);
                        }
                        if (target_type == TypeManager.int64_type)
@@ -1281,7 +1281,7 @@ namespace Mono.CSharp {
                        if (target_type == TypeManager.double_type)
                                return new DoubleConstant ((double) Value, Location);
                        if (target_type == TypeManager.char_type) {
-                               CheckRange (ec, Value, target_type, Char.MinValue, Char.MaxValue);
+                               CheckRange (ec, Value, Char.MinValue, Char.MaxValue);
                                return new CharConstant ((char) Value, Location);
                        }
                        if (target_type == TypeManager.decimal_type)
@@ -1387,31 +1387,31 @@ namespace Mono.CSharp {
                public override Constant Reduce (EmitContext ec, Type target_type)
                {
                        if (target_type == TypeManager.byte_type) {
-                               CheckRange (ec, Value, target_type, Byte.MinValue, Byte.MaxValue);
+                               CheckRange (ec, Value, Byte.MinValue, Byte.MaxValue);
                                return new ByteConstant ((byte) Value, Location);
                        }
                        if (target_type == TypeManager.sbyte_type) {
-                               CheckRange (ec, Value, target_type, SByte.MinValue, SByte.MaxValue);
+                               CheckRange (ec, Value, SByte.MinValue, SByte.MaxValue);
                                return new SByteConstant ((sbyte) Value, Location);
                        }
                        if (target_type == TypeManager.short_type) {
-                               CheckRange (ec, Value, target_type, Int16.MinValue, Int16.MaxValue);
+                               CheckRange (ec, Value, Int16.MinValue, Int16.MaxValue);
                                return new ShortConstant ((short) Value, Location);
                        }
                        if (target_type == TypeManager.ushort_type) {
-                               CheckRange (ec, Value, target_type, UInt16.MinValue, UInt16.MaxValue);
+                               CheckRange (ec, Value, UInt16.MinValue, UInt16.MaxValue);
                                return new UShortConstant ((ushort) Value, Location);
                        }
                        if (target_type == TypeManager.int32_type) {
-                               CheckRange (ec, Value, target_type, Int32.MinValue, Int32.MaxValue);
+                               CheckRange (ec, Value, Int32.MinValue, Int32.MaxValue);
                                return new IntConstant ((int) Value, Location);
                        }
                        if (target_type == TypeManager.uint32_type) {
-                               CheckRange (ec, Value, target_type, UInt32.MinValue, UInt32.MaxValue);
+                               CheckRange (ec, Value, UInt32.MinValue, UInt32.MaxValue);
                                return new UIntConstant ((uint) Value, Location);
                        }
                        if (target_type == TypeManager.uint64_type) {
-                               CheckUnsigned (ec, Value, target_type);
+                               CheckUnsigned (ec, Value);
                                return new ULongConstant ((ulong) Value, Location);
                        }
                        if (target_type == TypeManager.float_type)
@@ -1419,7 +1419,7 @@ namespace Mono.CSharp {
                        if (target_type == TypeManager.double_type)
                                return new DoubleConstant ((double) Value, Location);
                        if (target_type == TypeManager.char_type) {
-                               CheckRange (ec, Value, target_type, Char.MinValue, Char.MaxValue);
+                               CheckRange (ec, Value, Char.MinValue, Char.MaxValue);
                                return new CharConstant ((char) Value, Location);
                        }
                        if (target_type == TypeManager.decimal_type)
@@ -1512,31 +1512,31 @@ namespace Mono.CSharp {
                public override Constant Reduce (EmitContext ec, Type target_type)
                {
                        if (target_type == TypeManager.byte_type) {
-                               CheckRange (ec, Value, target_type, Byte.MaxValue);
+                               CheckRange (ec, Value, Byte.MaxValue);
                                return new ByteConstant ((byte) Value, Location);
                        }
                        if (target_type == TypeManager.sbyte_type) {
-                               CheckRange (ec, Value, target_type, (ulong) SByte.MaxValue);
+                               CheckRange (ec, Value, (ulong) SByte.MaxValue);
                                return new SByteConstant ((sbyte) Value, Location);
                        }
                        if (target_type == TypeManager.short_type) {
-                               CheckRange (ec, Value, target_type, (ulong) Int16.MaxValue);
+                               CheckRange (ec, Value, (ulong) Int16.MaxValue);
                                return new ShortConstant ((short) Value, Location);
                        }
                        if (target_type == TypeManager.ushort_type) {
-                               CheckRange (ec, Value, target_type, UInt16.MaxValue);
+                               CheckRange (ec, Value, UInt16.MaxValue);
                                return new UShortConstant ((ushort) Value, Location);
                        }
                        if (target_type == TypeManager.int32_type) {
-                               CheckRange (ec, Value, target_type, Int32.MaxValue);
+                               CheckRange (ec, Value, Int32.MaxValue);
                                return new IntConstant ((int) Value, Location);
                        }
                        if (target_type == TypeManager.uint32_type) {
-                               CheckRange (ec, Value, target_type, UInt32.MaxValue);
+                               CheckRange (ec, Value, UInt32.MaxValue);
                                return new UIntConstant ((uint) Value, Location);
                        }
                        if (target_type == TypeManager.int64_type) {
-                               CheckRange (ec, Value, target_type, (ulong) Int64.MaxValue);
+                               CheckRange (ec, Value, (ulong) Int64.MaxValue);
                                return new LongConstant ((long) Value, Location);
                        }
                        if (target_type == TypeManager.float_type)
@@ -1544,7 +1544,7 @@ namespace Mono.CSharp {
                        if (target_type == TypeManager.double_type)
                                return new DoubleConstant ((double) Value, Location);
                        if (target_type == TypeManager.char_type) {
-                               CheckRange (ec, Value, target_type, Char.MaxValue);
+                               CheckRange (ec, Value, Char.MaxValue);
                                return new CharConstant ((char) Value, Location);
                        }
                        if (target_type == TypeManager.decimal_type)
@@ -1729,11 +1729,11 @@ namespace Mono.CSharp {
                public override Constant Reduce (EmitContext ec, Type target_type)
                {
                        if (target_type == TypeManager.byte_type) {
-                               CheckRange (ec, Value, target_type, Byte.MinValue, Byte.MaxValue);
+                               CheckRange (ec, Value, Byte.MinValue, Byte.MaxValue);
                                return new ByteConstant ((byte) Value, Location);
                        }
                        if (target_type == TypeManager.sbyte_type) {
-                               CheckRange (ec, Value, target_type, SByte.MinValue, SByte.MaxValue);
+                               CheckRange (ec, Value, SByte.MinValue, SByte.MaxValue);
                                return new SByteConstant ((sbyte) Value, Location);
                        }
                        if (target_type == TypeManager.short_type)
@@ -1751,7 +1751,7 @@ namespace Mono.CSharp {
                        if (target_type == TypeManager.float_type)
                                return new FloatConstant ((float) Value, Location);
                        if (target_type == TypeManager.char_type) {
-                               CheckRange (ec, Value, target_type, char.MinValue, char.MaxValue);
+                               CheckRange (ec, Value, char.MinValue, char.MaxValue);
                                return new CharConstant ((char) Value, Location);
                        }
                        if (target_type == TypeManager.decimal_type)
index d4fcae26f67a1080f93984572ac34f79626cc3c5..16591a2b0a146161daf3977d341569dd61919e03 100644 (file)
@@ -400,7 +400,7 @@ namespace_declaration
                        syntax_error (lexer.Location, "namespace name expected");
 
                current_namespace = new NamespaceEntry (
-                       current_namespace, file, name.GetName (), name.Location);
+                       current_namespace, file, name.GetName ());
          } 
          namespace_body opt_semicolon
          { 
@@ -2985,14 +2985,12 @@ member_access
        : primary_expression DOT IDENTIFIER opt_type_argument_list
          {
                LocatedToken lt = (LocatedToken) $3;
-               $$ = new MemberAccess ((Expression) $1, lt.Value,
-                                      (TypeArguments) $4, lt.Location);
+               $$ = new MemberAccess ((Expression) $1, lt.Value, (TypeArguments) $4);
          }
        | predefined_type DOT IDENTIFIER opt_type_argument_list
          {
                LocatedToken lt = (LocatedToken) $3;
-               $$ = new MemberAccess ((Expression) $1, lt.Value,
-                                      (TypeArguments) $4, lt.Location);
+               $$ = new MemberAccess ((Expression) $1, lt.Value, (TypeArguments) $4);
          }
        ;
 
@@ -3381,7 +3379,7 @@ pointer_member_access
                LocatedToken lt = (LocatedToken) $3;
 
                deref = new Unary (Unary.Operator.Indirection, (Expression) $1, lt.Location);
-               $$ = new MemberAccess (deref, lt.Value, lt.Location);
+               $$ = new MemberAccess (deref, lt.Value);
          }
        ;
 
@@ -4076,7 +4074,7 @@ labeled_statement
        : IDENTIFIER COLON 
          {
                LocatedToken lt = (LocatedToken) $1;
-               LabeledStatement labeled = new LabeledStatement (lt.Value, lt.Location);
+               LabeledStatement labeled = new LabeledStatement (lt.Location);
 
                if (current_block.AddLabel (lt.Value, labeled, lt.Location))
                        current_block.AddStatement (labeled);
@@ -5066,8 +5064,8 @@ MakeName (MemberName class_name)
 {
        Namespace ns = current_namespace.NS;
 
-       if (current_container.Name == ""){
-               if (ns.Name != "")
+       if (current_container.Name.Length == 0){
+               if (ns.Name.Length != 0)
                        return new MemberName (ns.MemberName, class_name);
                else
                        return class_name;
@@ -5231,7 +5229,7 @@ public Tokenizer Lexer {
 
 public CSharpParser (SeekableStreamReader reader, SourceFile file, ArrayList defines)
 {
-       current_namespace = new NamespaceEntry (null, file, null, Location.Null);
+       current_namespace = new NamespaceEntry (null, file, null);
        this.name = file.Name;
        this.file = file;
        current_container = RootContext.Tree.Types;
@@ -5268,7 +5266,7 @@ public void parse ()
        RootContext.Tree.Types.NamespaceEntry = null;
 }
 
-void CheckToken (int error, int yyToken, string msg, Location loc)
+static void CheckToken (int error, int yyToken, string msg, Location loc)
 {
        if (yyToken >= Token.FIRST_KEYWORD && yyToken <= Token.LAST_KEYWORD)
                Report.Error (error, loc, "{0}: `{1}' is a keyword", msg, yyNames [yyToken].ToLower ());
index e4de6f4efb87d99d54ea0104eb0369579e3df6f3..2e467f3abdd8772220a892f86775faf069ee6970 100644 (file)
@@ -478,7 +478,7 @@ namespace Mono.CSharp
                        // FIXME: This could be `Location.Push' but we have to
                        // find out why the MS compiler allows this
                        //
-                       Mono.CSharp.Location.Push (file, 0);
+                       Mono.CSharp.Location.Push (file);
                }
 
                static bool is_identifier_start_character (char c)
@@ -894,12 +894,12 @@ namespace Mono.CSharp
                        return seen_digits;
                }
 
-               bool is_hex (int e)
+               static bool is_hex (int e)
                {
                        return (e >= '0' && e <= '9') || (e >= 'A' && e <= 'F') || (e >= 'a' && e <= 'f');
                }
                                
-               int real_type_suffix (int c)
+               static int real_type_suffix (int c)
                {
                        int t;
 
@@ -1357,7 +1357,7 @@ namespace Mono.CSharp
                        return val;
                }
 
-               bool IsCastToken (int token)
+               static bool IsCastToken (int token)
                {
                        switch (token) {
                        case Token.BANG:
@@ -1478,13 +1478,13 @@ namespace Mono.CSharp
                //
                bool PreProcessLine (string arg)
                {
-                       if (arg == "")
+                       if (arg.Length == 0)
                                return false;
 
                        if (arg == "default"){
                                ref_line = line;
                                ref_name = file_name;
-                               Location.Push (ref_name, line);
+                               Location.Push (ref_name);
                                return true;
                        } else if (arg == "hidden"){
                                //
@@ -1506,7 +1506,7 @@ namespace Mono.CSharp
                                        ref_name = Location.LookupFile (name);
                                        file_name.HasLineDirective = true;
                                        ref_name.HasLineDirective = true;
-                                       Location.Push (ref_name, ref_line);
+                                       Location.Push (ref_name);
                                } else {
                                        ref_line = System.Int32.Parse (arg);
                                }
@@ -1522,7 +1522,7 @@ namespace Mono.CSharp
                //
                void PreProcessDefinition (bool is_define, string arg)
                {
-                       if (arg == "" || arg == "true" || arg == "false"){
+                       if (arg.Length == 0 || arg == "true" || arg == "false"){
                                Report.Error (1001, Location, "Missing identifer to pre-processor directive");
                                return;
                        }
@@ -1847,7 +1847,7 @@ namespace Mono.CSharp
                                goto case "endif";
                                
                        case "if":
-                               if (arg == ""){
+                               if (arg.Length == 0){
                                        Error_InvalidDirective ();
                                        return true;
                                }
index cde22505cb971842599aa9cec2e621ab1e28c9b7..384c2b554243407458233ad02d6c98d83d1f7fbc 100644 (file)
@@ -216,7 +216,7 @@ namespace Mono.CSharp {
                        }
 
                        Expression lexpr = Left.GetTypeExpression ();
-                       return new MemberAccess (lexpr, Name, TypeArguments, Location);
+                       return new MemberAccess (lexpr, Name, TypeArguments);
                }
 
                public MemberName Clone ()
@@ -582,7 +582,7 @@ namespace Mono.CSharp {
                // Raised (and passed an XmlElement that contains the comment)
                // when GenerateDocComment is writing documentation expectedly.
                //
-               internal virtual void OnGenerateDocComment (DeclSpace ds, XmlElement intermediateNode)
+               internal virtual void OnGenerateDocComment (XmlElement intermediateNode)
                {
                }
 
@@ -1592,7 +1592,7 @@ namespace Mono.CSharp {
                /// <summary>
                ///   Bootstrap this member cache by doing a deep-copy of our base.
                /// </summary>
-               Hashtable SetupCache (MemberCache base_class)
+               static Hashtable SetupCache (MemberCache base_class)
                {
                        Hashtable hash = new Hashtable ();
 
@@ -2270,7 +2270,9 @@ namespace Mono.CSharp {
                /// <summary>
                /// Cls compliance check whether methods or constructors parameters differing only in ref or out, or in array rank
                /// </summary>
-               public void VerifyClsParameterConflict (ArrayList al, MethodCore method, MemberInfo this_builder)
+               /// 
+               // TODO: refactor as method is always 'this'
+               public static void VerifyClsParameterConflict (ArrayList al, MethodCore method, MemberInfo this_builder)
                {
                        EntryType tested_type = (method is Constructor ? EntryType.Constructor : EntryType.Method) | EntryType.Public;
  
index c22b5544aa5e97961a5259483faab88b89da0a51..dd10369b7ec0644d1dff1d0e43840165e942a79d 100644 (file)
@@ -485,7 +485,7 @@ namespace Mono.CSharp {
                ///  Verifies whether the delegate in question is compatible with this one in
                ///  order to determine if instantiation from the same is possible.
                /// </summary>
-               public static bool VerifyDelegate (EmitContext ec, Type delegate_type, Type probe_type, Location loc)
+               public static bool VerifyDelegate (EmitContext ec, Type delegate_type, Location loc)
                {
                        Expression ml = Expression.MemberLookup (
                                ec.ContainerType, delegate_type, "Invoke", loc);
@@ -808,7 +808,7 @@ namespace Mono.CSharp {
 
                        Argument a = (Argument) Arguments [0];
                        
-                       if (!a.ResolveMethodGroup (ec, loc))
+                       if (!a.ResolveMethodGroup (ec))
                                return null;
                        
                        Expression e = a.Expr;
@@ -820,9 +820,7 @@ namespace Mono.CSharp {
                        if (mg != null)
                                return ResolveMethodGroupExpr (ec, mg);
 
-                       Type e_type = e.Type;
-
-                       if (!TypeManager.IsDelegateType (e_type)) {
+                       if (!TypeManager.IsDelegateType (e.Type)) {
                                Report.Error (149, loc, "Method name expected");
                                return null;
                        }
@@ -838,8 +836,8 @@ namespace Mono.CSharp {
 
                        // This is what MS' compiler reports. We could always choose
                        // to be more verbose and actually give delegate-level specifics
-                       if (!Delegate.VerifyDelegate (ec, type, e_type, loc)) {
-                               Report.Error (29, loc, "Cannot implicitly convert type '" + e_type + "' " +
+                       if (!Delegate.VerifyDelegate (ec, type, loc)) {
+                               Report.Error (29, loc, "Cannot implicitly convert type '" + e.Type + "' " +
                                              "to type '" + type + "'");
                                return null;
                        }
index 1c12168aef0cc73d069122419231035ad1b578c3..49260440ffc02c03c8d546a3d54a939fe835fbe7 100644 (file)
@@ -149,7 +149,7 @@ namespace Mono.CSharp {
 
                                XmlElement el = n as XmlElement;
                                if (el != null) {
-                                       mc.OnGenerateDocComment (ds, el);
+                                       mc.OnGenerateDocComment (el);
 
                                        // FIXME: it could be done with XmlReader
                                        XmlNodeList nl = n.SelectNodes (".//include");
@@ -200,7 +200,7 @@ namespace Mono.CSharp {
                                el.ParentNode.InsertBefore (el.OwnerDocument.CreateComment (" Include tag is invalid "), el);
                                keepIncludeNode = true;
                        }
-                       else if (path == "") {
+                       else if (path.Length == 0) {
                                Report.Warning (1590, 1, mc.Location, "Invalid XML `include' element. Missing `path' attribute");
                                el.ParentNode.InsertBefore (el.OwnerDocument.CreateComment (" Include tag is invalid "), el);
                                keepIncludeNode = true;
@@ -358,7 +358,7 @@ namespace Mono.CSharp {
                        if (ml == null)
                                return empty_member_infos;
 
-                       return FilterOverridenMembersOut (type, (MemberInfo []) ml);
+                       return FilterOverridenMembersOut ((MemberInfo []) ml);
                }
 
                static bool IsOverride (PropertyInfo deriv_prop, PropertyInfo base_prop)
@@ -386,7 +386,7 @@ namespace Mono.CSharp {
                }
 
                private static MemberInfo [] FilterOverridenMembersOut (
-                       Type type, MemberInfo [] ml)
+                       MemberInfo [] ml)
                {
                        if (ml == null)
                                return empty_member_infos;
@@ -481,7 +481,7 @@ namespace Mono.CSharp {
                                        type, MemberTypes.All,
                                        BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance,
                                        memberName, null);
-                               mis = FilterOverridenMembersOut (type, mis);
+                               mis = FilterOverridenMembersOut (mis);
                                if (mis == null || mis.Length == 0)
                                        return null;
                                if (warn419 && IsAmbiguous (mis))
@@ -897,13 +897,13 @@ namespace Mono.CSharp {
                // that means removal of DOM use.
                //
                internal static void OnMethodGenerateDocComment (
-                       MethodCore mc, DeclSpace ds, XmlElement el)
+                       MethodCore mc, XmlElement el)
                {
                        Hashtable paramTags = new Hashtable ();
                        foreach (XmlElement pelem in el.SelectNodes ("param")) {
                                int i;
                                string xname = pelem.GetAttribute ("name");
-                               if (xname == "")
+                               if (xname.Length == 0)
                                        continue; // really? but MS looks doing so
                                if (xname != "" && mc.Parameters.GetParameterByName (xname, out i) == null)
                                        Report.Warning (1572, 2, mc.Location, "XML comment on `{0}' has a param tag for `{1}', but there is no parameter by that name",
index 58b793e7818ae3c71536632e24ebc543d20258c9..40bb40bf807026c494713f53e4c705760565d032 100644 (file)
@@ -987,7 +987,7 @@ namespace Mono.CSharp
                                return true;
 
                        case "/out":
-                               if (value == ""){
+                               if (value.Length == 0){
                                        Usage ();
                                        Environment.Exit (1);
                                }
@@ -1013,7 +1013,7 @@ namespace Mono.CSharp
                        case "/define": {
                                string [] defs;
 
-                               if (value == ""){
+                               if (value.Length == 0){
                                        Usage ();
                                        Environment.Exit (1);
                                }
@@ -1035,7 +1035,7 @@ namespace Mono.CSharp
                        case "/pkg": {
                                string packages;
 
-                               if (value == ""){
+                               if (value.Length == 0){
                                        Usage ();
                                        Environment.Exit (1);
                                }
@@ -1108,7 +1108,7 @@ namespace Mono.CSharp
                                return true;
                                
                        case "/recurse":
-                               if (value == ""){
+                               if (value.Length == 0){
                                        Report.Error (5, "-recurse requires an argument");
                                        Environment.Exit (1);
                                }
@@ -1117,7 +1117,7 @@ namespace Mono.CSharp
 
                        case "/r":
                        case "/reference": {
-                               if (value == ""){
+                               if (value.Length == 0){
                                        Report.Error (5, "-reference requires an argument");
                                        Environment.Exit (1);
                                }
@@ -1138,7 +1138,7 @@ namespace Mono.CSharp
                                return true;
                        }
                        case "/addmodule": {
-                               if (value == ""){
+                               if (value.Length == 0){
                                        Report.Error (5, arg + " requires an argument");
                                        Environment.Exit (1);
                                }
@@ -1150,7 +1150,7 @@ namespace Mono.CSharp
                                return true;
                        }
                        case "/win32res": {
-                               if (value == "") {
+                               if (value.Length == 0) {
                                        Report.Error (5, arg + " requires an argument");
                                        Environment.Exit (1);
                                }
@@ -1159,7 +1159,7 @@ namespace Mono.CSharp
                                return true;
                        }
                        case "/win32icon": {
-                               if (value == "") {
+                               if (value.Length == 0) {
                                        Report.Error (5, arg + " requires an argument");
                                        Environment.Exit (1);
                                }
@@ -1168,7 +1168,7 @@ namespace Mono.CSharp
                                return true;
                        }
                        case "/doc": {
-                               if (value == ""){
+                               if (value.Length == 0){
                                        Report.Error (2006, arg + " requires an argument");
                                        Environment.Exit (1);
                                }
@@ -1178,7 +1178,7 @@ namespace Mono.CSharp
                        case "/lib": {
                                string [] libdirs;
                                
-                               if (value == ""){
+                               if (value.Length == 0){
                                        Report.Error (5, "/lib requires an argument");
                                        Environment.Exit (1);
                                }
@@ -1240,7 +1240,7 @@ namespace Mono.CSharp
                        case "/nowarn": {
                                string [] warns;
 
-                               if (value == ""){
+                               if (value.Length == 0){
                                        Report.Error (5, "/nowarn requires an argument");
                                        Environment.Exit (1);
                                }
@@ -1282,7 +1282,7 @@ namespace Mono.CSharp
 
                        case "/main":
                        case "/m":
-                               if (value == ""){
+                               if (value.Length == 0){
                                        Report.Error (5, arg + " requires an argument");                                        
                                        Environment.Exit (1);
                                }
@@ -1467,7 +1467,7 @@ namespace Mono.CSharp
 
                        for (i = 0; i < args.Length; i++){
                                string arg = args [i];
-                               if (arg == "")
+                               if (arg.Length == 0)
                                        continue;
 
                                if (arg.StartsWith ("@")){
index 6fe57f14db2ba62d50898f219af8ad2a69b35650..a91deaaacccf5e31cfb1b1a12985267367689067 100644 (file)
@@ -2497,7 +2497,7 @@ namespace Mono.CSharp {
                        Expression expr;
                        if (name.Left != null) {
                                Expression lexpr = name.Left.GetTypeExpression ();
-                               expr = new MemberAccess (lexpr, name.Basename, loc);
+                               expr = new MemberAccess (lexpr, name.Basename);
                        } else {
                                expr = new SimpleName (name.Basename, loc);
                        }
index 87270d9a5348c2c7bafc6fab9d9172921801c867..7dd9dca91c1cdd1d5a2a50c49b9fae514fc7cb71 100644 (file)
@@ -71,7 +71,7 @@ namespace Mono.CSharp {
                        }
                }
 
-               bool IsValidEnumType (Type t)
+               static bool IsValidEnumType (Type t)
                {
                        return (t == TypeManager.int32_type || t == TypeManager.uint32_type || t == TypeManager.int64_type ||
                                t == TypeManager.byte_type || t == TypeManager.sbyte_type || t == TypeManager.short_type ||
index 32dce23aa9767212dfac6dd09c71341471cf1ff0..4cd14b479085b8974ce65538f8189019ec20eca6 100644 (file)
@@ -1563,7 +1563,7 @@ namespace Mono.CSharp {
                                + "'");
                }
 
-               bool IsOfType (EmitContext ec, Type l, Type r, Type t, bool check_user_conversions)
+               static bool IsOfType (EmitContext ec, Type l, Type r, Type t, bool check_user_conversions)
                {
                        if ((l == t) || (r == t))
                                return true;
@@ -2366,7 +2366,7 @@ namespace Mono.CSharp {
                        return this;
                }
 
-               Constant EnumLiftUp (EmitContext ec, Constant left, Constant right)
+               Constant EnumLiftUp (Constant left, Constant right)
                {
                        switch (oper) {
                                case Operator.BitwiseOr:
@@ -2443,11 +2443,11 @@ namespace Mono.CSharp {
 
                        // The conversion rules are ignored in enum context but why
                        if (!ec.InEnumContext && lc != null && rc != null && (TypeManager.IsEnumType (left.Type) || TypeManager.IsEnumType (right.Type))) {
-                               left = lc = EnumLiftUp (ec, lc, rc);
+                               left = lc = EnumLiftUp (lc, rc);
                                if (lc == null)
                                        return null;
 
-                               right = rc = EnumLiftUp (ec, rc, lc);
+                               right = rc = EnumLiftUp (rc, lc);
                                if (rc == null)
                                        return null;
                        }
@@ -4074,7 +4074,7 @@ namespace Mono.CSharp {
                                TypeManager.CSharpName (a.Expr.Type);
                }
 
-               public bool ResolveMethodGroup (EmitContext ec, Location loc)
+               public bool ResolveMethodGroup (EmitContext ec)
                {
                        SimpleName sn = Expr as SimpleName;
                        if (sn != null)
@@ -4227,7 +4227,7 @@ namespace Mono.CSharp {
                ///              q    if a->q is better,
                ///              null if neither is better
                /// </summary>
-               static Type BetterConversion (EmitContext ec, Argument a, Type p, Type q, Location loc)
+               static Type BetterConversion (EmitContext ec, Argument a, Type p, Type q)
                {
                        Type argument_type = TypeManager.TypeToCoreType (a.Type);
                        Expression argument_expr = a.Expr;
@@ -4370,7 +4370,7 @@ namespace Mono.CSharp {
                /// </remarks>
                static bool BetterFunction (EmitContext ec, ArrayList args, int argument_count,
                                            MethodBase candidate, bool candidate_params,
-                                           MethodBase best, bool best_params, Location loc)
+                                           MethodBase best, bool best_params)
                {
                        ParameterData candidate_pd = TypeManager.GetParameterData (candidate);
                        ParameterData best_pd = TypeManager.GetParameterData (best);
@@ -4395,7 +4395,7 @@ namespace Mono.CSharp {
                                        continue;
 
                                same = false;
-                               Type better = BetterConversion (ec, a, ct, bt, loc);
+                               Type better = BetterConversion (ec, a, ct, bt);
 
                                // for each argument, the conversion to 'ct' should be no worse than 
                                // the conversion to 'bt'.
@@ -4989,7 +4989,7 @@ namespace Mono.CSharp {
 
                                if (BetterFunction (ec, Arguments, arg_count, 
                                                    candidate, cand_params,
-                                                   method, method_params, loc)) {
+                                                   method, method_params)) {
                                        method = candidate;
                                        method_params = cand_params;
                                }
@@ -5008,8 +5008,7 @@ namespace Mono.CSharp {
                                 bool cand_params = candidate_to_form != null && candidate_to_form.Contains (candidate);
                                if (!BetterFunction (ec, Arguments, arg_count,
                                                     method, method_params,
-                                                    candidate, cand_params,
-                                                    loc)) {
+                                                    candidate, cand_params)) {
                                        Report.SymbolRelatedToPreviousError (candidate);
                                        ambiguous = candidate;
                                }
@@ -5419,8 +5418,7 @@ namespace Mono.CSharp {
                        }
                }
 
-               static Type[] GetVarargsTypes (EmitContext ec, MethodBase mb,
-                                              ArrayList arguments)
+               static Type[] GetVarargsTypes (MethodBase mb, ArrayList arguments)
                {
                        ParameterData pd = TypeManager.GetParameterData (mb);
 
@@ -5609,7 +5607,7 @@ namespace Mono.CSharp {
                                call_op = OpCodes.Callvirt;
 
                        if ((method.CallingConvention & CallingConventions.VarArgs) != 0) {
-                               Type[] varargs_types = GetVarargsTypes (ec, method, Arguments);
+                               Type[] varargs_types = GetVarargsTypes (method, Arguments);
                                ig.EmitCall (call_op, (MethodInfo) method, varargs_types);
                                return;
                        }
@@ -6314,7 +6312,7 @@ namespace Mono.CSharp {
                        return true;
                }
                
-               public void UpdateIndices (EmitContext ec)
+               public void UpdateIndices ()
                {
                        int i = 0;
                        for (ArrayList probe = initializers; probe != null;) {
@@ -6337,7 +6335,7 @@ namespace Mono.CSharp {
 
                }
                
-               public bool ValidateInitializers (EmitContext ec, Type array_type)
+               public bool ValidateInitializers (EmitContext ec)
                {
                        if (initializers == null) {
                                return !expect_initializers;
@@ -6361,7 +6359,7 @@ namespace Mono.CSharp {
                                if (!CheckIndices (ec, initializers, 0, false))
                                        return false;
                                
-                               UpdateIndices (ec);
+                               UpdateIndices ();
                                
                                if (arguments.Count != dimensions) {
                                        Error_IncorrectArrayInitializer ();
@@ -6417,7 +6415,7 @@ namespace Mono.CSharp {
                        // First step is to validate the initializers and fill
                        // in any missing bits
                        //
-                       if (!ValidateInitializers (ec, type))
+                       if (!ValidateInitializers (ec))
                                return null;
 
                        if (arguments == null)
@@ -7024,19 +7022,13 @@ namespace Mono.CSharp {
                        this.loc = loc;
                }
 
-               public bool ResolveBase (EmitContext ec)
+               public override Expression DoResolve (EmitContext ec)
                {
                        eclass = ExprClass.Variable;
                        type = TypeManager.runtime_argument_handle_type;
-                       return true;
-               }
-
-               public override Expression DoResolve (EmitContext ec)
-               {
-                       if (!ResolveBase (ec))
-                               return null;
 
-                       if (ec.IsFieldInitializer || !ec.CurrentBlock.Toplevel.HasVarargs) {
+                       if (ec.IsFieldInitializer || !ec.CurrentBlock.Toplevel.HasVarargs) 
+                       {
                                Error (190, "The __arglist construct is valid only within " +
                                       "a variable argument method.");
                                return null;
@@ -7260,7 +7252,7 @@ namespace Mono.CSharp {
                public override FullNamedExpression ResolveAsTypeStep (IResolveContext ec, bool silent)
                {
                        if (alias == "global")
-                               return new MemberAccess (RootNamespace.Global, identifier, loc).ResolveAsTypeStep (ec, silent);
+                               return new MemberAccess (RootNamespace.Global, identifier).ResolveAsTypeStep (ec, silent);
 
                        int errors = Report.Errors;
                        FullNamedExpression fne = ec.DeclContainer.NamespaceEntry.LookupAlias (alias);
@@ -7274,7 +7266,7 @@ namespace Mono.CSharp {
                                        Report.Error (431, loc, "`{0}' cannot be used with '::' since it denotes a type", alias);
                                return null;
                        }
-                       return new MemberAccess (fne, identifier, loc).ResolveAsTypeStep (ec, silent);
+                       return new MemberAccess (fne, identifier).ResolveAsTypeStep (ec, silent);
                }
 
                public override Expression DoResolve (EmitContext ec)
@@ -7292,7 +7284,7 @@ namespace Mono.CSharp {
                                }
                        }
 
-                       Expression retval = new MemberAccess (fne, identifier, loc).DoResolve (ec);
+                       Expression retval = new MemberAccess (fne, identifier).DoResolve (ec);
                        if (retval == null)
                                return null;
 
@@ -7334,17 +7326,15 @@ namespace Mono.CSharp {
                Expression expr;
                TypeArguments args;
                
-               // TODO: Location can be removed
-               public MemberAccess (Expression expr, string id, Location l)
+               public MemberAccess (Expression expr, string id)
                {
                        this.expr = expr;
                        Identifier = id;
                        loc = expr.Location;
                }
 
-               public MemberAccess (Expression expr, string id, TypeArguments args,
-                                    Location l)
-                       : this (expr, id, l)
+               public MemberAccess (Expression expr, string id, TypeArguments args)
+                       : this (expr, id)
                {
                        this.args = args;
                }
@@ -8254,7 +8244,7 @@ namespace Mono.CSharp {
                                BindingFlags.DeclaredOnly, p_name, null);
                }
                
-               static public Indexers GetIndexersForType (Type caller_type, Type lookup_type, Location loc
+               static public Indexers GetIndexersForType (Type caller_type, Type lookup_type) 
                {
                        Indexers ix = empty;
 
@@ -8345,7 +8335,7 @@ namespace Mono.CSharp {
                        bool found_any = false, found_any_getters = false;
                        Type lookup_type = indexer_type;
 
-                       Indexers ilist = Indexers.GetIndexersForType (current_type, lookup_type, loc);
+                       Indexers ilist = Indexers.GetIndexersForType (current_type, lookup_type);
                        if (ilist.Properties != null) {
                                found_any = true;
                                foreach (Indexers.Indexer ix in ilist.Properties) {
@@ -8419,7 +8409,7 @@ namespace Mono.CSharp {
 
                        bool found_any = false, found_any_setters = false;
 
-                       Indexers ilist = Indexers.GetIndexersForType (current_type, indexer_type, loc);
+                       Indexers ilist = Indexers.GetIndexersForType (current_type, indexer_type);
                        if (ilist.Properties != null) {
                                found_any = true;
                                foreach (Indexers.Indexer ix in ilist.Properties) {
index 73aefac0b373f1e7403c243ef5008593a0980d23..21f9ed56eb43b4cbed3b01a8e09e998815c80d4e 100644 (file)
@@ -701,7 +701,7 @@ namespace Mono.CSharp
                                return result;
                        }
 
-                       protected void MergeFinally (FlowBranching branching, UsageVector f_origins,
+                       protected static void MergeFinally (UsageVector f_origins,
                                                     MyBitVector f_params)
                        {
                                for (UsageVector vector = f_origins; vector != null; vector = vector.Next) {
@@ -710,15 +710,15 @@ namespace Mono.CSharp
                                }
                        }
 
-                       public void MergeFinally (FlowBranching branching, UsageVector f_vector,
+                       public void MergeFinally (UsageVector f_vector,
                                                  UsageVector f_origins)
                        {
                                if (parameters != null) {
                                        if (f_vector != null) {
-                                               MergeFinally (branching, f_origins, f_vector.Parameters);
+                                               MergeFinally (f_origins, f_vector.Parameters);
                                                MyBitVector.Or (ref parameters, f_vector.ParameterVector);
                                        } else
-                                               MergeFinally (branching, f_origins, parameters);
+                                               MergeFinally (f_origins, parameters);
                                }
 
                                if (f_vector != null && f_vector.LocalVector != null)
@@ -1492,7 +1492,7 @@ namespace Mono.CSharp
                {
                        UsageVector vector = Merge (catch_vectors);
 
-                       vector.MergeFinally (this, finally_vector, finally_origins);
+                       vector.MergeFinally (finally_vector, finally_origins);
 
                        return vector;
                }
index b2182f13cd285cb5bb76ab3455fe31435b94c74e..2251b3ecd6641f1301b2d491a945045951e64ee7 100644 (file)
@@ -824,7 +824,7 @@ namespace Mono.CSharp {
 
                        Expression ce = new MemberAccess (
                                new SimpleName ("System.Threading.Interlocked", Location),
-                               "CompareExchange", Location);
+                               "CompareExchange");
 
                        Expression pc = new FieldExpression (this, pc_field);
                        Expression before = new IntLiteral ((int) State.Running, Location);
index f69ee3c69807df87490577a3f7cfa62a8af79e50..2861d7a5bcba5580f539c2963cf0c9f303b1dc36 100644 (file)
@@ -162,7 +162,7 @@ namespace Mono.CSharp {
                // </remarks>
                static public SourceFile LookupFile (string name)
                {
-                       string path = name == "" ? "" : Path.GetFullPath (name);
+                       string path = name.Length == 0 ? "" : Path.GetFullPath (name);
 
                        if (!source_files.Contains (path)) {
                                if (source_count >= (1 << checkpoint_bits))
@@ -178,7 +178,7 @@ namespace Mono.CSharp {
                        return (SourceFile) source_list [index - 1];
                }
 
-               static public void Push (SourceFile file, int line)
+               static public void Push (SourceFile file)
                {
                        current_source = file.Index;
                        // File is always pushed before being changed.
index c547f64d598a33d56c594058fbda0dfd70f2685e..85fcfab89f22e85bf8261307dcf18107a04337ac 100644 (file)
@@ -86,7 +86,7 @@ namespace Mono.CSharp {
 
                protected void EnsureNamespace (string dotted_name)
                {
-                       if (dotted_name != null && dotted_name != "" && ! IsNamespace (dotted_name))
+                       if (dotted_name != null && dotted_name.Length != 0 && ! IsNamespace (dotted_name))
                                GetNamespace (dotted_name, true);
                }
 
@@ -281,9 +281,8 @@ namespace Mono.CSharp {
                                throw new InternalErrorException ("Namespace has a null fullname");
 
                        if (parent != null && parent.MemberName != MemberName.Null)
-                               MemberName = new MemberName (
-                                       parent.MemberName, name, parent.MemberName.Location);
-                       else if (name == "")
+                               MemberName = new MemberName (parent.MemberName, name, parent.MemberName.Location);
+                       else if (name.Length == 0)
                                MemberName = MemberName.Null;
                        else
                                MemberName = new MemberName (name, Location.Null);
@@ -357,7 +356,7 @@ namespace Mono.CSharp {
                                        t = tdecl.TypeBuilder;
                                }
                        }
-                       string lookup = t != null ? t.FullName : (fullname == "" ? name : fullname + "." + name);
+                       string lookup = t != null ? t.FullName : (fullname.Length == 0 ? name : fullname + "." + name);
                        Type rt = root.LookupTypeReflection (lookup, loc);
                        if (t == null)
                                t = rt;
@@ -546,7 +545,7 @@ namespace Mono.CSharp {
                        }
                }
 
-               public NamespaceEntry (NamespaceEntry parent, SourceFile file, string name, Location loc)
+               public NamespaceEntry (NamespaceEntry parent, SourceFile file, string name)
                {
                        this.parent = parent;
                        this.file = file;
index 53474b2654b7e9d466057e4ab16329096604560b..35feb1f49096dfaa41b9a83f3dbf13835dc9f1b5 100644 (file)
@@ -682,7 +682,7 @@ namespace Mono.CSharp {
                        return result;
                }
 
-               bool CheckWarningCode (int code, Location loc)
+               static bool CheckWarningCode (int code, Location loc)
                {
                        if (Report.IsValidWarning (code))
                                return true;
index 1e3436e9b827ece7e1d7d998a8fed2a57c7c2b6d..9244de8a1fa617a0ce68b1d31f5890f2b1c0b3e0 100644 (file)
@@ -676,7 +676,7 @@ namespace Mono.CSharp {
 
                FlowBranching.UsageVector vectors;
                
-               public LabeledStatement (string label_name, Location l)
+               public LabeledStatement (Location l)
                {
                        this.loc = l;
                }
@@ -4394,13 +4394,13 @@ namespace Mono.CSharp {
                                                if (!FetchGetCurrent (ec, return_type))
                                                        get_current = new PropertyExpr (
                                                                ec.ContainerType, TypeManager.ienumerator_getcurrent, loc);
-                                               if (!FetchMoveNext (ec, return_type))
+                                               if (!FetchMoveNext (return_type))
                                                        move_next = TypeManager.bool_movenext_void;
                                                return true;
                                        }
 
                                        if (return_type.IsInterface ||
-                                           !FetchMoveNext (ec, return_type) ||
+                                           !FetchMoveNext (return_type) ||
                                            !FetchGetCurrent (ec, return_type)) {
                                                enumerator_type = return_type;
                                                move_next = TypeManager.bool_movenext_void;
@@ -4414,7 +4414,7 @@ namespace Mono.CSharp {
                                        // find if they support the GetEnumerator pattern.
                                        //
 
-                                       if (TypeManager.HasElementType (return_type) || !FetchMoveNext (ec, return_type) || !FetchGetCurrent (ec, return_type)) {
+                                       if (TypeManager.HasElementType (return_type) || !FetchMoveNext (return_type) || !FetchGetCurrent (ec, return_type)) {
                                                Report.Error (202, loc, "foreach statement requires that the return type `{0}' of `{1}' must have a suitable public MoveNext method and public Current property",
                                                        TypeManager.CSharpName (return_type), TypeManager.CSharpSignature (mi));
                                                return false;
@@ -4432,7 +4432,7 @@ namespace Mono.CSharp {
                        //
                        // Retrieves a `public bool MoveNext ()' method from the Type `t'
                        //
-                       bool FetchMoveNext (EmitContext ec, Type t)
+                       bool FetchMoveNext (Type t)
                        {
                                MemberList move_next_list;
 
index 145c589ee171821be9e69710216470932b2bafd1..54d464fe648c21e082455774f7f3904f1ed7a791 100644 (file)
@@ -2562,11 +2562,6 @@ public partial class TypeManager {
        // uses NonPublic for both protected and private), we need to distinguish.
        //
 
-       static internal bool FilterNone (MemberInfo m, object filter_criteria)
-       {
-               return true;
-       }
-
        internal class Closure {
                internal bool     private_ok;