Author: martin
Date: 2006-11-24 09:31:15 -0500 (Fri, 24 Nov 2006)
New Revision: 68428

Modified:
   branches/martin/anonymous-methods2/mcs/anonymous.cs
   branches/martin/anonymous-methods2/mcs/statement.cs
Log:


Modified: branches/martin/anonymous-methods2/mcs/anonymous.cs
===================================================================
--- branches/martin/anonymous-methods2/mcs/anonymous.cs 2006-11-24 13:48:51 UTC 
(rev 68427)
+++ branches/martin/anonymous-methods2/mcs/anonymous.cs 2006-11-24 14:31:15 UTC 
(rev 68428)
@@ -299,19 +299,12 @@
                        return te.Type;
                }
 
-               public static void EmitScopeInstance (EmitContext ec, ScopeInfo 
scope,
-                                                     ToplevelBlock toplevel)
+               public static void EmitScopeInstance (EmitContext ec, ScopeInfo 
scope)
                {
-                       RootScopeInfo root_scope = toplevel.RootScope;
-
-                       Report.Debug (128, "EMIT SCOPE INSTANCE", toplevel,
-                                     toplevel.AnonymousContainer, root_scope,
-                                     scope, scope.RootScope);
-
                        scope.EmitScopeInstance (ec);
 
-                       if (toplevel.AnonymousContainer != null) {
-                               ScopeInfo host = 
toplevel.AnonymousContainer.Scope;
+                       if (ec.CurrentAnonymousMethod != null) {
+                               ScopeInfo host = 
ec.CurrentAnonymousMethod.Scope;
                                Variable captured = host.GetCapturedScope 
(scope);
                                Report.Debug (128, "EMIT SCOPE INSTANCE #2", 
host, scope, captured);
                                if (captured != null)
@@ -425,7 +418,9 @@
 
                        public override void EmitInstance (EmitContext ec)
                        {
-                               ec.CurrentBlock.Toplevel.EmitScopeInstance (ec, 
Scope);
+                               Report.Debug (128, "CAPTURED VARIABLE EMIT 
INSTANCE",
+                                             this, Name, Scope, 
ec.CurrentBlock);
+                               ScopeInfo.EmitScopeInstance (ec, Scope);
                        }
 
                        public override void Emit (EmitContext ec)
@@ -703,8 +698,7 @@
                                        init.EmitStatement (ec);
 
                                        DoEmit (ec);
-                                       ScopeInfo.EmitScopeInstance (
-                                               ec, scope.ChildScope, 
ec.CurrentBlock.Toplevel);
+                                       ScopeInfo.EmitScopeInstance (ec, 
scope.ChildScope);
                                        scope.EmitAssign (ec);
                                }
                        }

Modified: branches/martin/anonymous-methods2/mcs/statement.cs
===================================================================
--- branches/martin/anonymous-methods2/mcs/statement.cs 2006-11-24 13:48:51 UTC 
(rev 68427)
+++ branches/martin/anonymous-methods2/mcs/statement.cs 2006-11-24 14:31:15 UTC 
(rev 68428)
@@ -2437,11 +2437,6 @@
                        }
                }
 
-               public void EmitScopeInstance (EmitContext ec, ScopeInfo scope)
-               {
-                       ScopeInfo.EmitScopeInstance (ec, scope, this);
-               }
-
                public FlowBranchingToplevel TopLevelBranching {
                        get { return top_level_branching; }
                }

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

Reply via email to