]> git.ipfire.org Git - thirdparty/ccache.git/log
thirdparty/ccache.git
5 years agoContext: move orig_args 542/head
Thomas Otto [Sat, 25 Jan 2020 09:38:06 +0000 (10:38 +0100)] 
Context: move orig_args

5 years agoContext: convert stats_file to an std::string
Thomas Otto [Sat, 25 Jan 2020 09:24:35 +0000 (10:24 +0100)] 
Context: convert stats_file to an std::string

Also adapted downstream stats functions.

5 years agoContext: move stats_file
Thomas Otto [Sat, 25 Jan 2020 09:24:35 +0000 (10:24 +0100)] 
Context: move stats_file

5 years agoContext: move g_config
Thomas Otto [Sun, 26 Jan 2020 20:34:40 +0000 (21:34 +0100)] 
Context: move g_config

5 years agoImplement Util::read_link, replacing legacy x_readlink
Joel Rosdahl [Tue, 11 Feb 2020 20:56:02 +0000 (21:56 +0100)] 
Implement Util::read_link, replacing legacy x_readlink

5 years agoImplement Util::real_path, replacing legacy x_realpath
Joel Rosdahl [Tue, 11 Feb 2020 20:34:43 +0000 (21:34 +0100)] 
Implement Util::real_path, replacing legacy x_realpath

5 years agoMerge pull request #541 from totph/ctx3
Joel Rosdahl [Sat, 15 Feb 2020 15:14:35 +0000 (16:14 +0100)] 
Merge pull request #541 from totph/ctx3

Context: move 9 more globals

5 years agoContext: move using_precompiled_header 541/head
Thomas Otto [Fri, 24 Jan 2020 19:23:14 +0000 (20:23 +0100)] 
Context: move using_precompiled_header

5 years agoContext: move profile_use/profile_generate
Thomas Otto [Fri, 24 Jan 2020 19:20:45 +0000 (20:20 +0100)] 
Context: move profile_use/profile_generate

5 years agoContext: move direct_i_file
Thomas Otto [Fri, 24 Jan 2020 19:13:41 +0000 (20:13 +0100)] 
Context: move direct_i_file

5 years agoContext: move profile_dir
Thomas Otto [Fri, 24 Jan 2020 19:11:24 +0000 (20:11 +0100)] 
Context: move profile_dir

5 years agoContext: move profile_arcs
Thomas Otto [Fri, 24 Jan 2020 19:01:03 +0000 (20:01 +0100)] 
Context: move profile_arcs

5 years agoContext: move seen_split_dwarf
Thomas Otto [Fri, 24 Jan 2020 18:59:21 +0000 (19:59 +0100)] 
Context: move seen_split_dwarf

5 years agoContext: move generating_diagnostics
Thomas Otto [Fri, 24 Jan 2020 18:54:21 +0000 (19:54 +0100)] 
Context: move generating_diagnostics

5 years agoContext: move generating_stackusage
Thomas Otto [Fri, 24 Jan 2020 18:49:32 +0000 (19:49 +0100)] 
Context: move generating_stackusage

5 years agoContext: move generating_coverage
Thomas Otto [Fri, 24 Jan 2020 18:45:36 +0000 (19:45 +0100)] 
Context: move generating_coverage

5 years agoRename clang-format.sh to run-clang-format
Joel Rosdahl [Thu, 13 Feb 2020 20:56:54 +0000 (21:56 +0100)] 
Rename clang-format.sh to run-clang-format

This avoids exposing implementation details.

5 years agoBuild static Windows executables
Joel Rosdahl [Thu, 13 Feb 2020 20:45:33 +0000 (21:45 +0100)] 
Build static Windows executables

This makes it possible to run e.g. the unittest binary in Wine.

5 years agoSimplify result_name_from_depfile signature
Joel Rosdahl [Thu, 13 Feb 2020 20:32:07 +0000 (21:32 +0100)] 
Simplify result_name_from_depfile signature

5 years agoSimplify Util::{base,dir}_name
Joel Rosdahl [Wed, 12 Feb 2020 21:06:08 +0000 (22:06 +0100)] 
Simplify Util::{base,dir}_name

This also fixes a bug in the Windows versions.

5 years agoAdded 'make check_format' to makefile rules (#525)
Thomas Otto [Thu, 13 Feb 2020 20:54:19 +0000 (21:54 +0100)] 
Added 'make check_format' to makefile rules (#525)

'make format' formats all source files with clang-format, and
'make check_format' only checks and on failure prints a diff,
then exits with the appropriate status.

Because quick interactive formatting is one use case, xargs is
used for parallelism. Proper make-parallelism would require
-k and -j arguments to work.

5 years agoMerge pull request #538 from totph/ctx2
Joel Rosdahl [Thu, 13 Feb 2020 20:26:14 +0000 (21:26 +0100)] 
Merge pull request #538 from totph/ctx2

Context: move 7 more globals

5 years agoContext: move generating_dependencies 538/head
Thomas Otto [Fri, 24 Jan 2020 18:40:14 +0000 (19:40 +0100)] 
Context: move generating_dependencies

5 years agoContext: move actual_language
Thomas Otto [Fri, 24 Jan 2020 18:33:43 +0000 (19:33 +0100)] 
Context: move actual_language

5 years agoContext: move output_dwo
Thomas Otto [Fri, 24 Jan 2020 18:26:32 +0000 (19:26 +0100)] 
Context: move output_dwo

5 years agoContext: move output_dia
Thomas Otto [Fri, 24 Jan 2020 18:23:17 +0000 (19:23 +0100)] 
Context: move output_dia

5 years agoContext: move output_cu
Thomas Otto [Fri, 24 Jan 2020 18:19:25 +0000 (19:19 +0100)] 
Context: move output_cu

5 years agoContext: move output_cov
Thomas Otto [Fri, 24 Jan 2020 18:17:54 +0000 (19:17 +0100)] 
Context: move output_cov

5 years agoContext: move output_dep
Thomas Otto [Fri, 24 Jan 2020 18:14:00 +0000 (19:14 +0100)] 
Context: move output_dep

5 years agoTest out-of-tree build in Travis-CI
Joel Rosdahl [Thu, 13 Feb 2020 17:58:18 +0000 (18:58 +0100)] 
Test out-of-tree build in Travis-CI

5 years agoFix out of tree build (#540)
Loïc Yhuel [Thu, 13 Feb 2020 17:53:32 +0000 (18:53 +0100)] 
Fix out of tree build (#540)

The CPPFLAGS contain "-I.", but not "-I$(srcdir)", which means "src/ScopeGuard.hpp" was only
found when building from the source root.

5 years agoSimplify code
Joel Rosdahl [Mon, 10 Feb 2020 20:25:38 +0000 (21:25 +0100)] 
Simplify code

5 years agoMake clang-format comments stable across clang-format versions
Joel Rosdahl [Mon, 10 Feb 2020 20:16:31 +0000 (21:16 +0100)] 
Make clang-format comments stable across clang-format versions

Now at least clang-format 6, 7, 8 and 9 format all code the same.

5 years agoFix formatting
Joel Rosdahl [Mon, 10 Feb 2020 20:14:53 +0000 (21:14 +0100)] 
Fix formatting

5 years agoContext: move output_obj, adapt dump_debug_log_buffer_exitfn
Thomas Otto [Fri, 24 Jan 2020 17:54:04 +0000 (18:54 +0100)] 
Context: move output_obj, adapt dump_debug_log_buffer_exitfn

5 years agoContext: add ArgsInfo and move input_file
Thomas Otto [Fri, 24 Jan 2020 17:40:21 +0000 (18:40 +0100)] 
Context: add ArgsInfo and move input_file

5 years agoContext struct added, returned by initialize()
Thomas Otto [Sun, 19 Jan 2020 17:53:41 +0000 (18:53 +0100)] 
Context struct added, returned by initialize()

The goal is to eventually move almost all global state into Context.

5 years agoUse Config for init_log()
Thomas Otto [Wed, 5 Feb 2020 21:03:24 +0000 (22:03 +0100)] 
Use Config for init_log()

5 years agoRemove superfluous “>” in README
Joel Rosdahl [Sun, 9 Feb 2020 20:48:06 +0000 (21:48 +0100)] 
Remove superfluous “>” in README

5 years agoMention “Supported platforms, compilers and languages” page in README
Joel Rosdahl [Sun, 9 Feb 2020 20:47:07 +0000 (21:47 +0100)] 
Mention “Supported platforms, compilers and languages” page in README

5 years agoImprove the failed() and fatal() mechanisms
Joel Rosdahl [Sat, 8 Feb 2020 22:19:18 +0000 (23:19 +0100)] 
Improve the failed() and fatal() mechanisms

The failure() and fatal() functions now exit by throwing exceptions that
are caught by the top level functions. This makes it possible to “throw
Failure” in functions that don’t have access to orig_args (or the future
context object).

While at it, renamed top-level functions to better reflect their
purpose.

5 years agoRemove declaration of unimplemented warn function
Joel Rosdahl [Sat, 8 Feb 2020 18:51:47 +0000 (19:51 +0100)] 
Remove declaration of unimplemented warn function

5 years agoRestore sortedness of Util functions
Joel Rosdahl [Sat, 8 Feb 2020 17:35:37 +0000 (18:35 +0100)] 
Restore sortedness of Util functions

5 years agoUse correct spelling of the verb “set up”
Joel Rosdahl [Sat, 8 Feb 2020 16:14:55 +0000 (17:14 +0100)] 
Use correct spelling of the verb “set up”

5 years agoExtract setup_config() from initialize() (#534)
Thomas Otto [Sat, 8 Feb 2020 16:12:51 +0000 (17:12 +0100)] 
Extract setup_config() from initialize() (#534)

Repeated initialize-calls in ccache_main_options() added duplicate exit
functions. These calls had the side effect of passing a config relevant
changes from one command line switch to the next. Instead setup_config()
is now called afterwards.

5 years agoMove logging into separate file (#532)
Thomas Otto [Sat, 8 Feb 2020 16:04:28 +0000 (17:04 +0100)] 
Move logging into separate file (#532)

5 years agoUse apparent CWD when checking for CWD in preprocessed output
Joel Rosdahl [Fri, 7 Feb 2020 22:15:42 +0000 (23:15 +0100)] 
Use apparent CWD when checking for CWD in preprocessed output

Also when checking debug prefix maps.

This fixes a problem when $PWD includes a symlink part and the user has
set “hash_dir = false”.

Closes #531.

(cherry picked from commit 92145eb0762109b5f0114a6f4de2fea7d4ac016f)

5 years agoRemove “Description” header from PR and feature issue templates
Joel Rosdahl [Fri, 7 Feb 2020 20:58:48 +0000 (21:58 +0100)] 
Remove “Description” header from PR and feature issue templates

The header seems to be more in the way than being helpful.

5 years agoWin32: Close reading file for recompression (#535)
Cristian Adam [Fri, 7 Feb 2020 20:38:24 +0000 (21:38 +0100)] 
Win32: Close reading file for recompression (#535)

Fixes: https://github.com/ccache/ccache/issues/530
5 years agoRemove one more “=” from the help text
Joel Rosdahl [Wed, 5 Feb 2020 20:57:57 +0000 (21:57 +0100)] 
Remove one more “=” from the help text

Missed in a44ef1844b59bf902ad6015645fb0028a54f67cb.

5 years agoImprove help text and documentation of command line options
Joel Rosdahl [Wed, 5 Feb 2020 20:46:29 +0000 (21:46 +0100)] 
Improve help text and documentation of command line options

Removed the “=” in “-a, --a-long-option=VALUE” to make it easier to
understand that “-a=VALUE” isn’t supported. Also improved some of the
placeholder names.

Closes #529.

5 years agoImprove error message for “ccache -o=K=V”
Joel Rosdahl [Wed, 5 Feb 2020 20:31:55 +0000 (21:31 +0100)] 
Improve error message for “ccache -o=K=V”

Previously:

    ccache: error: unknown configuration option ""

Now:

    ccache: error: unknown configuration option "=K"

Related to #529.

5 years agoLog when starting/stopping recompression
Joel Rosdahl [Wed, 5 Feb 2020 20:17:50 +0000 (21:17 +0100)] 
Log when starting/stopping recompression

5 years agodoc: Remove information that is better to have on the web site
Joel Rosdahl [Wed, 5 Feb 2020 19:22:25 +0000 (20:22 +0100)] 
doc: Remove information that is better to have on the web site

5 years agodoc: Move description of preprocessor mode before direct mode
Joel Rosdahl [Wed, 5 Feb 2020 19:01:22 +0000 (20:01 +0100)] 
doc: Move description of preprocessor mode before direct mode

This way the depend mode is documented directly after the direct mode
which makes more sense since they are related.

5 years agoAdd improvement issue template
Joel Rosdahl [Tue, 4 Feb 2020 19:26:29 +0000 (20:26 +0100)] 
Add improvement issue template

5 years agoImprove issue templates
Joel Rosdahl [Tue, 4 Feb 2020 19:26:25 +0000 (20:26 +0100)] 
Improve issue templates

5 years agoCompensate for bug in clang-format version 8 and 9
Joel Rosdahl [Tue, 28 Jan 2020 21:07:54 +0000 (22:07 +0100)] 
Compensate for bug in clang-format version 8 and 9

5 years agoAdd short description of ArgsInfo
Joel Rosdahl [Tue, 28 Jan 2020 19:35:33 +0000 (20:35 +0100)] 
Add short description of ArgsInfo

As suggested by Alexander Lanin.

5 years agoSimplify code a bit
Joel Rosdahl [Tue, 28 Jan 2020 18:47:36 +0000 (19:47 +0100)] 
Simplify code a bit

5 years agoFix memory leak
Joel Rosdahl [Mon, 27 Jan 2020 21:05:48 +0000 (22:05 +0100)] 
Fix memory leak

5 years agoRefactor away the last instance of from_owned_cstr
Joel Rosdahl [Mon, 27 Jan 2020 20:57:17 +0000 (21:57 +0100)] 
Refactor away the last instance of from_owned_cstr

5 years agoMerge pull request #515 from totph/cc_proc
Joel Rosdahl [Tue, 28 Jan 2020 19:47:19 +0000 (20:47 +0100)] 
Merge pull request #515 from totph/cc_proc

Make cc_process_args() only use local variables

5 years agoSimplify make_relative_path() argument and result ownership 515/head
Thomas Otto [Sun, 19 Jan 2020 17:21:54 +0000 (18:21 +0100)] 
Simplify make_relative_path() argument and result ownership

5 years agoMake cc_process_args() only use local variables
Thomas Otto [Sun, 19 Jan 2020 16:49:19 +0000 (17:49 +0100)] 
Make cc_process_args() only use local variables

cc_process_args writes into a new ArgsInfo struct and only accesses
local variables (minus guessed_compiler). For now these are mostly
copied into the global variables again after the function call.

Most ccache.cpp global variables moved to legacy_globals.cpp.

5 years agoAdd a ScopeGuard struct
Thomas Otto [Wed, 22 Jan 2020 18:02:04 +0000 (19:02 +0100)] 
Add a ScopeGuard struct

Enables automatic cleanup of raw pointers and other resources.
For now used simplify resource management in cc_process_args.

5 years agoAdd from_owned_cstr/from_cstr functions
Thomas Otto [Sun, 19 Jan 2020 16:49:19 +0000 (17:49 +0100)] 
Add from_owned_cstr/from_cstr functions

5 years agoFormat code with clang-format
Joel Rosdahl [Sat, 25 Jan 2020 12:52:29 +0000 (13:52 +0100)] 
Format code with clang-format

5 years agoMake Config noncopyable and add clear_and_reset() method (#522)
Thomas Otto [Sat, 25 Jan 2020 12:45:42 +0000 (13:45 +0100)] 
Make Config noncopyable and add clear_and_reset() method (#522)

Prevents changes from getting lost by writing them to a
temporary copy of the main Config object.

Also restore deleted comments from the move of
primary/secondary_config_path.

5 years agoDerive header list from source list if possible (#521)
Thomas Otto [Sat, 25 Jan 2020 12:40:46 +0000 (13:40 +0100)] 
Derive header list from source list if possible (#521)

5 years agoSkip read-only tests on file systems that lack such support
Joel Rosdahl [Sat, 25 Jan 2020 10:25:52 +0000 (11:25 +0100)] 
Skip read-only tests on file systems that lack such support

Fixes #510.

5 years agoMake failure to write a stats file a soft error (#516)
Joel Rosdahl [Sat, 25 Jan 2020 10:19:52 +0000 (11:19 +0100)] 
Make failure to write a stats file a soft error (#516)

If a stats file update for some reason fails, the exception will bubble
up to ccache_main which just prints the error and exits with an error.
Let’s consider such failures non-fatal and just log them.

5 years agoSplit ccache.hpp into per-.cpp file headers
Joel Rosdahl [Wed, 22 Jan 2020 21:03:09 +0000 (22:03 +0100)] 
Split ccache.hpp into per-.cpp file headers

This reduces code dependencies that hamper refactoring.

5 years agoRemove obsolete COMPAR_FN_T check and typedef
Joel Rosdahl [Wed, 22 Jan 2020 20:16:39 +0000 (21:16 +0100)] 
Remove obsolete COMPAR_FN_T check and typedef

5 years agoMove global primary/secondary_config_path into Config (#514)
Thomas Otto [Tue, 21 Jan 2020 18:31:18 +0000 (19:31 +0100)] 
Move global primary/secondary_config_path into Config (#514)

5 years agoIgnore files from VS (Code) (#508)
Alexander Lanin [Mon, 20 Jan 2020 21:54:48 +0000 (22:54 +0100)] 
Ignore files from VS (Code) (#508)

5 years agoMake failed tests create a testdir.failed symlink (#511)
Thomas Otto [Sun, 19 Jan 2020 19:47:27 +0000 (20:47 +0100)] 
Make failed tests create a testdir.failed symlink (#511)

When the test suite fails 'testdir.failed' now points to the random
'testdir.9876/' directory. This make iterative debugging of failing
tests easier by always using the symlink name or re-issuing 'cd $PWD'
when 'cd'-ed into the 'testdir.failed' directory.

All artifacts can still be removed via 'rm -r testdir.*'.

5 years agoSimplify parse_int slightly (#509)
Alexander Lanin [Sun, 19 Jan 2020 16:34:43 +0000 (17:34 +0100)] 
Simplify parse_int slightly (#509)

5 years agoAdd configuration for the No Response Probot
Joel Rosdahl [Sun, 19 Jan 2020 15:08:31 +0000 (16:08 +0100)] 
Add configuration for the No Response Probot

5 years agoUpgrade to fmt 6.1.2
Joel Rosdahl [Thu, 16 Jan 2020 20:19:38 +0000 (21:19 +0100)] 
Upgrade to fmt 6.1.2

5 years agoSend dependency arguments to compiler if run_second_cpp is true
Joel Rosdahl [Thu, 16 Jan 2020 20:04:09 +0000 (21:04 +0100)] 
Send dependency arguments to compiler if run_second_cpp is true

If we run the compiler on the real source code on a cache miss (i.e.,
run_second_cpp is true) we can send the dependency arguments (-MD, etc.)
to the compiler instead of the preprocessor. When doing this there is no
need to add an implicit -MQ option to get the correct object file
location in the dependency file. Do so and also avoid adding an implicit
-MF option since that isn’t needed either. This should re-add support
for EDG-based compilers (see 6d453769 and #460).

If we run the compiler on the preprocessed source code on a cache miss
(i.e., run_second_cpp is false) we still need to let the preprocessor
generate the dependency file (the compiler doesn’t generate a dependency
file when compiling preprocessed source code) and thus we need to add
implicit -MQ and -MF.

This change reverts a fix (97b27781) for the Intel C++ compiler, but if
the Intel compiler still has problems the user can simply avoid setting
run_second_cpp to false.

5 years agoTest extra_args_to_hash output of cc_process_args
Joel Rosdahl [Thu, 16 Jan 2020 20:03:08 +0000 (21:03 +0100)] 
Test extra_args_to_hash output of cc_process_args

5 years agoInclude “Co-authored-by” attributions when calculating authors
Joel Rosdahl [Wed, 15 Jan 2020 21:49:23 +0000 (22:49 +0100)] 
Include “Co-authored-by” attributions when calculating authors

(cherry picked from commit cb301769895adc941845b16d124e0bff292a74c3)

5 years agoImprove error message for bad boolean environment variable value
Joel Rosdahl [Wed, 15 Jan 2020 20:53:58 +0000 (21:53 +0100)] 
Improve error message for bad boolean environment variable value

Before:

    ccache: error: CCACHE_DIRECT: invalid boolean environment variable
    value "0" for CCACHE_NODIRECT (did you mean to set
    "CCACHE_DIRECT=true"?)

After:

    ccache: error: CCACHE_NODIRECT: invalid boolean environment variable
    value "0" (did you mean to set "CCACHE_DIRECT=true"?)

5 years agoMake it harder to misinterpret semantics of boolean environment settings
Joel Rosdahl [Tue, 14 Jan 2020 21:10:17 +0000 (22:10 +0100)] 
Make it harder to misinterpret semantics of boolean environment settings

Closes #502.

Co-authored-by: Steffen Dettmer <steffen.dettmer@rail.bombardier.com>
(cherry picked from commit f2481b1d5988cb4ccc3010c4ad6933e9c93e6d02)

5 years agoAvoid passing compilation-only options to the preprocessor redux
Joel Rosdahl [Tue, 14 Jan 2020 20:30:29 +0000 (21:30 +0100)] 
Avoid passing compilation-only options to the preprocessor redux

25e73c1f (“Include compiler-only arguments in the hash”) attempted to
fix a regression in 5d8585b5 (“Don’t pass -Werror and compilation-only
options to the preprocessor”). It succeeded fixing the regression all
right, but it also essentially reverted the essence of 5d8585b5 (#312)
since compiler-only arguments once again are passed to the preprocessor.
Sigh.

Fix this for real and also write a test that proves it.

(cherry picked from commit bc2005e994030f787c014ce2491cfc4c7057eac6)

5 years agomisc/performance: Fix --no-cpp2 and --no-stats options
Joel Rosdahl [Mon, 13 Jan 2020 20:35:11 +0000 (21:35 +0100)] 
misc/performance: Fix --no-cpp2 and --no-stats options

They broke in an unsuccessful cherry-pick (0827d070) as noted in #503.

(cherry picked from commit 0948fb13f07c756b8e056efdec46560e0faf37d1)

5 years agoPrepare for v3.7.7
Joel Rosdahl [Sun, 5 Jan 2020 20:09:28 +0000 (21:09 +0100)] 
Prepare for v3.7.7

(cherry picked from commit 26912b280b839e102482db8c9e63f00a95b58486)

5 years agoPrepare for v3.7.7
Joel Rosdahl [Sun, 5 Jan 2020 20:09:00 +0000 (21:09 +0100)] 
Prepare for v3.7.7

(cherry picked from commit 6cfc49fc46b16d0b3fe9c3cde8ddf3199a36ced6)

5 years agoUpdate NEWS
Joel Rosdahl [Sat, 4 Jan 2020 18:24:39 +0000 (19:24 +0100)] 
Update NEWS

(cherry picked from commit 5c6954378780a7d07faa33d5bc31bdda1a4b8bb1)

5 years agoMake sure to always log a “Result:” line
Joel Rosdahl [Sat, 4 Jan 2020 18:19:01 +0000 (19:19 +0100)] 
Make sure to always log a “Result:” line

Fixes #500.

A side effect of this is that read-only cache misses now will update the
“cache miss” statistics counter, which is consistent with the cache hit
cases (which already now update the counters).

(cherry picked from commit 1d2b76a71b12c2ffdd107f89a3d9caa6cd223d44)

5 years agoAdd tests for verifying dependency file content
Joel Rosdahl [Wed, 1 Jan 2020 21:17:11 +0000 (22:17 +0100)] 
Add tests for verifying dependency file content

(cherry picked from commit c972eb6e824624956444e945bdfd9768c7e74123)

5 years agoRevert "Only pass implicit -MQ to preprocessor if needed"
Joel Rosdahl [Wed, 1 Jan 2020 20:59:29 +0000 (21:59 +0100)] 
Revert "Only pass implicit -MQ to preprocessor if needed"

This reverts commit 19c3729d30640fc2c78242cb46136e619fdbd802 and also
removes the incorrect and superfluous condition that the fix fixes.

The reason for reverting is that the change introduced a nasty bug: the
dependency file will get an incorrect object file location if 1) build
directory != source directory and 2) -MF is not specified explictly by
the user.

Details: The dependency file is created by the preprocessor pass which
does not have access to the final output file name, so the preprocessor
uses the default object location derived from the source file location
instead.

Note that this partly reverts a compatibility improvement for EDG-based
compilers (see issue #460).

It should be possible to pass the dependency arguments to the compiler
instead of the preprocessor to make -MD/-MMD without -MQ work, but
that’s too risky to be done as a bug fix.

Fixes #499.

(cherry picked from commit 6d4537695f8753556362c6c5521360ca9b596ab2)

5 years agoAdd “--nocpp2” option to misc/performance
Joel Rosdahl [Wed, 1 Jan 2020 20:49:11 +0000 (21:49 +0100)] 
Add “--nocpp2” option to misc/performance

(cherry picked from commit dbf7e85f67cf785636341ce07380e7151b582ee6)

5 years agoTest .incbin detection for assembler compilation
Joel Rosdahl [Sun, 29 Dec 2019 19:06:32 +0000 (20:06 +0100)] 
Test .incbin detection for assembler compilation

(cherry picked from commit c9530b9d423b3e1b52f2fb7b3cf3376eb3044384)

5 years agoRemove the unify mode
Joel Rosdahl [Sun, 29 Dec 2019 18:21:39 +0000 (19:21 +0100)] 
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)

5 years agoRemove superfluous clang-format comments
Joel Rosdahl [Tue, 10 Dec 2019 20:38:40 +0000 (21:38 +0100)] 
Remove superfluous clang-format comments

5 years agoUnittest fixes on Windows (#496)
Cristian Adam [Sun, 15 Dec 2019 19:48:19 +0000 (20:48 +0100)] 
Unittest fixes on Windows (#496)

5 years agoUpdate .mailmap
Joel Rosdahl [Mon, 2 Dec 2019 21:00:06 +0000 (22:00 +0100)] 
Update .mailmap

(cherry picked from commit 38419c8dc3712b46020fd02cef6f608bf66c13fe)

5 years agoImprove comments related to save_timestamp
Joel Rosdahl [Mon, 2 Dec 2019 20:58:56 +0000 (21:58 +0100)] 
Improve comments related to save_timestamp

(cherry picked from commit 0d0def13a52d7b68376636776e71a9af5bf01bb4)