This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Pre-compiled headers
At 10:36 AM -0800 2000/1/12, Per Bothner wrote:
> I vaguely remember that RMS's partially implemented design used
> a third idea:
>
> #3 Only scan certain definitions if they are needed in the actual
> program. I don't remember how this was done.
For what it's worth, this was implemented in the "cpp-precomp"
at NeXT, and worked (still works) pretty well for C. It had to do
more actual parsing than a regular cpp, which is one reason why
Apple has not extended that to work with/for C++. Steve Naroff
tells me that there was a paper published in the ACM somewhere,
that described this work.
> #2a: Instead of just tokenizing each header file, we store
> a pre-compiled version that actually contains tree nodes
> in the binary format of the host system.
> [...] performing relocation. Relocation means walking
> over the tree nodes and fixing up pointers.
Apple's "MrC"/"MrCpp" compiler for Mac OS uses a scheme like this
one -- it seems to work pretty well in that context.
-- Doug