]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Tweak formatting of manual text and code comments
authorJoel Rosdahl <joel@rosdahl.net>
Mon, 20 May 2019 19:25:27 +0000 (21:25 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Thu, 18 Jul 2019 20:05:49 +0000 (22:05 +0200)
doc/MANUAL.adoc
src/ccache.c
test/suites/pch.bash

index d81200e869a4c308924c4a617c82d9499d8739c3..2ca82c0c4ae241f358e13d84ffbf679b76ece7cf 100644 (file)
@@ -932,9 +932,10 @@ Disadvantages:
   or source code will make the hash different. Compare this with the default
   setup where ccache will fall back to the preprocessor mode, which is tolerant
   to some types of changes of compiler options and source code changes.
-* (If -MD is used) The manifest entries will include system header files as well,
-  thus slowing down cache hits slightly, just as using -MD slows down make.
-* (If -MMD is used) The manifest entries will not include system header files,
+* If -MD is used, the manifest entries will include system header files as
+  well, thus slowing down cache hits slightly, just as using -MD slows down
+  make.
+* If -MMD is used, the manifest entries will not include system header files,
   which means ccache will ignore changes in them.
 
 The depend mode will be disabled if any of the following holds:
@@ -1048,13 +1049,14 @@ things to make it work properly:
 * You must either:
 +
 --
-** use the *-include* compiler option to include the precompiled header
-   (i.e., don't use *#include* in the source code to include the header),
-   the filename itself must be sufficient to find the header (i.e. -I paths
-   are not searched); or
+** use the *-include* compiler option to include the precompiled header (i.e.,
+   don't use *#include* in the source code to include the header; the filename
+   itself must be sufficient to find the header, i.e. *-I* paths are not
+   searched); or
 ** (for the Clang compiler) use the *-include-pch* compiler option to include
    the PCH file generated from the precompiled header; or
-** (for the GCC compiler) add the *-fpch-preprocess* compiler option when compiling.
+** (for the GCC compiler) add the *-fpch-preprocess* compiler option when
+   compiling.
 
 If you don't do this, either the non-precompiled version of the header file
 will be used (if available) or ccache will fall back to running the real
index d8df7adf6b6458ce78b21029f973be27bd14e2c0..19ae1eabf5eec4f40bb9eaa7caa79b2a067d1a35 100644 (file)
@@ -1035,7 +1035,7 @@ process_preprocessed_file(struct hash *hash, const char *path, bool pump)
        free(data);
        free(cwd);
 
-       // Explicitly check the .gch/.pch/.pth file, Clang does not include any
+       // Explicitly check the .gch/.pch/.pth file as Clang does not include any
        // mention of it in the preprocessed output.
        if (included_pch_file) {
                char *pch_path = x_strdup(included_pch_file);
@@ -1165,8 +1165,8 @@ object_hash_from_depfile(const char *depfile, struct hash *hash)
 
        fclose(f);
 
-       // Explicitly check the .gch/.pch/.pth file, it may not be mentioned
-       // in the dependencies output.
+       // Explicitly check the .gch/.pch/.pth file as it may not be mentioned in the
+       // dependencies output.
        if (included_pch_file) {
                char *pch_path = x_strdup(included_pch_file);
                pch_path = make_relative_path(pch_path);
index 0f3656231c83d54f19a34a2728edf54a267b148b..caf82c4598f4bf1ad4ca8a62c9c5711e85285520 100644 (file)
@@ -33,16 +33,18 @@ EOF
 SUITE_pch() {
     # Clang should generally be compatible with GCC and so most of the tests
     # can be shared. There are some differences though:
-    # - Both GCC and Clang keep an absolute path reference to the original
-    # file except that Clang uses that reference to validate the pch and GCC
-    # ignores the reference (i.e. the original file can be removed).
-    # - Clang can only use pch headers on the command line and not as an #include
-    # statement inside a source file, because it silently ignores -fpch-preprocess
-    # and does not output pragma GCC pch_preprocess.
+    #
+    # - Both GCC and Clang keep an absolute path reference to the original file
+    #   except that Clang uses that reference to validate the pch and GCC
+    #   ignores the reference (i.e. the original file can be removed).
+    # - Clang can only use pch headers on the command line and not as an
+    #   #include statement inside a source file, because it silently ignores
+    #   -fpch-preprocess and does not output pragma GCC pch_preprocess.
     # - Clang has -include-pch to directly include a PCH file without any magic
-    # of searching for a .gch file.
+    #   of searching for a .gch file.
     #
-    # Therefore have common tests and do dedicated tests only for differences.
+    # Put tests that work with both compilers in pch_suite_common and put
+    # compiler-specific tests in pch_suite_clang/pch_suite_gcc.
 
     pch_suite_common
     if $COMPILER_TYPE_CLANG; then
@@ -254,9 +256,10 @@ pch_suite_common() {
     expect_stat 'cache hit (preprocessed)' 0
     expect_stat 'cache miss' 2
 
-    # With GCC, a newly generated PCH is always different, even if the contents should be exactly the same.
-    # And Clang stores file timestamps, so in this case the PCH is different too.
-    # So without .sum a "changed" PCH would mean a miss, but if the .sum doesn't change, it should be a hit.
+    # With GCC, a newly generated PCH is always different, even if the contents
+    # should be exactly the same. And Clang stores file timestamps, so in this
+    # case the PCH is different too. So without .sum a "changed" PCH would mean
+    # a miss, but if the .sum doesn't change, it should be a hit.
 
     sleep 1
     touch pch.h
@@ -560,9 +563,10 @@ pch_suite_gcc() {
     expect_stat 'cache hit (preprocessed)' 0
     expect_stat 'cache miss' 2
 
-    # With GCC, a newly generated PCH is always different, even if the contents should be exactly the same.
-    # And Clang stores file timestamps, so in this case the PCH is different too.
-    # So without .sum a "changed" PCH would mean a miss, but if the .sum doesn't change, it should be a hit.
+    # With GCC, a newly generated PCH is always different, even if the contents
+    # should be exactly the same. And Clang stores file timestamps, so in this
+    # case the PCH is different too. So without .sum a "changed" PCH would mean
+    # a miss, but if the .sum doesn't change, it should be a hit.
 
     sleep 1
     touch pch.h