News for hackers. Stuff that matters.
Re:Apple's Module proposal to replace headers for C-based la... by haberman on Monday November 26, 2012 @02:45PM (#4833598)
> changing any one of the modules bundled in the pch will force you to recompile all compilation units using the pch

Is there a fundamental reason the compilation can't be optimized away?

For example, given a header file A.h, couldn't you precompile it and generate a bloom filter of all preprocessor tokens contained therein (except ones defined in files that A.h includes)? Then if B.h (which includes A.h) changes, see if any of the preprocessor macros that are defined at the point of inclusion are in A's bloom filter. If not, you can safely skip the recompilation of A.h. If so, you should probably change A.h anyway to directly include the definition of any macros that are affecting its compilation.

Re:Apple's Module proposal to replace headers for C-based la... by nkurz on Monday November 26, 2012 @03:44PM (#4833931)
I wonder how necessary this actually is. I think using non-command-line defines to change the behavior of header files is rare. From what I can tell, ccache just ignores the issue: https://ccache.samba.org/manual.html#_how_ccache_works

I'm not sure how it gets away with this and works as well as it does. Maybe there is a behind the scenes check that I don't know about? In any case, it might be a good framework to add the caching you describe.

Re:Apple's Module proposal to replace headers for C-based la... by plorkyeran on Monday November 26, 2012 @07:26PM (#4834824)
ccache doesn't cache the results of compiling each individual header. Other than the shared cache, ccache is conceptually just a workaround for deficiencies in make.