[cfe-commits] [PATCH] Allow PCHReader to be used without having a pre-initialized Preprocessor

Chris Lattner clattner at apple.com
Thu Jun 18 10:37:00 PDT 2009


On Jun 18, 2009, at 9:39 AM, Douglas Gregor wrote:
>>> Prelinking can save a lot of disk I/O and a bunch of computation,  
>>> since many templates end up being instantiated in several  
>>> different .o files. With prelinking, these instantiations only  
>>> happen once, and we only instantiate what the linker actually  
>>> needs. However, prelinking has never been a huge win because  
>>> "spawning the compiler" meant re-parsing all of the source code.  
>>> With AST files, we only bring in the code that we need to perform  
>>> the template instantiation itself.
>>
>> That would be very nice.  We'd only want to do that at -O0, because  
>> this would prevent inlining of these templates etc.  However it  
>> could be a pretty huge compile-time performance win for -O0.
>
>
> Or -O4?

Even at -O4 we want to do inlining and other optimization at compile  
time.  We just *also* do it at link time :)

-Chris



More information about the cfe-commits mailing list