[ccache] [PATCH] Support for Clang precompiled headers

Lubos Lunak l.lunak at suse.cz
Fri Jul 6 11:09:10 MDT 2012


 Hello,

 the attached patches modify ccache to also support Clang PCH in addition to 
GCC PCH.

 The changes are:

- Clang uses .pch as the extension, not .gch
- the .pch file can be directly passed using -include-pch, instead of 
using -include and trying to find the .pch file
- the use of a .pch is not reflected in the resulting .ii , so it needs to be 
explicitly added to the hash for checking if used files have changed
- I also believe that path_len passed to remember_include_file() is incorrect, 
as make_relative_path() may change the string

PS: Since I've noticed in the archives the recent mail about issues with 
ccache and warnings about unused arguments: The proper way to use ccache with 
Clang is to set CCACHE_CPP2, which not only avoids these warnings, but in 
general Clang works suboptimally if passed preprocessed output (warning/error 
messages quoting sources are affected, some warnings are not supressed in 
headers).

-- 
 Lubos Lunak
 l.lunak at suse.cz
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-support-for-precompiled-headers-with-clang.patch
Type: text/x-diff
Size: 3710 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/ccache/attachments/20120706/08f5e187/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-do-not-pass-incorrect-length-to-remember_include_fil.patch
Type: text/x-diff
Size: 1667 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/ccache/attachments/20120706/08f5e187/attachment-0001.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-hash-clang-s-.pch-file-explicitly.patch
Type: text/x-diff
Size: 3110 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/ccache/attachments/20120706/08f5e187/attachment-0002.patch>


More information about the ccache mailing list