Extending functionality of -frepo

Mike Stump mrs@apple.com
Wed Sep 7 19:41:00 GMT 2005


On Sep 7, 2005, at 12:36 AM, Noe Aljaz ITICMN wrote:
> Maybe... I think the 'big_header', which is required by template
> definitions, has a big impact here. And I find it hard to believe that
> excluding a big chunk of code from compilation results in no speed-up.
> Even when using precompiled headers, .pch files can get pretty big,  
> and
> they must still be loaded,

They do?  Odd, on my platform, we only mmap them.  If one doesn't  
touch them (and nothing else near them), they aren't loaded for me.

> which takes time.

mmap is fairly quick (as compared to compilation speed).

> The main question I guess is: How difficult is to implement this - 
> frepo2 functionality?

Trivial enough, if you want to try it, assuming you want to put the  
#ifndef NO_TEMPLATE_INSTANTIATION into your code manually.

1 line to add an implicit -DNO_TEMPLATE_INSTANTIATION, 5 lines to add  
option to turn it off, 2 lines to add that option to the repo options  
list.

The code to add the templates bits that don't have definitions, only  
declarations would be the most work, but even that should mostly be  
copying already existing code.  About 30-50 lines, I'd guess.

> If it is relatively simple and a patch is made, we can test all we  
> want
> and then decide whether it is worth having it in the compiler or not.

Feel free to do this if you want.  I think we should be able to  
provide enough hints and pointers to allow you to complete the code.

If you want to get started:

       if (warn_deprecated)
         cpp_define (pfile, "__DEPRECATED");

c.opt:
Wdeprecated
C++ ObjC++ Var(warn_deprecated) Init(1)
Warn about deprecated compiler features

For adding the flag during collect2, see COLLECT_GCC_OPTIONS in  
collect2.c.



More information about the Gcc mailing list