]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Move update_cached_result_globals() up within source file
authorGeert Kloosterman <geert.kloosterman@brightcomputing.com>
Wed, 4 Apr 2018 20:05:46 +0000 (22:05 +0200)
committerGeert Kloosterman <geert.kloosterman@brightcomputing.com>
Wed, 4 Apr 2018 20:05:46 +0000 (22:05 +0200)
Move function so that we can use it in `to_cache()`.

src/ccache.c

index 0cf6d9029aa9209d41e06986da05090750724c5a..49f4c3c229d2ed5f0d9cc73afd2b58440b7f5692 100644 (file)
@@ -1178,6 +1178,23 @@ void update_manifest_file(void)
        }
 }
 
+static void
+update_cached_result_globals(struct file_hash *hash)
+{
+       char *object_name = format_hash_as_string(hash->hash, hash->size);
+       cached_obj_hash = hash;
+       cached_obj = get_path_in_cache(object_name, ".o");
+       cached_stderr = get_path_in_cache(object_name, ".stderr");
+       cached_dep = get_path_in_cache(object_name, ".d");
+       cached_cov = get_path_in_cache(object_name, ".gcno");
+       cached_su = get_path_in_cache(object_name, ".su");
+       cached_dia = get_path_in_cache(object_name, ".dia");
+       cached_dwo = get_path_in_cache(object_name, ".dwo");
+
+       stats_file = format("%s/%c/stats", conf->cache_dir, object_name[0]);
+       free(object_name);
+}
+
 // Run the real compiler and put the result in cache.
 static void
 to_cache(struct args *args)
@@ -1474,23 +1491,6 @@ get_object_name_from_cpp(struct args *args, struct mdfour *hash)
        return result;
 }
 
-static void
-update_cached_result_globals(struct file_hash *hash)
-{
-       char *object_name = format_hash_as_string(hash->hash, hash->size);
-       cached_obj_hash = hash;
-       cached_obj = get_path_in_cache(object_name, ".o");
-       cached_stderr = get_path_in_cache(object_name, ".stderr");
-       cached_dep = get_path_in_cache(object_name, ".d");
-       cached_cov = get_path_in_cache(object_name, ".gcno");
-       cached_su = get_path_in_cache(object_name, ".su");
-       cached_dia = get_path_in_cache(object_name, ".dia");
-       cached_dwo = get_path_in_cache(object_name, ".dwo");
-
-       stats_file = format("%s/%c/stats", conf->cache_dir, object_name[0]);
-       free(object_name);
-}
-
 // Hash mtime or content of a file, or the output of a command, according to
 // the CCACHE_COMPILERCHECK setting.
 static void