From 0f2a9e37fa5487d7f1b4ea3530c497661a6d7817 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Mon, 24 Oct 2016 20:44:30 +0200 Subject: dwarf2out.c (gen_subprogram_die): Add DW_AT_reference or DW_AT_rvalue_reference attributes. * dwarf2out.c (gen_subprogram_die): Add DW_AT_reference or DW_AT_rvalue_reference attributes. * cp-objcp-common.c (cp_decl_dwarf_attribute): Handle DW_AT_reference and DW_AT_rvalue_reference. * g++.dg/debug/dwarf2/ref-2.C: New test. From-SVN: r241492 --- gcc/dwarf2out.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'gcc/dwarf2out.c') diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index b059ed2..515ee6e 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -20662,6 +20662,21 @@ gen_subprogram_die (tree decl, dw_die_ref context_die) if (defaulted != -1) add_AT_unsigned (subr_die, DW_AT_defaulted, defaulted); } + + /* If this is a C++11 non-static member function with & ref-qualifier + then generate a DW_AT_reference attribute. */ + if ((dwarf_version >= 5 || !dwarf_strict) + && lang_hooks.decls.decl_dwarf_attribute (decl, + DW_AT_reference) == 1) + add_AT_flag (subr_die, DW_AT_reference, 1); + + /* If this is a C++11 non-static member function with && + ref-qualifier then generate a DW_AT_reference attribute. */ + if ((dwarf_version >= 5 || !dwarf_strict) + && lang_hooks.decls.decl_dwarf_attribute (decl, + DW_AT_rvalue_reference) + == 1) + add_AT_flag (subr_die, DW_AT_rvalue_reference, 1); } } /* Tag abstract instances with DW_AT_inline. */ -- cgit v1.1