gcc/libcpp
David Malcolm 40499f81a6 PR c++/70105: Defer location expansion until diagnostic_show_locus
gcc/ChangeLog:
	PR c/68473
	PR c++/70105
	* diagnostic-show-locus.c (layout_range::layout_range): Replace
	location_range param with three const expanded_locations * and a
	bool.
	(layout::layout): Replace call to
	rich_location::lazily_expand_location with get_expanded_location.
	Extract the range and perform location expansion here, passing
	the results to the layout_range ctor.
	* diagnostic.c (source_range::debug): Delete.
	* diagnostic.h (diagnostic_expand_location): Reimplement in terms
	of rich_location::get_expanded_location.
	* gcc-rich-location.c (get_range_for_expr): Delete.
	(gcc_rich_location::add_expr): Reimplement to avoid the
	rich_location::add_range overload that took a location_range,
	passing a location_t instead.

gcc/testsuite/ChangeLog:
	PR c/68473
	PR c++/70105
	* gcc.dg/plugin/diagnostic_plugin_show_trees.c (show_tree):
	Drop range information from call to inform_at_rich_loc.
	* gcc.dg/plugin/diagnostic_plugin_test_show_locus.c (add_range):
	New.
	(test_show_locus): Replace calls to rich_location::add_range with
	calls to add_range.  Rewrite the tests that used the now-defunct
	rich_location ctor taking a source_range.  Simplify other tests
	by replacing calls to COMBINE_LOCATION_DATA with calls to
	make_location.

libcpp/ChangeLog:
	PR c/68473
	PR c++/70105
	* include/line-map.h (source_range::debug): Delete.
	(struct location_range): Update comment.  Replace
	expanded_location fields "m_start", "m_finish", and "m_caret" with
	a source_location field: "m_loc".
	(class rich_location): Reword comment.
	(rich_location::get_loc): Reimplement in terms of a new overloaded
	variant which takes an unsigned int.
	(rich_location::get_loc_addr): Delete.
	(rich_location::add_range): Drop params "start" and "finish" in
	favor of param "loc".  Drop overloaded variants taking a
	source_range or location_range *.
	(rich_location::lazily_expand_location): Delete in favor of...
	(rich_location::get_expanded_location): New decl.
	(rich_location::m_loc): Delete field.
	(rich_location::m_column_override): New field.
	* line-map.c (rich_location::rich_location):  Drop name of
	line_maps * param.  Update initializations for deletion of field
	"m_loc" and addition of field "m_column_override".  Reimplement
	body as a call to add_range.  Delete overloaded variant taking a
	source_range.
	(rich_location::get_loc): New function.
	(rich_location::lazily_expand_location): Delete in favor of...
	(rich_location::get_expanded_location): New function.
	(rich_location::override_column): Reimplement.
	(rich_location::add_range): Drop params "start" and "finish" in
	favor of param "loc".  Eliminate location expansion in favor of
	simply storing loc.  Drop overloaded variants taking a
	source_range or location_range *.
	(rich_location::set_range): Eliminate location expansion.

From-SVN: r234087
2016-03-09 18:14:43 +00:00
..
include PR c++/70105: Defer location expansion until diagnostic_show_locus 2016-03-09 18:14:43 +00:00
po * sr.po: Update. 2016-03-05 12:07:03 +00:00
aclocal.m4
ChangeLog PR c++/70105: Defer location expansion until diagnostic_show_locus 2016-03-09 18:14:43 +00:00
ChangeLog.jit
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
configure
configure.ac
directives-only.c Update copyright years. 2016-01-04 15:30:50 +01:00
directives.c * directives.c (destringize_and_run): Adjust prototype. 2016-01-28 15:33:55 +01:00
errors.c PR preprocessor/69664: fix rich_location::override_column 2016-02-08 17:33:45 +00:00
expr.c Update copyright years. 2016-01-04 15:30:50 +01: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 Update copyright years. 2016-01-04 15:30:50 +01:00
internal.h libcpp: use better locations for _Pragma tokens (preprocessor/69126) 2016-01-27 18:57:51 +00:00
lex.c Update copyright years. 2016-01-04 15:30:50 +01:00
line-map.c PR c++/70105: Defer location expansion until diagnostic_show_locus 2016-03-09 18:14:43 +00:00
location-example.txt
macro.c libcpp: use better locations for _Pragma tokens (preprocessor/69126) 2016-01-27 18:57:51 +00:00
Makefile.in Update copyright years. 2016-01-04 15:30:50 +01: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