gcc/libcpp
David Malcolm 2aa514130a Allow the use of ad-hoc locations for fix-it hints
Currently the fix-it validator rejects ad-hoc locations.
Fix this by calling get_pure_location on the input locations to
add_fixit_insert/replace.  Doing so requires moving get_pure_location
from gcc to libcpp.

gcc/ChangeLog:
	* diagnostic-show-locus.c
	(selftest::test_one_liner_fixit_validation_adhoc_locations): New
	function.
	(selftest::test_diagnostic_show_locus_one_liner): Call it.
	* input.c (get_pure_location): Move to libcpp/line-map.c.
	* input.h (get_pure_location): Convert decl to an inline function
	calling implementation in libcpp.

libcpp/ChangeLog:
	* include/line-map.h (get_pure_location): New decl.
	* line-map.c (get_pure_location): Move here, from gcc/input.c, adding
	a line_maps * param.
	(rich_location::add_fixit_insert): Call get_pure_location on "where".
	(rich_location::add_fixit_replace): Call get_pure_location on the
	end-points.

From-SVN: r239843
2016-08-29 20:42:57 +00:00
..
include Allow the use of ad-hoc locations for fix-it hints 2016-08-29 20:42:57 +00:00
po Regenerate .pot files. 2016-08-19 22:06:53 +01:00
ChangeLog Allow the use of ad-hoc locations for fix-it hints 2016-08-29 20:42:57 +00:00
ChangeLog.jit
Makefile.in
aclocal.m4
charset.c Fix crash in selftest::test_lexer_string_locations_ucn4 (PR bootstrap/72823) 2016-08-06 18:06:30 +00:00
config.in Change ENABLE_VALGRIND_CHECKING to 2016-05-20 08:03:25 +00:00
configure Change ENABLE_VALGRIND_CHECKING to 2016-05-20 08:03:25 +00:00
configure.ac Change ENABLE_VALGRIND_CHECKING to 2016-05-20 08:03:25 +00:00
directives-only.c
directives.c Spelling suggestions for misspelled preprocessor directives 2016-08-18 18:52:43 +00:00
errors.c Spelling suggestions for misspelled preprocessor directives 2016-08-18 18:52:43 +00:00
expr.c Implement C _FloatN, _FloatNx types. 2016-08-19 18:43:26 +01:00
files.c libcpp: Tweak to missing #include source location 2016-06-22 15:29:21 +00:00
identifiers.c
init.c libcpp: Tweak to missing #include source location 2016-06-22 15:29:21 +00:00
internal.h On-demand locations within string-literals 2016-08-05 18:08:33 +00:00
lex.c re PR c/7652 (-Wswitch-break : Warn if a switch case falls through) 2016-08-12 10:30:47 +00:00
line-map.c Allow the use of ad-hoc locations for fix-it hints 2016-08-29 20:42:57 +00:00
location-example.txt
macro.c re PR c/7652 (-Wswitch-break : Warn if a switch case falls through) 2016-08-12 10:30:47 +00:00
makeucnid.c
mkdeps.c
pch.c re PR c/7652 (-Wswitch-break : Warn if a switch case falls through) 2016-08-18 10:28:03 +00:00
symtab.c
system.h
traditional.c
ucnid.h
ucnid.tab