]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
fix: Disable preprocessor hits for PCHs with Clang again (#909)
authorArne Hasselbring <arha@uni-bremen.de>
Fri, 30 Jul 2021 18:29:45 +0000 (20:29 +0200)
committerGitHub <noreply@github.com>
Fri, 30 Jul 2021 18:29:45 +0000 (20:29 +0200)
I added this in 3ec58dbcaa1e7903d59dce4c77baff7bc3783269 as I thought
clang only saves the timestamps of included files, so as long as they
are turned off by -Xclang -fno-pch-timestamp, preprocessed hits should be
possible. However, clang also saves the size and possibly a hash of the
un-preprocessed source file, so preprocessed hits don't make much sense.

As long as only the timestamp of a PCH source file changed, e.g. through
git operations, there should still be direct hits.

src/ccache.cpp

index 18bec173238e01f1760b77ff6942cb16bdf0aa1a..357df19bccb05d916386e7623baefd8c91f4dba4 100644 (file)
@@ -1707,7 +1707,7 @@ from_cache(Context& ctx, FromCacheCallMode mode, const Digest& result_key)
   if ((ctx.config.compiler_type() == CompilerType::clang
        || ctx.config.compiler_type() == CompilerType::other)
       && ctx.args_info.output_is_precompiled_header
-      && !ctx.args_info.fno_pch_timestamp && mode == FromCacheCallMode::cpp) {
+      && mode == FromCacheCallMode::cpp) {
     LOG_RAW("Not considering cached precompiled header in preprocessor mode");
     return nullopt;
   }