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]

Precompiled headers and General Parsing of Header File


Thomas Wagner wrote:
> 
> Does egcs allow for precompiling header files?

I have been meaning to suggest that for a long time.  I am glad you brought it
up.

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:

template <class X>
void long_func (X a, X b) {
  /* very vert long defination
   ...
   ...
   ...
   ...
   ...
  */
}

When reading the above code for the first time the compiler will just take the
inner code and put it into one large block with out parsing it at all (unless
to check for nested {} and } in quotes).

It will then be parsed only when it is instantiated.

This to me would seam to save a lot of time when a lot of unused templates are
included in the header file like with SGI STL.

This idea could even be extended to class information because if the class
never gets called there is no need to know what members it has.

So what do you think of that idea.  Would it help speed up compile time?

Thanks Again.

Kevin Atkinson


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