Author: toshok
Date: 2005-02-24 00:38:11 -0500 (Thu, 24 Feb 2005)
New Revision: 41134

Modified:
   trunk/mcs/mcs/ChangeLog
   trunk/mcs/mcs/codegen.cs
   trunk/mcs/mcs/statement.cs
   trunk/mcs/mcs/symbolwriter.cs
Log:
2005-02-23  Chris Toshok  <[EMAIL PROTECTED]>

        Fix compiler portions of #72827.
        * statement.cs (Block.Emit): call Begin/EndScope on the
        EmitContext instead of the ILGenerator.

        * codegen.cs (EmitContext.BeginScope): new method, call
        ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
        we have one.)
        (EmitContext.BeginScope): same, but EndScope and CloseScope

        * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
        offset and call the superclass's OpenScope(int) with it.
        (SymbolWriter.CloseScope): get the current il
        offset and call superclass's CloseScope(int) with it.



Modified: trunk/mcs/mcs/ChangeLog
===================================================================
--- trunk/mcs/mcs/ChangeLog     2005-02-24 05:18:45 UTC (rev 41133)
+++ trunk/mcs/mcs/ChangeLog     2005-02-24 05:38:11 UTC (rev 41134)
@@ -1,3 +1,19 @@
+2005-02-23  Chris Toshok  <[EMAIL PROTECTED]>
+
+       Fix compiler portions of #72827.
+       * statement.cs (Block.Emit): call Begin/EndScope on the
+       EmitContext instead of the ILGenerator.
+
+       * codegen.cs (EmitContext.BeginScope): new method, call
+       ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
+       we have one.)
+       (EmitContext.BeginScope): same, but EndScope and CloseScope
+
+       * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
+       offset and call the superclass's OpenScope(int) with it.
+       (SymbolWriter.CloseScope): get the current il
+       offset and call superclass's CloseScope(int) with it.
+
 2005-02-23  Marek Safar  <[EMAIL PROTECTED]>
 
        * anonymous.cs (AnonymousMethod.Compatible): Fixed to report

Modified: trunk/mcs/mcs/codegen.cs
===================================================================
--- trunk/mcs/mcs/codegen.cs    2005-02-24 05:18:45 UTC (rev 41133)
+++ trunk/mcs/mcs/codegen.cs    2005-02-24 05:38:11 UTC (rev 41134)
@@ -806,6 +806,22 @@
                        CodeGen.SymbolWriter.DefineLocalVariable (name, 
builder);
                }
 
+               public void BeginScope ()
+               {
+                       ig.BeginScope();
+
+                       if (CodeGen.SymbolWriter != null)
+                               CodeGen.SymbolWriter.OpenScope(ig);
+               }
+
+               public void EndScope ()
+               {
+                       ig.EndScope();
+
+                       if (CodeGen.SymbolWriter != null)
+                               CodeGen.SymbolWriter.CloseScope(ig);
+               }
+
                /// <summary>
                ///   Returns a temporary storage for a variable of type t as 
                ///   a local variable in the current body.

Modified: trunk/mcs/mcs/statement.cs
===================================================================
--- trunk/mcs/mcs/statement.cs  2005-02-24 05:18:45 UTC (rev 41133)
+++ trunk/mcs/mcs/statement.cs  2005-02-24 05:38:11 UTC (rev 41134)
@@ -2071,7 +2071,7 @@
 
                        if (emit_debug_info) {
                                if (is_lexical_block)
-                                       ec.ig.BeginScope ();
+                                       ec.BeginScope ();
 
                                if (variables != null) {
                                        foreach (DictionaryEntry de in 
variables) {
@@ -2091,7 +2091,7 @@
                        ec.Mark (EndLocation, true); 
 
                        if (emit_debug_info && is_lexical_block)
-                               ec.ig.EndScope ();
+                               ec.EndScope ();
 
                        ec.CurrentBlock = prev_block;
                }

Modified: trunk/mcs/mcs/symbolwriter.cs
===================================================================
--- trunk/mcs/mcs/symbolwriter.cs       2005-02-24 05:18:45 UTC (rev 41133)
+++ trunk/mcs/mcs/symbolwriter.cs       2005-02-24 05:38:11 UTC (rev 41134)
@@ -66,6 +66,18 @@
                        DefineLocalVariable (name, signature);
                }
 
+               public int OpenScope (ILGenerator ig)
+               {
+                       int offset = get_il_offset_func (ig);
+                       return OpenScope (offset);
+               }
+
+               public void CloseScope (ILGenerator ig)
+               {
+                       int offset = get_il_offset_func (ig);
+                       CloseScope (offset);
+               }
+
                public void MarkSequencePoint (ILGenerator ig, int row, int 
column)
                {
                        int offset = get_il_offset_func (ig);

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

Reply via email to