From: Joel Rosdahl Date: Wed, 5 May 2010 20:19:44 +0000 (+0200) Subject: Refactor "if (!enable_unify)" statement to make it easier to read X-Git-Tag: v3.0pre1~28 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=3aba52af10988afd4c7e5dd9d1944b14146da7dc;p=thirdparty%2Fccache.git Refactor "if (!enable_unify)" statement to make it easier to read --- diff --git a/ccache.c b/ccache.c index 87bece7ab..9f6bb7b1e 100644 --- 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");