This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Faster compilation speed
- From: Noel Yap <yap_noel at yahoo dot com>
- To: Neil Booth <neil at daikokuya dot co dot uk>
- Cc: Mike Stump <mrs at apple dot com>, gcc at gcc dot gnu dot org
- Date: Fri, 9 Aug 2002 14:44:52 -0700 (PDT)
- Subject: Re: Faster compilation speed
--- Neil Booth <neil@daikokuya.co.uk> wrote:
> Heh, if only life were this easy. If you actually
> think about what CPP
> does, you'd realize this is a no-go. Two immediate
> issues:
>
> 1) #include can take a macro as argument
Yes, what I suggest certainly won't work for this
situation.
OTOH, how many times is this really used? Would it be
such a sin to say that one cannot do the preprocessing
I suggested if one has macros for #include arguments?
> 2) #include can appear in preprocessor conditional
> blocks. You
> only know whether they are processed if you know
> the correct value
> of the #if. This often depends on macro
> expansions, and correct
> processing of prior includes. Of course,
> #defines appear in
> conditional blocks too, so this is kind of
> important to get right.
I don't see this as too big a problem. Just output a
file like:
#if COND
/* contents of header file
#endif
In fact, doing it this way has the advantage that
several builds, not necessarily agreeing on the value
of COND, can use the file.
> There are no easy shortcuts here: to preprocess
> something properly,
> you have to do *everything* the preprocessor does
> "normally". There
> are no shortcuts, not even trivial ones.
I think one needn't preprocess everything perfectly in
order to gain significant advantages. Would you say
that what I suggest is better than what we have now?
If an ideal solution is being worked on, I'd opt for
that. OTOH, I think this solution has been in the
works for at least a couple of years now. I think the
--preprocess-includes option should be very simple to
do.
> We *do* do too many stats and opens though; when I
> get time I'll post
> my ideas about this.
I'm sure my ideas are far from ideal so I'm looking
forward to yours.
Noel
__________________________________________________
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com