2002-07-09 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
authorRafael Teixeira <monoman@gmail.com>
Tue, 9 Jul 2002 21:04:02 +0000 (21:04 -0000)
committerRafael Teixeira <monoman@gmail.com>
Tue, 9 Jul 2002 21:04:02 +0000 (21:04 -0000)
* merged attribute.cs, ecore.cs, namespace.cs and statement.cs from mcs/mcs, to resync

svn path=/trunk/mcs/; revision=5674

mcs/mbas/ChangeLog
mcs/mbas/attribute.cs
mcs/mbas/ecore.cs
mcs/mbas/mb-parser.jay
mcs/mbas/namespace.cs
mcs/mbas/statement.cs

index 213c6ed59b7e96c14be0ced2c47c9c78963b935d..dae2b455d137ba2b384487f59563f1e6c80030a3 100644 (file)
@@ -1,3 +1,6 @@
+2002-07-09  Rafael Teixeira <rafaelteixeirabr@hotmail.com>
+       * merged attribute.cs, ecore.cs, namespace.cs and statement.cs from mcs/mcs, to resync
+
 2002-07-06  Rafael Teixeira <rafaelteixeirabr@hotmail.com>
        * merged attribute.cs, class.cs, codegen.cs, ecore.cs, expression.cs, 
          modifiers.cs, namespace.cs, report.cs, rootcontext.cs, statement.cs and typemanager.cs from mcs/mcs, to resync
index f8ac803132f0e11febad91bf3071f7918eefb1fa..344bfe5ed70551f2b7c779544689780a112ae921 100644 (file)
@@ -744,8 +744,11 @@ namespace Mono.CSharp {
                                }
                        }
 
+                       if (entry_point == null)
+                               entry_point = name;
+                       
                        MethodBuilder mb = builder.DefinePInvokeMethod (
-                               name, dll_name, flags | MethodAttributes.HideBySig,
+                               name, dll_name, entry_point, flags | MethodAttributes.HideBySig,
                                CallingConventions.Standard,
                                ret_type,
                                param_types,
index e7f4a1f1d2893185cd624267b40bb2315101632d..a174bd35dedf840fd8d6b97b834c2e7e9802daee 100644 (file)
@@ -1574,8 +1574,7 @@ namespace Mono.CSharp {
                /// <summary>
                ///   Performs the explicit numeric conversions
                /// </summary>
-               static Expression ConvertNumericExplicit (EmitContext ec, Expression expr,
-                                                         Type target_type)
+               static Expression ConvertNumericExplicit (EmitContext ec, Expression expr, Type target_type)
                {
                        Type expr_type = expr.Type;
 
@@ -2790,8 +2789,8 @@ namespace Mono.CSharp {
                public ConvCast (EmitContext ec, Expression child, Type return_type, Mode m)
                        : base (child, return_type)
                {
-                       mode = m;
                        checked_state = ec.CheckState;
+                       mode = m;
                }
 
                public override Expression DoResolve (EmitContext ec)
@@ -3728,7 +3727,10 @@ namespace Mono.CSharp {
                        if (FieldInfo.IsStatic)
                                ig.Emit (OpCodes.Ldsflda, FieldInfo);
                        else {
-                               InstanceExpression.Emit (ec);
+                               if (InstanceExpression is IMemoryLocation)
+                                       ((IMemoryLocation)InstanceExpression).AddressOf (ec, AddressOp.LoadStore);
+                               else
+                                       InstanceExpression.Emit (ec);
                                ig.Emit (OpCodes.Ldflda, FieldInfo);
                        }
                }
index f4e7408ffe5fd8edc420936d7fe15b61ca93e204..bc4f3a16400bb6fe5268da6bc7f29a9eedb37cce 100644 (file)
@@ -358,7 +358,7 @@ imports_directive
 imports_namespace_directive
        : IMPORTS qualified_identifier EOL 
          {
-               current_namespace.Using ((string) $2);
+               current_namespace.Using ((string) $2, lexer.Location);
          }
        ;
 
index 215a07e6270bb32958b4afa8915b621eb0dbb9ab..d01bde48642adb163637cac88fa5a2cd58b269e2 100644 (file)
@@ -20,7 +20,7 @@ namespace Mono.CSharp {
                string name;
                ArrayList using_clauses;
                Hashtable aliases;
-               bool decl_found = false;
+               public bool DeclarationFound = false;
                
                /// <summary>
                ///   Constructor Takes the current namespace and the
@@ -57,23 +57,13 @@ namespace Mono.CSharp {
                        }
                }
 
-               /// <summary>
-               ///   When a declaration is found in a namespace,
-               ///   we call this function, to emit an error if the
-               ///   program attempts to use a using clause afterwards
-               /// </summary>
-               public void DeclarationFound ()
-               {
-                       decl_found = true;
-               }
-
                /// <summary>
                ///   Records a new namespace for resolving name references
                /// </summary>
-               public void Using (string ns)
+               public void Using (string ns, Location loc)
                {
-                       if (decl_found){
-                               Report.Error (1529, "A using clause must precede all other namespace elements");
+                       if (DeclarationFound){
+                               Report.Error (1529, loc, "A using clause must precede all other namespace elements");
                                return;
                        }
 
index 3f65dc98c545ed5e42b1d0ac7c459bb9ea578beb..fccab1999bc89032acbbc7be7c4b8e366b81a9cc 100644 (file)
@@ -757,7 +757,10 @@ namespace Mono.CSharp {
                        }
 
                        ec.Breaks = true;
-                       ig.Emit (OpCodes.Br, ec.LoopEnd);
+                       if (ec.InTry || ec.InCatch)
+                               ig.Emit (OpCodes.Leave, ec.LoopEnd);
+                       else
+                               ig.Emit (OpCodes.Br, ec.LoopEnd);
 
                        return false;
                }
@@ -2133,9 +2136,18 @@ namespace Mono.CSharp {
 
                public override bool Resolve (EmitContext ec)
                {
-                       return Block.Resolve (ec);
+                       bool previous_state = ec.CheckState;
+                       bool previous_state_const = ec.ConstantCheckState;
+                       
+                       ec.CheckState = true;
+                       ec.ConstantCheckState = true;
+                       bool ret = Block.Resolve (ec);
+                       ec.CheckState = previous_state;
+                       ec.ConstantCheckState = previous_state_const;
+
+                       return ret;
                }
-               
+
                public override bool Emit (EmitContext ec)
                {
                        bool previous_state = ec.CheckState;