From mboxrd@z Thu Jan 1 00:00:00 1970 From: Noel Yap To: Neil Booth Cc: Mike Stump , gcc@gcc.gnu.org Subject: Re: Faster compilation speed Date: Fri, 09 Aug 2002 14:44:00 -0000 Message-id: <20020809214452.75155.qmail@web21412.mail.yahoo.com> References: <20020809212043.GC21900@daikokuya.co.uk> X-SW-Source: 2002-08/msg00508.html --- Neil Booth 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