gcc/include
Dodji Seketeli f9329c35d7 Emit DWARF for template parameters (PR debug/30161)
ChangeLog:
	PR debug/30161
	* include/dwarf2.h (enum dwarf_tag): Added
	DW_TAG_GNU_template_template_param
	(enum dwarf_attribute): Added DW_AT_GNU_template_name.

gcc/ChangeLog:
	PR debug/30161
	* cgraph.h (cgraph_get_node): Declare ...
	* cgraph.c (cgraph_get_node): ... new function.
	* dwarf2out.c (gen_generic_params_dies,
	generic_parameter_die, tree_add_const_value_attribute_for_decl,
	make_ith_pack_parameter_name,
	append_entry_to_tmpl_value_parm_die_table,
	gen_remaining_tmpl_value_param_die_attribute): New functions.
	(gen_subprogram_die): Generate debug info for template parameters
	if debug info level is higher than DINFO_LEVEL_TERSE.
	Use tree_add_const_value_attribute_for_decl instead of
	tree_add_const_value_attribute.
	(gen_const_die): Use tree_add_const_value_attribute_for_decl
	instead of tree_add_const_value_attribute.
	(gen_struct_or_union_type_die): Generate debug
	info for template parameters if debug info level is higher than
	DINFO_LEVEL_TERSE.
	(tree_add_const_value_attribute): Handle integral and pointer
	constants. Update comment.
	(dwarf_tag_name): Support DW_TAG_GNU_template_template_param.
	(dwarf_attr_name): Support DW_AT_GNU_template_name.
	(reference_to_unused): Fix thinko. Remove redundant predicates from
	tests.
	(tree_add_const_value_attribute): Make this work for constant
	expressions only.
	tree_add_const_value_attribute_for_decl is to be used for variable
	DECLs now.
	(add_location_or_const_value_attribute): Use
	tree_add_const_value_attribute_for_decl now.
	(dwarf2out_finish): Emit the DW_AT_const_value attribute of
	DW_TAG_template_value_param DIEs after function DIEs have been
	emitted.
	* langhooks.h (lang_hooks_for_types): Add
	get_argument_pack_elems.
	(lang_hooks_for_decls): Add generic_generic_parameter_decl_p.
	(lang_hooks): Added get_innermost_generic_parms,
	get_innermost_generic_args.
	* langhooks-def.h (LANG_HOOKS_GET_INNERMOST_GENERIC_PARMS,
	LANG_HOOKS_GET_INNERMOST_GENERIC_ARGS,
	LANG_HOOKS_GET_ARGUMENT_PACK_ELEMS,
	LANG_HOOKS_GENERIC_GENERIC_PARAMETER_DECL_P): New language hooks.

gcc/cp/ChangeLog:
	PR debug/30161
	* cp-tree.h (get_template_info): Parameter should be const.
	(CLASSTYPE_SPECIALIZATION_OF_PRIMARY_TEMPLATE_P): Fix typo.
	(get_template_argument_pack_elems,
	get_primary_template_innermost_parameters,
	get_template_innermost_arguments, template_template_parameter_p):
	Declare ...
	* pt.c (get_template_argument_pack_elems,
	get_template_innermost_parameters, get_template_innermost_arguments,
	template_template_parameter_p):
	... New C++ front end implementation of new language hooks.
	(primary_template_instantiation_p): New private helper.
	(make_ith_pack_parameter_name): Use snprintf and strnlen instead of
	printf and strlen.
	(get_template_info): Const-ify parameter.
	* cp-lang.c (LANG_HOOKS_GET_INNERMOST_GENERIC_PARMS,
	LANG_HOOKS_GET_INNERMOST_GENERIC_ARGS,
	LANG_HOOKS_GET_ARGUMENT_PACK_ELEMS,
	LANG_HOOKS_GENERIC_TYPE_PARAMETER_DECL_P): Initialize these
	interfaces for the C++ front-end.

gcc/testsuite/ChangeLog:
	PR debug/30161
	* g++.dg/debug/dwarf2/template-params-1.C: New test.
	* g++.dg/debug/dwarf2/template-params-2.C: Likewise.
	* g++.dg/debug/dwarf2/template-params-3.C: Likewise.
	* g++.dg/debug/dwarf2/template-params-4.C: Likewise.
	* g++.dg/debug/dwarf2/template-params-5.C: Likewise.
	* g++.dg/debug/dwarf2/template-params-6.C: Likewise.
	* g++.dg/debug/dwarf2/template-func-params-1.C: Likewise.
	* g++.dg/debug/dwarf2/template-func-params-2.C: Likewise.
	* g++.dg/debug/dwarf2/template-func-params-3.C: Likewise.
	* g++.dg/debug/dwarf2/template-func-params-4.C: Likewise.
	* g++.dg/debug/dwarf2/template-func-params-5.C: Likewise.
	* g++.dg/debug/dwarf2/template-func-params-6.C: Likewise.
	* g++.dg/debug/dwarf2/template-func-params-7.C: Likewise.

From-SVN: r151249
2009-08-31 23:48:04 +02:00
..
COPYING Update the address and phone number of the FSF organization. 2005-05-10 15:22:21 +00:00
COPYING3 COPYING_v3: New file. 2007-07-17 08:37:53 +00:00
ChangeLog re PR bootstrap/40854 (Conflicting crc32 functions in libiberty and zlib) 2009-07-25 06:28:16 +00:00
ChangeLog-9103 Convert ChangeLog files to UTF-8. 2008-09-05 13:07:45 +02:00
ansidecl.h * ansidecl.h (ATTRIBUTE_UNUSED_LABEL): Define for C++. 2009-06-10 01:48:14 +00:00
demangle.h demangle.h (enum demangle_component_type <DEMANGLE_COMPONENT_GLOBAL_CONSTRUCTORS>) (enum demangle_component_type <DEMANGLE_COMPONENT_GLOBAL_DESTRUCTORS>): New. 2009-07-17 19:09:54 +00:00
dwarf2.h Emit DWARF for template parameters (PR debug/30161) 2009-08-31 23:48:04 +02:00
dyn-string.h ansidecl.h: Add extern "C" when compiling with C++. 2009-06-01 05:47:20 +00:00
fibheap.h ansidecl.h: Add extern "C" when compiling with C++. 2009-06-01 05:47:20 +00:00
filenames.h * filenames.h: Add extern "C" when compiled with C++. 2008-03-21 23:35:07 +00:00
floatformat.h floatformat.h (struct floatformat): Add split_half field. 2007-11-08 00:08:02 +00:00
fnmatch.h Update the address and phone number of the FSF organization. 2005-05-10 15:22:21 +00:00
getopt.h Update the address and phone number of the FSF organization. 2005-05-10 15:22:21 +00:00
hashtab.h hashtab.h: Update GTY annotations to new syntax 2009-04-22 14:29:36 -04:00
libiberty.h re PR bootstrap/40854 (Conflicting crc32 functions in libiberty and zlib) 2009-07-25 06:28:16 +00:00
md5.h Fix this patch: 2008-03-25 00:19:55 +00:00
objalloc.h Update the address and phone number of the FSF organization. 2005-05-10 15:22:21 +00:00
obstack.h obstack.h (obstack_finish <!__GNUC__>): Cast result to void *. 2008-10-21 09:33:03 +10:30
partition.h Update the address and phone number of the FSF organization. 2005-05-10 15:22:21 +00:00
safe-ctype.h safe-ctype.h: Add #include of ctype.h before redefining the ctype.h macros. 2008-07-07 17:08:21 +00:00
sha1.h sha1.h: New file, from gnulib. 2008-03-25 00:54:53 +00:00
sort.h Update the address and phone number of the FSF organization. 2005-05-10 15:22:21 +00:00
splay-tree.h hashtab.h: Update GTY annotations to new syntax 2009-04-22 14:29:36 -04:00
symcat.h Update the address and phone number of the FSF organization. 2005-05-10 15:22:21 +00:00
xregex.h xregex.h (_REGEX_RE_COMP): Define. 2001-08-02 19:23:47 -04:00
xregex2.h xregex2.h (regexec): Qualify this prototype with __extension__ when compiling with GNU C. 2005-07-12 14:39:07 +10:00
xtensa-config.h include/ 2008-11-19 18:26:00 +00:00