This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: C++: Why do we nreverse CLASSTYPE_TAGS


Jason Merrill <jason at redhat dot com> writes:

| On 25 Mar 2003 06:38:33 +0100, Gabriel Dos Reis <gdr at integrable-solutions dot net> wrote:
| 
| > Yes.  However, a linear search is done when looking for nested-types
| > in decl.c:lookup_tag().  Replacing current_binding_level->tags with a 
| > hash-table turned out to affect CLASSTYPE_TAGS also since we do some
| > random assignments here and there...
| 
| Do we still need to use current_binding_level->tags to find types?
| Shouldn't that information be in the BINDING structures now?  We really
| ought to unify the name lookup code.

I agree 100% with you.  And that is the road I took until I discovered
that the changes might be too invasive for acceptance into 3.3.  That
is the reason why I fall back to the more conservative solution of
replacing current_binding_level->tags with a hash-table, and later
(i.e. mainline) unify the code.  
In the course of unifying the name lookup code, I discovered many
lovely monstruosities :-)

In fact, I think we do not need to recreate the bindings each time we
push into the scope of a class; we should be able to reuse the snapshot
established  at popclass().

-- Gaby


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]