From 27098a5413b431209704f655e6964cb91f260596 Mon Sep 17 00:00:00 2001 From: Raja R Harinath Date: Wed, 26 Jul 2006 11:55:01 +0000 Subject: [PATCH] * tree.cs (Tree.RecordDecl): Remove. (RootTypes.AddToTypeContainer): Record the toplevel type in its namespace here. * class.cs, cs-parser.jay: Remove mention of RecordDecl. svn path=/trunk/mcs/; revision=62990 --- mcs/gmcs/ChangeLog | 7 +++++++ mcs/gmcs/class.cs | 7 ++----- mcs/gmcs/cs-parser.jay | 3 --- mcs/gmcs/tree.cs | 11 ++++------- mcs/mcs/ChangeLog | 7 +++++++ mcs/mcs/class.cs | 7 ++----- mcs/mcs/cs-parser.jay | 2 -- mcs/mcs/tree.cs | 11 ++++------- 8 files changed, 26 insertions(+), 29 deletions(-) diff --git a/mcs/gmcs/ChangeLog b/mcs/gmcs/ChangeLog index 91dca7898de..5e1bc8d0ff2 100644 --- a/mcs/gmcs/ChangeLog +++ b/mcs/gmcs/ChangeLog @@ -1,3 +1,10 @@ +2006-07-26 Raja R Harinath + + * tree.cs (Tree.RecordDecl): Remove. + (RootTypes.AddToTypeContainer): Record the toplevel type in its + namespace here. + * class.cs, cs-parser.jay: Remove mention of RecordDecl. + 2006-07-23 Raja R Harinath * codegen.cs (EmitContext.Flags): Move InCatch, InFinally, diff --git a/mcs/gmcs/class.cs b/mcs/gmcs/class.cs index 651b8398e70..313f9129b56 100644 --- a/mcs/gmcs/class.cs +++ b/mcs/gmcs/class.cs @@ -530,7 +530,6 @@ namespace Mono.CSharp { if (types == null) types = new ArrayList (2); - RootContext.Tree.RecordDecl (c.NamespaceEntry.NS, c.MemberName, c); types.Add (c); return true; } @@ -600,7 +599,7 @@ namespace Mono.CSharp { if (delegates == null) delegates = new MemberCoreArrayList (); - + delegates.Add (d); } @@ -678,11 +677,9 @@ namespace Mono.CSharp { if (!AddToTypeContainer (iface)) return false; - if (interfaces == null) { + if (interfaces == null) interfaces = new MemberCoreArrayList (); - } - RootContext.Tree.RecordDecl (iface.NamespaceEntry.NS, iface.MemberName, iface); interfaces.Add (iface); return true; } diff --git a/mcs/gmcs/cs-parser.jay b/mcs/gmcs/cs-parser.jay index 9fb775e9587..2f8b3a40995 100644 --- a/mcs/gmcs/cs-parser.jay +++ b/mcs/gmcs/cs-parser.jay @@ -2553,7 +2553,6 @@ enum_declaration } current_container.AddEnum (e); - RootContext.Tree.RecordDecl (current_namespace.NS, name, e); $$ = e; } @@ -2663,8 +2662,6 @@ delegate_declaration } current_container.AddDelegate (del); - RootContext.Tree.RecordDecl (current_namespace.NS, name, del); - current_delegate = del; } opt_type_parameter_constraints_clauses diff --git a/mcs/gmcs/tree.cs b/mcs/gmcs/tree.cs index d6a822811d0..650d82b111c 100644 --- a/mcs/gmcs/tree.cs +++ b/mcs/gmcs/tree.cs @@ -37,12 +37,6 @@ namespace Mono.CSharp { root_types = new RootTypes (); } - - public void RecordDecl (Namespace ns, MemberName name, DeclSpace ds) - { - if (ds.Parent == root_types) - ns.AddDeclSpace (name.Basename, ds); - } // // FIXME: Why are we using Types? @@ -77,7 +71,10 @@ namespace Mono.CSharp protected override bool AddToTypeContainer (DeclSpace ds) { - return AddToContainer (ds, ds.Name); + if (!AddToContainer (ds, ds.Name)) + return false; + ds.NamespaceEntry.NS.AddDeclSpace (ds.Basename, ds); + return true; } public override TypeContainer AddPartial (TypeContainer nextPart) diff --git a/mcs/mcs/ChangeLog b/mcs/mcs/ChangeLog index afa46c296d1..db1b6477d3f 100644 --- a/mcs/mcs/ChangeLog +++ b/mcs/mcs/ChangeLog @@ -1,3 +1,10 @@ +2006-07-26 Raja R Harinath + + * tree.cs (Tree.RecordDecl): Remove. + (RootTypes.AddToTypeContainer): Record the toplevel type in its + namespace here. + * class.cs, cs-parser.jay: Remove mention of RecordDecl. + 2006-07-23 Raja R Harinath * codegen.cs (EmitContext.Flags): Move InCatch, InFinally, diff --git a/mcs/mcs/class.cs b/mcs/mcs/class.cs index 1cd92b6df75..eeb2353b13b 100644 --- a/mcs/mcs/class.cs +++ b/mcs/mcs/class.cs @@ -532,7 +532,6 @@ namespace Mono.CSharp { if (types == null) types = new ArrayList (2); - RootContext.Tree.RecordDecl (c.NamespaceEntry.NS, c.MemberName, c); types.Add (c); return true; } @@ -602,7 +601,7 @@ namespace Mono.CSharp { if (delegates == null) delegates = new MemberCoreArrayList (); - + delegates.Add (d); } @@ -680,11 +679,9 @@ namespace Mono.CSharp { if (!AddToTypeContainer (iface)) return false; - if (interfaces == null) { + if (interfaces == null) interfaces = new MemberCoreArrayList (); - } - RootContext.Tree.RecordDecl (iface.NamespaceEntry.NS, iface.MemberName, iface); interfaces.Add (iface); return true; } diff --git a/mcs/mcs/cs-parser.jay b/mcs/mcs/cs-parser.jay index 30beddad3bd..8b948ae19b1 100644 --- a/mcs/mcs/cs-parser.jay +++ b/mcs/mcs/cs-parser.jay @@ -2407,7 +2407,6 @@ enum_declaration } current_container.AddEnum (e); - RootContext.Tree.RecordDecl (current_namespace.NS, name, e); $$ = e; } @@ -2514,7 +2513,6 @@ delegate_declaration } current_container.AddDelegate (del); - RootContext.Tree.RecordDecl (current_namespace.NS, name, del); $$ = del; } ; diff --git a/mcs/mcs/tree.cs b/mcs/mcs/tree.cs index d6a822811d0..650d82b111c 100644 --- a/mcs/mcs/tree.cs +++ b/mcs/mcs/tree.cs @@ -37,12 +37,6 @@ namespace Mono.CSharp { root_types = new RootTypes (); } - - public void RecordDecl (Namespace ns, MemberName name, DeclSpace ds) - { - if (ds.Parent == root_types) - ns.AddDeclSpace (name.Basename, ds); - } // // FIXME: Why are we using Types? @@ -77,7 +71,10 @@ namespace Mono.CSharp protected override bool AddToTypeContainer (DeclSpace ds) { - return AddToContainer (ds, ds.Name); + if (!AddToContainer (ds, ds.Name)) + return false; + ds.NamespaceEntry.NS.AddDeclSpace (ds.Basename, ds); + return true; } public override TypeContainer AddPartial (TypeContainer nextPart) -- 2.25.1