From: John Basila Date: Sat, 21 May 2016 13:20:33 +0000 (+0300) Subject: preprocessor mode: enable using identical header in different paths X-Git-Tag: v3.3~58 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5908e656;p=thirdparty%2Fccache.git preprocessor mode: enable using identical header in different paths --- diff --git a/ccache.c b/ccache.c index faa39f0df..f4d97cae0 100644 --- a/ccache.c +++ b/ccache.c @@ -887,7 +887,6 @@ process_preprocessed_file(struct mdfour *hash, const char *path) has_absolute_include_headers = is_absolute_path(path); } path = make_relative_path(path); - hash_string(hash, path); remember_include_file(path, hash, system); p = r; } else { diff --git a/test.sh b/test.sh index 9aeeee3cf..b74d212b4 100755 --- a/test.sh +++ b/test.sh @@ -1280,8 +1280,8 @@ EOF checkstat 'cache miss' 1 $CCACHE $COMPILER -c `pwd`/file.c checkstat 'cache hit (direct)' 1 - checkstat 'cache hit (preprocessed)' 0 - checkstat 'cache miss' 2 + checkstat 'cache hit (preprocessed)' 1 + checkstat 'cache miss' 1 testname="__FILE__ in include file" $CCACHE -Cz >/dev/null @@ -1304,8 +1304,8 @@ EOF mv file_h.c file2_h.c $CCACHE $COMPILER -c `pwd`/file2_h.c checkstat 'cache hit (direct)' 1 - checkstat 'cache hit (preprocessed)' 0 - checkstat 'cache miss' 2 + checkstat 'cache hit (preprocessed)' 1 + checkstat 'cache miss' 1 ################################################################## # Check that direct mode ignores __FILE__ if sloppiness is specified. @@ -1491,12 +1491,12 @@ EOF checkstat 'cache miss' 1 CPATH=subdir2 $CCACHE $COMPILER -c foo.c checkstat 'cache hit (direct)' 1 - checkstat 'cache hit (preprocessed)' 0 - checkstat 'cache miss' 2 # subdir2 is part of the preprocessor output + checkstat 'cache hit (preprocessed)' 1 + checkstat 'cache miss' 1 # subdir2 is part of the preprocessor output CPATH=subdir2 $CCACHE $COMPILER -c foo.c checkstat 'cache hit (direct)' 2 - checkstat 'cache hit (preprocessed)' 0 - checkstat 'cache miss' 2 + checkstat 'cache hit (preprocessed)' 1 + checkstat 'cache miss' 1 testname="comment in strings" $CCACHE -Cz >/dev/null @@ -1615,8 +1615,8 @@ EOF cd dir2 CCACHE_BASEDIR="" $CCACHE $COMPILER -I`pwd`/include -c src/test.c checkstat 'cache hit (direct)' 0 - checkstat 'cache hit (preprocessed)' 0 - checkstat 'cache miss' 2 + checkstat 'cache hit (preprocessed)' 1 + checkstat 'cache miss' 1 cd .. ################################################################## @@ -1671,8 +1671,8 @@ EOF $CCACHE -z >/dev/null $CCACHE $COMPILER -I`pwd`/include -c src/test.c checkstat 'cache hit (direct)' 0 - checkstat 'cache hit (preprocessed)' 0 - checkstat 'cache miss' 1 + checkstat 'cache hit (preprocessed)' 1 + checkstat 'cache miss' 0 cd .. ##################################################################