]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Refactor "if (!enable_unify)" statement to make it easier to read
authorJoel Rosdahl <joel@rosdahl.net>
Wed, 5 May 2010 20:19:44 +0000 (22:19 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Wed, 5 May 2010 21:11:24 +0000 (23:11 +0200)
ccache.c

index 87bece7abd329cc4b8fe45e7122bfd697d5694b0..9f6bb7b1edcf4b3624e31447a9eb63a62bf83366 100644 (file)
--- a/ccache.c
+++ b/ccache.c
@@ -692,22 +692,7 @@ get_object_name_from_cpp(ARGS *args, struct mdfour *hash)
                failed();
        }
 
-       /* if the compilation is with -g then we have to include the whole of the
-          preprocessor output, which means we are sensitive to line number
-          information. Otherwise we can discard line number info, which makes
-          us less sensitive to reformatting changes
-
-          Note! I have now disabled the unification code by default
-          as it gives the wrong line numbers for warnings. Pity.
-       */
-       if (!enable_unify) {
-               hash_delimiter(hash, "cpp");
-               if (!process_preprocessed_file(hash, path_stdout)) {
-                       stats_update(STATS_ERROR);
-                       unlink(path_stderr);
-                       failed();
-               }
-       } else {
+       if (enable_unify) {
                /*
                 * When we are doing the unifying tricks we need to include the
                 * input file name in the hash to get the warnings right.
@@ -722,6 +707,13 @@ get_object_name_from_cpp(ARGS *args, struct mdfour *hash)
                        cc_log("Failed to unify %s", path_stdout);
                        failed();
                }
+       } else {
+               hash_delimiter(hash, "cpp");
+               if (!process_preprocessed_file(hash, path_stdout)) {
+                       stats_update(STATS_ERROR);
+                       unlink(path_stderr);
+                       failed();
+               }
        }
 
        hash_delimiter(hash, "cppstderr");