]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Tweak code style and manual after 6e1916c7
authorJoel Rosdahl <joel@rosdahl.net>
Mon, 10 Dec 2018 20:04:48 +0000 (21:04 +0100)
committerJoel Rosdahl <joel@rosdahl.net>
Mon, 10 Dec 2018 20:04:48 +0000 (21:04 +0100)
doc/MANUAL.adoc
src/ccache.c
src/ccache.h
src/confitems.c

index 43eaa8db09159ecd7383df8f51491b4cce62ab6b..a10fe95009450f525fbeaf01e7b2f52bcdd8e0d5 100644 (file)
@@ -526,13 +526,18 @@ still has to do _some_ preprocessing (like macros).
     should be a comma-separated string with options. Available options are:
 +
 --
+*clang_index_store*::
+    Ignore the Clang compiler option *-index-store-path* and its argument when
+    computing the manifest hash. This is useful if you use Xcode, which uses an
+    index store path derived from the local project path. Note that the index
+    store won't be updated correctly on cache hits if you enable this option.
 *file_macro*::
     ccache normally includes the input file path in the hash in order to be
-   able to produce the correct object file if the source code includes a
-   `__FILE__` macro. If you know that `__FILE__` isn't used in practise, or
-   don't care if ccache produces objects where `__FILE__` is expanded to the
-   wrong path, you can set *sloppiness* to *file_macro*. ccache will then
-   exclude the input file path from the hash.
+    able to produce the correct object file if the source code includes a
+    `__FILE__` macro. If you know that `__FILE__` isn't used in practise, or
+    don't care if ccache produces objects where `__FILE__` is expanded to the
+    wrong path, you can set *sloppiness* to *file_macro*. ccache will then
+    exclude the input file path from the hash.
 *file_stat_matches*::
     ccache normally examines a file's contents to determine whether it matches
     the cached version. With this option set, ccache will consider a file as
@@ -555,11 +560,6 @@ still has to do _some_ preprocessing (like macros).
     <<_precompiled_headers,PRECOMPILED HEADERS>> for more information.
 *time_macros*::
     Ignore `__DATE__` and `__TIME__` being present in the source code.
-*clang_index_store*::
-    Ignore the Clang compiler option *-index-store-path* and its argument when
-    computing the manifest hash. This is useful if you use Xcode, which uses an
-    index store path derived from the local project path. Note that the index
-    store won't be updated correctly on cache hits if you enable this option.
 --
 +
 See the discussion under <<_troubleshooting,TROUBLESHOOTING>> for more
index b5d52f9a65b4e8d39ebbda759e25259a3841c3d7..6c72da82015e19cbc6463b9e6ae9e4d4487809e5 100644 (file)
@@ -2797,15 +2797,16 @@ cc_process_args(struct args *args, struct args **preprocessor_args,
                        continue;
                }
 
-               if (conf->sloppiness & SLOPPY_CLANG_INDEX_STORE) {
-                       // Xcode 9 or later calls clang with this option.
-                       // The given path has a UUID path which might break the manifest
-                       // especially when cache is shared among multple machines.
-                       if (str_eq(argv[i], "-index-store-path")) {
-                               i++;
-                               cc_log("Skip argument -index-store-path %s", argv[i]);
-                               continue;
+               if (conf->sloppiness & SLOPPY_CLANG_INDEX_STORE
+                   && str_eq(argv[i], "-index-store-path")) {
+                       // Xcode 9 or later calls Clang with this option. The given path includes
+                       // a UUID that might lead to cache misses, especially when cache is
+                       // shared among multple users.
+                       i++;
+                       if (i <= argc - 1) {
+                               cc_log("Skipping argument -index-store-path %s", argv[i]);
                        }
+                       continue;
                }
 
                // Options taking an argument that we may want to rewrite to relative paths
index e47ebab06e550eb927c4e067ea72a9252ca801fc..d98e27780054e5c1a497016965d04128c5d75d52 100644 (file)
@@ -98,8 +98,7 @@ extern enum guessed_compiler guessed_compiler;
 // Allow us to ignore ctimes when comparing file stats, so we can fake mtimes
 // if we want to (it is much harder to fake ctimes, requires changing clock)
 #define SLOPPY_FILE_STAT_MATCHES_CTIME 128
-// Allow us to not include -index-store-path option in the manifest,
-// so that ccache can use with Xcode build.
+// Allow us to not include the -index-store-path option in the manifest hash.
 #define SLOPPY_CLANG_INDEX_STORE 256
 
 #define str_eq(s1, s2) (strcmp((s1), (s2)) == 0)
index c7d37e1fef71c79a411575b8076e782964eb2e12..639f5cb6dfa3f139126dca06aaa933799a9288a4 100644 (file)
@@ -180,7 +180,7 @@ confitem_format_sloppiness(void *value)
        }
        if (*sloppiness & SLOPPY_CLANG_INDEX_STORE) {
                reformat(&s, "%sclang_index_store, ", s);
-       }       
+       }
        if (*sloppiness) {
                // Strip last ", ".
                s[strlen(s) - 2] = '\0';