From 2d791ea645a1593e9c397d152e72a2e72dda9243 Mon Sep 17 00:00:00 2001 From: paolo Date: Sat, 1 Mar 2014 21:14:00 +0000 Subject: [PATCH] /cp 2014-03-01 Paolo Carlini * method.c (implicitly_declare_fn): Remove redundant DECL_TEMPLATE_RESULT and STRIP_TEMPLATE uses. * semantics.c (is_instantiation_of_constexpr): Likewise. * error.c (dump_function_decl): Likewise. 2014-03-01 Paolo Carlini * dwarf2out.c (gen_subprogram_die): Tidy. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@208248 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 4 ++++ gcc/cp/ChangeLog | 7 +++++++ gcc/cp/error.c | 2 +- gcc/cp/method.c | 8 +++----- gcc/cp/semantics.c | 3 +-- gcc/dwarf2out.c | 12 +++++++----- 6 files changed, 23 insertions(+), 13 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c7936ea..f9a644a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2014-03-01 Paolo Carlini + + * dwarf2out.c (gen_subprogram_die): Tidy. + 2014-03-01 Oleg Endo PR target/60071 diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 9e97f33..4b6682a 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +2014-03-01 Paolo Carlini + + * method.c (implicitly_declare_fn): Remove redundant + DECL_TEMPLATE_RESULT and STRIP_TEMPLATE uses. + * semantics.c (is_instantiation_of_constexpr): Likewise. + * error.c (dump_function_decl): Likewise. + 2014-03-01 Jason Merrill PR c++/60379 diff --git a/gcc/cp/error.c b/gcc/cp/error.c index 050791c..454feb5 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -1465,7 +1465,7 @@ dump_function_decl (cxx_pretty_printer *pp, tree t, int flags) else if (DECL_VIRTUAL_P (t)) pp_cxx_ws_string (pp, "virtual"); - if (DECL_DECLARED_CONSTEXPR_P (STRIP_TEMPLATE (t))) + if (DECL_DECLARED_CONSTEXPR_P (t)) pp_cxx_ws_string (pp, "constexpr"); } diff --git a/gcc/cp/method.c b/gcc/cp/method.c index 7843824..c3940f2 100644 --- a/gcc/cp/method.c +++ b/gcc/cp/method.c @@ -1645,9 +1645,8 @@ implicitly_declare_fn (special_function_kind kind, tree type, /* For an inheriting constructor template, just copy these flags from the inherited constructor template for now. */ raises = TYPE_RAISES_EXCEPTIONS (TREE_TYPE (inherited_ctor)); - deleted_p = DECL_DELETED_FN (DECL_TEMPLATE_RESULT (inherited_ctor)); - constexpr_p - = DECL_DECLARED_CONSTEXPR_P (DECL_TEMPLATE_RESULT (inherited_ctor)); + deleted_p = DECL_DELETED_FN (inherited_ctor); + constexpr_p = DECL_DECLARED_CONSTEXPR_P (inherited_ctor); } else synthesized_method_walk (type, kind, const_p, &raises, &trivial_p, @@ -1726,8 +1725,7 @@ implicitly_declare_fn (special_function_kind kind, tree type, TREE_PROTECTED (fn) = TREE_PROTECTED (inherited_ctor); /* Copy constexpr from the inherited constructor even if the inheriting constructor doesn't satisfy the requirements. */ - constexpr_p - = DECL_DECLARED_CONSTEXPR_P (STRIP_TEMPLATE (inherited_ctor)); + constexpr_p = DECL_DECLARED_CONSTEXPR_P (inherited_ctor); } /* Add the "this" parameter. */ this_parm = build_this_parm (fn_type, TYPE_UNQUALIFIED); diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index eaeeb24..787eab8 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -3941,8 +3941,7 @@ static inline bool is_instantiation_of_constexpr (tree fun) { return (DECL_TEMPLOID_INSTANTIATION (fun) - && DECL_DECLARED_CONSTEXPR_P (DECL_TEMPLATE_RESULT - (DECL_TI_TEMPLATE (fun)))); + && DECL_DECLARED_CONSTEXPR_P (DECL_TI_TEMPLATE (fun))); } /* Generate RTL for FN. */ diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 1c3ff03..2b584a5 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -18028,11 +18028,13 @@ gen_subprogram_die (tree decl, dw_die_ref context_die) /* If the prototype had an 'auto' or 'decltype(auto)' return type, emit the real type on the definition die. */ - if (is_cxx() && debug_info_level > DINFO_LEVEL_TERSE - && (get_AT_ref (old_die, DW_AT_type) == auto_die - || get_AT_ref (old_die, DW_AT_type) == decltype_auto_die)) - add_type_attribute (subr_die, TREE_TYPE (TREE_TYPE (decl)), - 0, 0, context_die); + if (is_cxx() && debug_info_level > DINFO_LEVEL_TERSE) + { + dw_die_ref die = get_AT_ref (old_die, DW_AT_type); + if (die == auto_die || die == decltype_auto_die) + add_type_attribute (subr_die, TREE_TYPE (TREE_TYPE (decl)), + 0, 0, context_die); + } } } else -- 2.7.4