]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Group related compiler_is_* functions
authorJoel Rosdahl <joel@rosdahl.net>
Sat, 25 Mar 2017 16:19:51 +0000 (17:19 +0100)
committerJoel Rosdahl <joel@rosdahl.net>
Sat, 25 Mar 2017 16:19:51 +0000 (17:19 +0100)
ccache.c

index 9f8a44664435c8db80a36bcf52d39298e759ecde..a9648b770ae7bc1aacf8d17ebe2946821a88339b 100644 (file)
--- a/ccache.c
+++ b/ccache.c
@@ -459,6 +459,36 @@ clean_up_internal_tempdir(void)
        closedir(dir);
 }
 
+// Note that these compiler checks are unreliable, so nothing should
+// hard-depend on them.
+
+static bool
+compiler_is_clang(struct args *args)
+{
+       char *name = basename(args->argv[0]);
+       bool result = strstr(name, "clang") != NULL;
+       free(name);
+       return result;
+}
+
+static bool
+compiler_is_gcc(struct args *args)
+{
+       char *name = basename(args->argv[0]);
+       bool result = strstr(name, "gcc") || strstr(name, "g++");
+       free(name);
+       return result;
+}
+
+static bool
+compiler_is_pump(struct args *args)
+{
+       char *name = basename(args->argv[0]);
+       bool result = str_eq(name, "pump") || str_eq(name, "distcc-pump");
+       free(name);
+       return result;
+}
+
 static char *
 get_current_working_dir(void)
 {
@@ -1082,15 +1112,6 @@ void update_manifest_file(void)
        }
 }
 
-static bool
-compiler_is_pump(struct args *args)
-{
-       char *name = basename(args->argv[0]);
-       bool result = str_eq(name, "pump") || str_eq(name, "distcc-pump");
-       free(name);
-       return result;
-}
-
 // Run the real compiler and put the result in cache.
 static void
 to_cache(struct args *args)
@@ -1570,27 +1591,6 @@ hash_compiler(struct mdfour *hash, struct stat *st, const char *path,
        }
 }
 
-// Note that these compiler checks are unreliable, so nothing should
-// hard-depend on them.
-
-static bool
-compiler_is_clang(struct args *args)
-{
-       char *name = basename(args->argv[0]);
-       bool result = strstr(name, "clang") != NULL;
-       free(name);
-       return result;
-}
-
-static bool
-compiler_is_gcc(struct args *args)
-{
-       char *name = basename(args->argv[0]);
-       bool result = strstr(name, "gcc") || strstr(name, "g++");
-       free(name);
-       return result;
-}
-
 // Update a hash sum with information common for the direct and preprocessor
 // modes.
 static void