diff options
author | Jakub Jelinek <jakub@redhat.com> | 2016-10-17 08:53:00 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2016-10-17 08:53:00 +0200 |
commit | 81b42cc69beca2d92cf2675b8b3c1c714f8f74fd (patch) | |
tree | 811f8875b4efdbf7940bca258ddcf5f69be38c13 /gcc/dwarf2out.c | |
parent | 7d66648f6c1ba3f353dadd26a0caf3d5ceebb51c (diff) | |
download | gcc-81b42cc69beca2d92cf2675b8b3c1c714f8f74fd.zip gcc-81b42cc69beca2d92cf2675b8b3c1c714f8f74fd.tar.gz gcc-81b42cc69beca2d92cf2675b8b3c1c714f8f74fd.tar.bz2 |
langhooks.h (struct lang_hooks_for_decls): Remove function_decl_explicit_p...
* langhooks.h (struct lang_hooks_for_decls): Remove
function_decl_explicit_p, function_decl_deleted_p and
function_decl_defaulted hooks. Add decl_dwarf_attribute hook.
* langhooks-def.h (lhd_decl_dwarf_attribute): Declare.
(LANG_HOOKS_FUNCTION_DECL_EXPLICIT_P,
LANG_HOOKS_FUNCTION_DECL_DELETED_P,
LANG_HOOKS_FUNCTION_DECL_DEFAULTED): Remove.
(LANG_HOOKS_DECL_DWARF_ATTRIBUTE): Define.
(LANG_HOOKS_DECLS): Remove LANG_HOOKS_FUNCTION_DECL_EXPLICIT_P,
LANG_HOOKS_FUNCTION_DECL_DELETED_P and
LANG_HOOKS_FUNCTION_DECL_DEFAULTED. Add
LANG_HOOKS_DECL_DWARF_ATTRIBUTE.
* langhooks.c (lhd_decl_dwarf_attribute): New function.
* dwarf2out.c (gen_subprogram_die): Use
lang_hooks.decls.decl_dwarf_attribute instead of
lang_hooks.decls.function_decl_*.
cp/
* cp-objcp-common.h (cp_function_decl_explicit_p,
cp_function_decl_deleted_p, cp_function_decl_defaulted): Remove.
(cp_decl_dwarf_attribute): Declare.
(LANG_HOOKS_FUNCTION_DECL_EXPLICIT_P,
LANG_HOOKS_FUNCTION_DECL_DELETED_P,
LANG_HOOKS_FUNCTION_DECL_DEFAULTED): Remove.
(LANG_HOOKS_DECL_DWARF_ATTRIBUTE): Redefine.
* cp-objcp-common.c (cp_function_decl_explicit_p,
cp_function_decl_deleted_p, cp_function_decl_defaulted): Remove.
(cp_decl_dwarf_attribute): New function.
From-SVN: r241227
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r-- | gcc/dwarf2out.c | 65 |
1 files changed, 26 insertions, 39 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 541faf7..ae4cad1 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -20625,20 +20625,19 @@ gen_subprogram_die (tree decl, dw_die_ref context_die) /* When we process the method declaration, we haven't seen the out-of-class defaulted definition yet, so we have to recheck now. */ - int defaulted = lang_hooks.decls.function_decl_defaulted (decl); - if (defaulted && (dwarf_version >= 5 || ! dwarf_strict) + if ((dwarf_version >= 5 || ! dwarf_strict) && !get_AT (subr_die, DW_AT_defaulted)) - switch (defaulted) - { - case 2: - add_AT_unsigned (subr_die, DW_AT_defaulted, - DW_DEFAULTED_out_of_class); - break; - - case 1: /* This must have been handled before. */ - default: - gcc_unreachable (); - } + { + int defaulted + = lang_hooks.decls.decl_dwarf_attribute (decl, + DW_AT_defaulted); + if (defaulted != -1) + { + /* Other values must have been handled before. */ + gcc_assert (defaulted == DW_DEFAULTED_out_of_class); + add_AT_unsigned (subr_die, DW_AT_defaulted, defaulted); + } + } } } /* Create a fresh DIE for anything else. */ @@ -20681,40 +20680,28 @@ gen_subprogram_die (tree decl, dw_die_ref context_die) /* If this is an explicit function declaration then generate a DW_AT_explicit attribute. */ - if (lang_hooks.decls.function_decl_explicit_p (decl) - && (dwarf_version >= 3 || !dwarf_strict)) + if ((dwarf_version >= 3 || !dwarf_strict) + && lang_hooks.decls.decl_dwarf_attribute (decl, + DW_AT_explicit) == 1) add_AT_flag (subr_die, DW_AT_explicit, 1); /* If this is a C++11 deleted special function member then generate a DW_AT_deleted attribute. */ - if (lang_hooks.decls.function_decl_deleted_p (decl) - && (dwarf_version >= 5 || ! dwarf_strict)) + if ((dwarf_version >= 5 || !dwarf_strict) + && lang_hooks.decls.decl_dwarf_attribute (decl, + DW_AT_deleted) == 1) add_AT_flag (subr_die, DW_AT_deleted, 1); /* If this is a C++11 defaulted special function member then generate a DW_AT_GNU_defaulted attribute. */ - int defaulted = lang_hooks.decls.function_decl_defaulted (decl); - if (defaulted && (dwarf_version >= 5 || ! dwarf_strict)) - switch (defaulted) - { - case 1: - add_AT_unsigned (subr_die, DW_AT_defaulted, - DW_DEFAULTED_in_class); - break; - - /* It is likely that this will never hit, since we - don't have the out-of-class definition yet when we - process the class definition and the method - declaration. We recheck elsewhere, but leave it - here just in case. */ - case 2: - add_AT_unsigned (subr_die, DW_AT_defaulted, - DW_DEFAULTED_out_of_class); - break; - - default: - gcc_unreachable (); - } + if (dwarf_version >= 5 || !dwarf_strict) + { + int defaulted + = lang_hooks.decls.decl_dwarf_attribute (decl, + DW_AT_defaulted); + if (defaulted != -1) + add_AT_unsigned (subr_die, DW_AT_defaulted, defaulted); + } } } /* Tag abstract instances with DW_AT_inline. */ |