]> git.ipfire.org Git - thirdparty/ccache.git/commit
Remove the unify mode
authorJoel Rosdahl <joel@rosdahl.net>
Sun, 29 Dec 2019 18:21:39 +0000 (19:21 +0100)
committerJoel Rosdahl <joel@rosdahl.net>
Sun, 5 Jan 2020 19:14:28 +0000 (20:14 +0100)
commit0774bfe4c71b342822170057df0aef15d371d892
tree3bff54950cba44098c616455c7021aedcf91318e
parentb26039a1350e8adcc793cbee2a02ecb1f3bdfe71
Remove the unify mode

The unify mode has not received enough attention and has at least these
bugs:

1. The direct mode doesn’t work if the unify mode is enabled. This is
   because the unify mode doesn’t call into process_preprocessed_file
   which stores the paths and hashes of included files needed by the
   direct mode.
2. The .incbin directive detection has no effect when using the unify
   mode. This is again because the unify mode doesn’t use
   process_preprocessed_file which is where the .incbin detection takes
   place.
3. The unifier’s tokenizer doesn’t understand C++11 raw string literals.
4. The unifier ignores comments, but comments may have semantic meaning
   to modern compilers, e.g. “fall through” comments.

Bugs 3 and 4 are fixable by improving the unifier’s tokenization
algorithm, but since it’s a bit tricky it likely won’t be worth the
effort, especially not as a bug fix.

Bugs 1 and 2 are also fixable by unifying the two code paths, but that’s
a non-trivial effort.

In addition to the bugs, I believe that the usefullness of the unify
mode is low:

* It’s only applicable when not using -g.
* It won't be enabled for C++ unless somebody fixes bug 3.
* It can make line numbers in warning messages and __LINE__ expansions
  incorrect.
* Since comments should not be ignored, the unify mode can only make a
  difference for some types of whitespace changes, like adding or
  removing blank lines or changing a+b to a + b. (a + b is already
  normalized to a + b by the preprocessor.)

Therefore I’ll just remove the unify mode to fix the bugs.

Fixes #497.

(cherry picked from commit 947a72ce3712a6901e7ddc43a50c5df40739113e)
Makefile.in
dev.mk.in
doc/MANUAL.adoc
src/Config.cpp
src/Config.hpp
src/ccache.cpp
src/unify.cpp [deleted file]
src/unify.hpp [deleted file]
test/suites/base.bash
unittest/test_Config.cpp