C++ PATCH: Remove build_component_ref

Mark Mitchell mark@codesourcery.com
Wed Aug 7 23:39:00 GMT 2002



--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



More information about the Gcc-patches mailing list