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]

Re: Precompiled headers (or other speed ups)


Zack Weinberg writes:

> C++ reads files through cpplib, which is naturally as fast as I and
> Neil Booth have been able to make it...
> 
> The parser, on the other hand, is not efficient at all...
>
> I don't know enough about C++ or its implementation in GCC to say for
> sure what the ultimate cause is.  I've been told that C++ has an
> extremely ambiguous grammar and the parser has to accumulate entire
> statements on the stack before it can begin to match anything.

It is true that the C++ grammar is ugly, but it is not nearly as ugly as
gcc/cp/parse.y is.  The bison grammar has had about 10 years worth of
changes applied to track a rapidly evolving language, and it contains many
expensive kludges that no one dares touch.  Mark Mitchell's been talking
about pitching the whole thing and redoing it (after 3.0).

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