This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Precompiled headers and General Parsing of Header File
Jason Merrill wrote:
>
> >>>>> Kevin Atkinson <kevina@clark.net> writes:
>
> > Also have you considered the idea of not fully parsing the header files
> > with template information in it ot help speed up compiling of code that
> > uses the STL.
>
> > By not fully parsing the header file I mean skipping over the
> > class/functions definitions. For example:
>
> Actually, g++ used to work this way. I changed that in '96 so that
> templates would actually work properly; trying to feed stuff back to the
> parser is very tricky with a non-reentrant parser, and the semantics are
> wrong anyway. The standard specifies that names which do not depend on a
> template argument are bound at the point of the template definition.
>
Hu! You really lost me here. Could you elaborate.
I understand that not parsing template definitions also means not catching
syntax errors until they are instantiated, however to me that is a minor
drawback which can easily be fixed with a command line option...
Templates are a beautiful thing, however in reality they are very difficult to
both implement correctly and efficiently.
Truefully I find the compile time for code that uses the STL ridiculously slow
and there seams to me that they has got to be a way to speed things up by a
factor of 1/2 or more...