This is the mail archive of the gcc-cvs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

r240028 - in /trunk/gcc: ChangeLog Makefile.in ...


Author: dmalcolm
Date: Wed Sep  7 16:56:23 2016
New Revision: 240028

URL: https://gcc.gnu.org/viewcvs?rev=240028&root=gcc&view=rev
Log:
Move class substring_loc from c-family into gcc

gcc/ChangeLog:
	* Makefile.in (OBJS): Add substring-locations.o.
	* langhooks-def.h (class substring_loc): New forward decl.
	(lhd_get_substring_location): New decl.
	(LANG_HOOKS_GET_SUBSTRING_LOCATION): New macro.
	(LANG_HOOKS_INITIALIZER): Add LANG_HOOKS_GET_SUBSTRING_LOCATION.
	* langhooks.c (lhd_get_substring_location): New function.
	* langhooks.h (class substring_loc): New forward decl.
	(struct lang_hooks): Add field get_substring_location.
	* substring-locations.c: New file, taking definition of
	format_warning_va and format_warning_at_substring from
	c-family/c-format.c, making them non-static.
	* substring-locations.h (class substring_loc): Move class here
	from c-family/c-common.h.  Add and rewrite comments.
	(format_warning_va): New decl.
	(format_warning_at_substring): New decl.
	(get_source_location_for_substring): Add comment.

gcc/c-family/ChangeLog:
	* c-common.c (get_cpp_ttype_from_string_type): Handle being passed
	a POINTER_TYPE.
	(substring_loc::get_location): Move to substring-locations.c,
	keeping implementation as...
	(c_get_substring_location): New function, from the above, reworked
	to use accessors rather than member lookup.
	* c-common.h (class substring_loc): Move to substring-locations.h,
	replacing with a forward decl.
	(c_get_substring_location): New decl.
	* c-format.c: Include "substring-locations.h".
	(format_warning_va): Move to substring-locations.c.
	(format_warning_at_substring): Likewise.

gcc/c/ChangeLog:
	* c-lang.c (LANG_HOOKS_GET_SUBSTRING_LOCATION): Use
	c_get_substring_location for this new langhook.

gcc/testsuite/ChangeLog:
	* gcc.dg/plugin/diagnostic_plugin_test_string_literals.c: Include
	"substring-locations.h".


Added:
    trunk/gcc/substring-locations.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/Makefile.in
    trunk/gcc/c-family/ChangeLog
    trunk/gcc/c-family/c-common.c
    trunk/gcc/c-family/c-common.h
    trunk/gcc/c-family/c-format.c
    trunk/gcc/c/ChangeLog
    trunk/gcc/c/c-lang.c
    trunk/gcc/langhooks-def.h
    trunk/gcc/langhooks.c
    trunk/gcc/langhooks.h
    trunk/gcc/substring-locations.h
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gcc.dg/plugin/diagnostic_plugin_test_string_literals.c


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]