Go to file
David Malcolm 2ffe0809cb Reimplement removal fix-it hints in terms of replace
This patch eliminates class fixit_remove, reimplementing
rich_location::add_fixit_remove in terms of replacement with the
empty string.  Deleting the removal subclass simplifies
fixit-handling code, as we only have two concrete fixit_hint
subclasses to deal with, rather than three.

The patch also fixes some problems in diagnostic-show-locus.c for
situations where a replacement fix-it has a different range to the
range of the diagnostic, by unifying the drawing of the two kinds of
fixits.  For example, this:

  foo = bar.field;
      ^
            m_field

becomes:

  foo = bar.field;
      ^
            -----
            m_field

showing the range to be replaced.

gcc/ChangeLog:
	* diagnostic-show-locus.c
	(layout::annotation_line_showed_range_p): New method.
	(layout::print_any_fixits): Remove case fixit_hint::REMOVE.
	Reimplement case fixit_hint::REPLACE to cover removals, and
	replacements where the range of the replacement isn't one
	of the ranges in the rich_location.
	(test_one_liner_fixit_replace): Likewise.
	(selftest::test_one_liner_fixit_replace_non_equal_range): New
	function.
	(selftest::test_one_liner_fixit_replace_equal_secondary_range):
	New function.
	(selftest::test_diagnostic_show_locus_one_liner): Call the new
	functions.
	* diagnostic.c (print_parseable_fixits): Remove case
	fixit_hint::REMOVE.

libcpp/ChangeLog:
	* include/line-map.h (fixit_hint::kind): Delete REPLACE.
	(class fixit_remove): Delete.
	* line-map.c (rich_location::add_fixit_remove): Reimplement
	by calling add_fixit_replace with an empty string.
	(fixit_remove::fixit_remove): Delete.
	(fixit_remove::affects_line_p): Delete.

From-SVN: r239632
2016-08-19 21:18:05 +00:00
boehm-gc
config
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 Reimplement removal fix-it hints in terms of replace 2016-08-19 21:18:05 +00:00
gnattools
gotools
include dwarf2.def (DW_AT_string_length_bit_size, [...]): New attributes. 2016-08-15 11:51:44 +02:00
INSTALL
intl
libada
libatomic
libbacktrace
libcc1
libcilkrts
libcpp Reimplement removal fix-it hints in terms of replace 2016-08-19 21:18:05 +00:00
libdecnumber
libffi
libgcc Update soft-fp from glibc (PR libgcc/77265). 2016-08-16 22:30:56 +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
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 Simplify dg-options for tests using pthreads 2016-08-19 17:36:07 +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
ChangeLog configure.ac (nds32*-*-*): Remove entry to enable gdb. 2016-07-20 08:09:25 +00:00
ChangeLog.jit
ChangeLog.tree-ssa
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
COPYING
COPYING3
COPYING3.LIB
COPYING.LIB
COPYING.RUNTIME
depcomp
install-sh
libtool-ldflags
libtool.m4
lt~obsolete.m4
ltgcc.m4
ltmain.sh
ltoptions.m4
ltsugar.m4
ltversion.m4
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
missing
mkdep
mkinstalldirs
move-if-change
README
symlink-tree
ylwrap

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.