From e366d7d807f8d06dc35570871ba2b723b78975af Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Fri, 12 Aug 2016 07:11:50 +0000 Subject: [PR63240] generate debug info for defaulted member functions This implements , a proposal already accepted for inclusion in DWARF-5, but using DW_AT_GNU_defaulted instead of DW_AT_defaulted as the attribute name, because the attribute id for DW_AT_defaulted is not yet publicly available. for include/ChangeLog PR debug/63240 * dwarf2.def (DW_AT_deleted, DW_AT_defaulted): New. * dwarf2.h (enu dwarf_defaulted_attribute): New. for gcc/ChangeLog PR debug/63240 * langhooks-def.h (LANG_HOOKS_FUNCTION_DECL_EXPLICIT_P): Const_tree-ify. (LANG_HOOKS_FUNCTION_DECL_DELETED_P): Likewise. (LANG_HOOKS_FUNCTION_DECL_DEFAULTED): Set default. (LANG_HOOKS_DECLS): Add it. * langhooks.h (struct lang_hooks_for_decls): Add function_decl_defaulted. Const_tree-ify function_decl_explicit_p and function_decl_deleted_p. * dwarf2out.c (gen_subprogram_die): Add DW_AT_defaulted attribute. Add DW_AT_deleted instead of DW_AT_GNU_deleted, also at strict DWARF v5. for gcc/cp/ChangeLog PR debug/63240 * cp-objcp-common.c (cp_function_decl_defaulted): New. (cp_function_decl_explicit_p): Const_tree-ify. (cp_function_decl_deleted_p): Likewise. * cp-objcp-common.h (cp_function_decl_defaulted): Declare. (cp_function_decl_explicit_p): Const_tree-ify. (cp_function_decl_deleted_p): Likewise. (LANG_HOOKS_FUNCTION_DECL_DEFAULTED): Redefine. for gcc/testsuite/ChangeLog PR debug/63240 * g++.dg/debug/dwarf2/defaulted-member-function-1.C: New. * g++.dg/debug/dwarf2/defaulted-member-function-2.C: New. * g++.dg/debug/dwarf2/defaulted-member-function-3.C: New. * g++.dg/debug/dwarf2/deleted-member-function.C: Expect DW_AT_deleted. From-SVN: r239403 --- gcc/langhooks.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'gcc/langhooks.h') diff --git a/gcc/langhooks.h b/gcc/langhooks.h index 169a678..44c258e 100644 --- a/gcc/langhooks.h +++ b/gcc/langhooks.h @@ -181,10 +181,15 @@ struct lang_hooks_for_decls tree (*getdecls) (void); /* Returns true if DECL is explicit member function. */ - bool (*function_decl_explicit_p) (tree); + bool (*function_decl_explicit_p) (const_tree); /* Returns true if DECL is C++11 deleted special member function. */ - bool (*function_decl_deleted_p) (tree); + bool (*function_decl_deleted_p) (const_tree); + + /* Returns 0 if DECL is NOT a C++11 defaulted special member + function, 1 if it is explicitly defaulted within the class body, + or 2 if it is explicitly defaulted outside the class body. */ + int (*function_decl_defaulted) (const_tree); /* Returns True if the parameter is a generic parameter decl of a generic type, e.g a template template parameter for the C++ FE. */ -- cgit v1.1