This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: C++: Why do we nreverse CLASSTYPE_TAGS
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- Cc: gcc at gcc dot gnu dot org, jason at redhat dot com
- Date: 24 Mar 2003 10:22:21 -0800
- Subject: Re: C++: Why do we nreverse CLASSTYPE_TAGS
- References: <m3y934eiva.fsf@uniton.integrable-solutions.net>
On Mon, 2003-03-24 at 10:10, Gabriel Dos Reis wrote:
>
> Hi,
>
> While working for a conservative solution (i.e. minimal patch) for
> reducing excessive compile-time in GCC-3.3/cc1plus, I noted that we
> are nreverse()ing the list of class-types or enums declared at a
> class-scope in cp/class.c:unreverse_member_declarations().
>
> As far as I can see, reversing the CLASSTYPE_TAGS is not necessary
> since the whole purpose of CLASSTYPE_TAGS is serving as a database for
> name lookup.
>
> What am I missing?
Nothing, really. But:
(1) The order there may matter when doing template instantiation. It
makes sense to instantiate the CLASSTYPE_TAGS in the order they appeared
in the source.
(2) In general, the IL ought to represent the source; source order here
makes sense.
(3) nreverse is pretty cheap.
--
Mark Mitchell
CodeSourcery, LLC
mark at codesourcery dot com