gcc/libcpp
David Malcolm a93eac6a84 Implement -fdiagnostics-parseable-fixits
gcc/ChangeLog:
	* common.opt (fdiagnostics-parseable-fixits): New option.
	* diagnostic.c: Include "selftest.h".
	(print_escaped_string): New function.
	(print_parseable_fixits): New function.
	(diagnostic_report_diagnostic): Call print_parseable_fixits.
	(selftest::assert_print_escaped_string): New function.
	(ASSERT_PRINT_ESCAPED_STRING_STREQ): New macro.
	(selftest::test_print_escaped_string): New function.
	(selftest::test_print_parseable_fixits_none): New function.
	(selftest::test_print_parseable_fixits_insert): New function.
	(selftest::test_print_parseable_fixits_remove): New function.
	(selftest::test_print_parseable_fixits_replace): New function.
	(selftest::diagnostic_c_tests): New function.
	* diagnostic.h (struct diagnostic_context): Add field
	"parseable_fixits_p".
	* doc/invoke.texi (Diagnostic Message Formatting Options): Add
	-fdiagnostics-parseable-fixits.
	(-fdiagnostics-parseable-fixits): New option.
	* opts.c (common_handle_option): Handle
	-fdiagnostics-parseable-fixits.
	* selftest-run-tests.c (selftest::run_tests): Call
	selftest::diagnostic_c_tests.
	* selftest.h (selftest::diagnostic_c_tests): New prototype.

gcc/testsuite/ChangeLog:
	* gcc.dg/plugin/diagnostic-test-show-locus-parseable-fixits.c: New
	file.
	* gcc.dg/plugin/plugin.exp (plugin_test_list): Add
	diagnostic-test-show-locus-parseable-fixits.c to sources for
	diagnostic_plugin_test_show_locus.c.
	* lib/gcc-defs.exp (freeform_regexps): New global.
	(dg-regexp): New function.
	(handle-dg-regexps): New function.
	* lib/gcc-dg.exp (cleanup-after-saved-dg-test): Reset
	freeform_regexps to the empty list.
	* lib/prune.exp (prune_gcc_output): Call handle-dg-regexps.

libcpp/ChangeLog:
	* include/line-map.h (fixit_hint::get_start_loc): New pure virtual
	function.
	(fixit_hint::maybe_get_end_loc): Likewise.
	(fixit_insert::get_start_loc): New function, implementing
	fixit_hint::get_start_loc.
	(fixit_insert::maybe_get_end_loc): New function, implementing
	fixit_hint::maybe_get_end_loc.
	(fixit_remove::get_start_loc): New function, implementing
	fixit_hint::get_start_loc.
	(fixit_remove::maybe_get_end_loc): New function, implementing
	fixit_hint::maybe_get_end_loc.
	(fixit_replace::get_start_loc): New function, implementing
	fixit_hint::get_start_loc.
	(fixit_replace::maybe_get_end_loc): New function, implementing
	fixit_hint::maybe_get_end_loc.

From-SVN: r237712
2016-06-22 14:42:30 +00:00
..
include Implement -fdiagnostics-parseable-fixits 2016-06-22 14:42:30 +00:00
po * sr.po: Update. 2016-06-03 22:07:36 +01:00
ChangeLog Implement -fdiagnostics-parseable-fixits 2016-06-22 14:42:30 +00:00
ChangeLog.jit Merger of dmalcolm/jit branch from git 2014-11-11 21:55:52 +00:00
Makefile.in Update copyright years. 2016-01-04 15:30:50 +01:00
aclocal.m4 libcpp: Bump to automake 1.11.6 2015-05-13 11:02:17 +00:00
charset.c re PR c++/69628 (Conditional jump or move depends on uninitialised value(s) in lex_charconst(cpp_token const*) (c-lex.c:1252)) 2016-02-05 20:39:48 +01: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 Update copyright years. 2016-01-04 15:30:50 +01:00
directives.c re PR preprocessor/69650 (ICE in linemap_line_start, at libcpp/line-map.c:803) 2016-04-13 11:40:37 +00:00
errors.c PR preprocessor/69664: fix rich_location::override_column 2016-02-08 17:33:45 +00:00
expr.c expr.c (cpp_classify_number): Hex floats are new in C++1z. 2016-03-15 08:08:31 -04:00
files.c re PR pch/68176 (all pch tests fail on eglibc systems (with bits/predefs.h)) 2016-01-28 23:35:20 +01:00
identifiers.c Update copyright years. 2016-01-04 15:30:50 +01:00
init.c c-common.c (get_source_date_epoch): Rename to cb_get_source_date_epoch. 2016-06-01 16:42:41 +00:00
internal.h c-common.c (get_source_date_epoch): Rename to cb_get_source_date_epoch. 2016-06-01 16:42:41 +00:00
lex.c Change ENABLE_VALGRIND_CHECKING to 2016-05-20 08:03:25 +00:00
line-map.c c-common.c (get_source_date_epoch): Use int64_t instead of long long. 2016-06-22 01:46:06 +00:00
location-example.txt Source range tracking in libcpp and C FE, with bit-packing optimization 2015-11-13 16:29:59 +00:00
macro.c c-common.c (get_source_date_epoch): Rename to cb_get_source_date_epoch. 2016-06-01 16:42:41 +00:00
makeucnid.c Update copyright years. 2016-01-04 15:30:50 +01:00
mkdeps.c Update copyright years. 2016-01-04 15:30:50 +01:00
pch.c Update copyright years. 2016-01-04 15:30:50 +01:00
symtab.c Update copyright years. 2016-01-04 15:30:50 +01:00
system.h Update copyright years. 2016-01-04 15:30:50 +01:00
traditional.c Update copyright years. 2016-01-04 15:30:50 +01:00
ucnid.h Update copyright years. 2016-01-04 15:30:50 +01:00
ucnid.tab Update copyright years. 2016-01-04 15:30:50 +01:00