This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: C++ PATCH: Remove build_component_ref
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Neil Booth <neil at daikokuya dot co dot uk>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 07 Aug 2002 23:37:22 -0700
- Subject: Re: C++ PATCH: Remove build_component_ref
--On Thursday, August 08, 2002 07:21:12 AM +0100 Neil Booth
<neil@daikokuya.co.uk> wrote:
Mark Mitchell wrote:-
As a side-effect, this patch gets rid of some more places where we
were looking up the same name multiple times rather than simply
remembering the answer the first time we looked it up.
I have a feeling this kind of "do-something-many-times", or "check
something we long ago checked" is quite common in the C front ends
(and e.g. fold-const), but I could be wrong.
You're right.
Gradually, we're stomping this evilness out, but we've a long way to go.
One of the objectives of the new parser work is to do things exactly the
way the standard says you do them -- first you lex, then you do some
name lookup, then you parse, then you do some semantic analysis, then
you're done. (From the point of view of the front end.)
Also, when you do template instantiation you do *exactly* what you would
do if you were parsing in terms of name lookup and semantic analysis;
right now things don't match up exactly, leading to subtle oddities.
It's not really very hard to get this stuff right -- but you do have
to organize things correctly.
The patch before this one actually fixed some cases where I believe the
same member function name was looked up 4 times: during lexing, and
then three times during semantic analysis.
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com