svn path=/branches/martin/anonymous-methods2/mcs/; revision=68267
authorMartin Baulig <martin@novell.com>
Tue, 21 Nov 2006 18:40:52 +0000 (18:40 -0000)
committerMartin Baulig <martin@novell.com>
Tue, 21 Nov 2006 18:40:52 +0000 (18:40 -0000)
mcs/mcs/anonymous.cs
mcs/mcs/expression.cs
mcs/mcs/statement.cs

index 7dd054814630f2b457405c85da38c8b5d764304e..bc2836568b9c8f730ac5e14672ab4492752e03e1 100644 (file)
@@ -172,7 +172,7 @@ namespace Mono.CSharp {
                        ToplevelBlock toplevel = block.Toplevel;
                        AnonymousContainer ac = toplevel.AnonymousContainer;
 
-                       Report.Debug (128, "CREATE SCOPE", block, toplevel, ac);
+                       Report.Debug (128, "CREATE SCOPE", block, block.ScopeInfo, toplevel, ac);
 
                        if (ac == null)
                                return new ScopeInfo (block, toplevel.RootScope.Parent);
@@ -191,9 +191,14 @@ namespace Mono.CSharp {
                                }
                        }
 
-                       Report.Debug (128, "CREATRE SCOPE #1", parent);
+                       Report.Debug (128, "CREATE SCOPE #2", parent);
 
-                       return new ScopeInfo (block, parent);
+                       ScopeInfo new_scope = new ScopeInfo (block, parent);
+
+                       Report.Debug (128, "CREATE SCOPE #3", new_scope);
+                       // Report.StackTrace ();
+
+                       return new_scope;
                }
 
                protected ScopeInfo (Block block, TypeContainer parent)
@@ -204,7 +209,8 @@ namespace Mono.CSharp {
                        RootScope = block.Toplevel.RootScope;
                        ScopeBlock = block;
 
-                       Report.Debug (128, "NEW SCOPE", this, block);
+                       Report.Debug (128, "NEW SCOPE", this, block,
+                                     block.Parent, block.Toplevel);
 
                        RootScope.AddScope (this);
                }
@@ -217,7 +223,7 @@ namespace Mono.CSharp {
                        RootScope = (RootScopeInfo) this;
                        ScopeBlock = toplevel;
 
-                       Report.Debug (128, "NEW ROOT SCOPE", this);
+                       Report.Debug (128, "NEW ROOT SCOPE", this, toplevel, loc);
                }
 
                protected ScopeInfo host_scope;
@@ -376,6 +382,7 @@ namespace Mono.CSharp {
 
                public Variable AddLocal (LocalInfo local)
                {
+                       Report.Debug (128, "CAPTURE LOCAL", this, local);
                        Variable var = (Variable) locals [local];
                        if (var == null) {
                                var = new CapturedLocal (this, local);
@@ -661,8 +668,9 @@ namespace Mono.CSharp {
 
                        protected virtual void DoEmitStatement (EmitContext ec)
                        {
-                               Report.Debug (64, "EMIT SCOPE INIT", this, id,
+                               Report.Debug (128, "EMIT SCOPE INITIALIZER STATEMENT", this, id,
                                              Scope, scope_instance, ec);
+                               // Report.StackTrace ();
 
                                ec.ig.Emit (OpCodes.Nop);
                                ec.ig.Emit (OpCodes.Ldc_I4, id);
@@ -1525,7 +1533,12 @@ namespace Mono.CSharp {
                        Block b;
                        scope = RootScope;
 
-                       for (b = Block; b != null; b = b.Parent) {
+                       Report.Debug (128, "CREATE METHOD HOST #1", this, Block, Block.ScopeInfo,
+                                     RootScope, Location);
+
+                       for (b = Block.Parent; b != null; b = b.Parent) {
+                               Report.Debug (128, "CREATE METHOD HOST #2", this, Block,
+                                             b, b.ScopeInfo);
                                if (b.ScopeInfo != null) {
                                        scope = b.ScopeInfo;
                                        break;
index 6cd15a7b977dae02cc4b420ec723b27e7ac9010e..207608d79591df5fea39f74ecf81f4748c223dbd 100644 (file)
@@ -3512,6 +3512,9 @@ namespace Mono.CSharp {
                        if (!VerifyAssigned (ec))
                                return null;
 
+                       Report.Debug (128, "RESOLVE LOCAL INFO", this, Name, loc, local_info,
+                                     ec.MustCaptureVariable (local_info));
+
                        //
                        // If we are referencing a variable from the external block
                        // flag it for capturing
@@ -3525,6 +3528,10 @@ namespace Mono.CSharp {
                                ScopeInfo scope = local_info.Block.CreateScopeInfo ();
                                variable = scope.AddLocal (local_info);
                                type = variable.Type;
+
+                               Report.Debug (128, "RESOLVE LOCAL INFO #1", this, Name, loc, local_info,
+                                             ec.MustCaptureVariable (local_info), scope, variable);
+
                        }
 
                        return this;
index bb0aea29d491d3cdbd7e7e6bc11809553aff51b2..0e6eb81159b0d204ff61f9244ead201ab9127133 100644 (file)
@@ -2002,7 +2002,7 @@ namespace Mono.CSharp {
                //
                public virtual void EmitMeta (EmitContext ec)
                {
-                       Report.Debug (64, "BLOCK EMIT META", this, Toplevel, ScopeInfo, ec);
+                       Report.Debug (64, "BLOCK EMIT META", this, Parent, Toplevel, ScopeInfo, ec);
                        if (ScopeInfo != null) {
                                scope_init = ScopeInfo.GetScopeInitializer (ec);
                                Report.Debug (64, "BLOCK EMIT META #1", this, Toplevel, ScopeInfo,