Go to file
David Malcolm d41e76cf75 Tweak to colors of fix-it hints
Previous, fix-it hints were printed using the color of the severity
of the diagnostic (magenta for warnings, red for errors, cyan for
notes).

This patch updates fix-it hints so that replacement text is printed in
green, to better distinguish the suggested improvement from
the current code.  For example:

spellcheck-fields.cc:52:13: error: 'struct s' has no member named 'colour'; did you mean 'color'?
   return ptr->colour;  <<< RED
               ^~~~~~   <<< RED
               color    <<< GREEN

It makes sense for the underlinings that indicate deletions to
be printed in red, so the patch changes that also.  For example:

diagnostic-test-show-locus-color.c:179:9: warning: example of a removal hint
   int a;;  <<< MAGENTA
         ^  <<< MAGENTA
         -  <<< RED

gcc/ChangeLog:
	* diagnostic-color.c (color_dict): Add "fixit-insert" and
	"fixit-delete".
	(parse_gcc_colors): Update description of default GCC_COLORS.
	* diagnostic-show-locus.c (colorizer::set_fixit_hint): Delete.
	(colorizer::set_fixit_insert): New method.
	(colorizer::set_fixit_delete): New method.
	(colorizer::get_color_by_name): New method.
	(colorizer::STATE_FIXIT_INSERT): New constant.
	(colorizer::STATE_FIXIT_DELETE): New constant.
	(class colorizer): Drop "_cs" suffix from fields.  Delete "_ce"
	fields in favor of new field "m_stop_color".  Add fields
	"m_fixit_insert" and "m_fixit_delete".
	(colorizer::colorizer): Update for above changes.  Replace
	colorize_start calls with calls to get_color_by_name.
	(colorizer::begin_state): Handle STATE_FIXIT_INSERT and
	STATE_FIXIT_DELETE.  Update for field renamings.
	(colorizer::finish_state): Simplify by using m_stop_color,
	rather than multiple identical "*_ce" fields.
	(colorizer::get_color_by_name): New method.
	(layout::print_any_fixits): Print insertions and replacements
	using the "fixit-insert" color, and deletions using the
	"fixit-delete" color.
	* doc/invoke.texi (-fdiagnostics-color): Update description of
	default GCC_COLORS, and of the supported capabilities.

gcc/testsuite/ChangeLog:
	* gcc.dg/plugin/diagnostic-test-show-locus-color.c
	(test_fixit_insert): Update expected output.
	(test_fixit_remove): Likewise.
	(test_fixit_replace): Likewise.

From-SVN: r239787
2016-08-26 17:59:08 +00:00
INSTALL
boehm-gc
config remove support for the interix target 2016-06-21 21:57:20 +00:00
contrib mark_spam.py: Mark as spam all comments done by a creator 2016-08-17 10:30:54 +00:00
fixincludes inclhack.def (hpux_longjmp): New fix. 2016-08-13 18:08:15 +00:00
gcc Tweak to colors of fix-it hints 2016-08-26 17:59:08 +00:00
gnattools
gotools
include dwarf2.def (DW_AT_string_length_bit_size, [...]): New attributes. 2016-08-15 11:51:44 +02:00
intl
libada
libatomic
libbacktrace
libcc1
libcilkrts
libcpp line-map.h: add source_range::from_locations 2016-08-23 20:20:48 +00:00
libdecnumber
libffi
libgcc Always support float128 on x86. 2016-08-26 12:13:42 +01:00
libgfortran Use a XOR cipher instead of byte shuffling to protect against bad seeds. 2016-08-19 17:19:51 +03:00
libgo cmd/go: ignore errors from go/build for standard packages 2016-08-15 18:05:24 +00:00
libgomp re PR fortran/71014 (associate statement inside omp parallel do appears to disable default private attribute for inner loop indices) 2016-08-19 17:30:33 +02:00
libiberty re PR c/7652 (-Wswitch-break : Warn if a switch case falls through) 2016-08-12 10:30:47 +00:00
libitm
libjava Fix return type handling for Proxy classes 2016-07-13 21:34:52 +00:00
libmpx mpx_wrappers.c (move_bounds): Fix overflow bug. 2016-06-10 09:23:53 +00:00
libobjc
liboffloadmic backport: Makefile.am (myo_inc_dir): Remove. 2016-07-21 18:41:27 +00:00
libquadmath
libsanitizer re PR sanitizer/71042 (libtsan requires __pointer_chk_guard@GLIBC_PRIVATE (6)) 2016-08-12 10:53:07 +02:00
libssp
libstdc++-v3 libstdc++/51960 move-construction for raw_storage_iterator 2016-08-26 14:11:29 +01:00
libvtv
lto-plugin
maintainer-scripts Document branch_changer.py script 2016-08-17 10:30:37 +00:00
zlib
.dir-locals.el
.gitattributes
.gitignore
ABOUT-NLS
COPYING
COPYING.LIB
COPYING.RUNTIME
COPYING3
COPYING3.LIB
ChangeLog configure.ac (nds32*-*-*): Remove entry to enable gdb. 2016-07-20 08:09:25 +00:00
ChangeLog.jit
ChangeLog.tree-ssa
MAINTAINERS MAINTAINERS (Write After Approval): Add myself. 2016-07-19 10:39:19 +00:00
Makefile.def Add make autoprofiledbootstrap 2016-06-23 14:34:16 +00:00
Makefile.in Add make autoprofiledbootstrap 2016-06-23 14:34:16 +00:00
Makefile.tpl Add make autoprofiledbootstrap 2016-06-23 14:34:16 +00:00
README
compile
config-ml.in
config.guess
config.rpath
config.sub
configure configure.ac (nds32*-*-*): Remove entry to enable gdb. 2016-07-20 08:09:25 +00:00
configure.ac configure.ac (nds32*-*-*): Remove entry to enable gdb. 2016-07-20 08:09:25 +00:00
depcomp
install-sh
libtool-ldflags
libtool.m4
ltgcc.m4
ltmain.sh
ltoptions.m4
ltsugar.m4
ltversion.m4
lt~obsolete.m4
missing
mkdep
mkinstalldirs
move-if-change
symlink-tree
ylwrap

README

This directory contains the GNU Compiler Collection (GCC).

The GNU Compiler Collection is free software.  See the files whose
names start with COPYING for copying permission.  The manuals, and
some of the runtime libraries, are under different terms; see the
individual source files for details.

The directory INSTALL contains copies of the installation information
as HTML and plain text.  The source of this information is
gcc/doc/install.texi.  The installation information includes details
of what is included in the GCC sources and what files GCC installs.

See the file gcc/doc/gcc.texi (together with other files that it
includes) for usage and porting information.  An online readable
version of the manual is in the files gcc/doc/gcc.info*.

See http://gcc.gnu.org/bugs/ for how to report bugs usefully.

Copyright years on GCC source files may be listed using range
notation, e.g., 1987-2012, indicating that every year in the range,
inclusive, is a copyrightable year that could otherwise be listed
individually.