From e071b7678195f4176938730e348503cddc2a87b4 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Sat, 29 Jul 2017 09:52:16 +0200 Subject: debug.h (struct gcc_debug_hooks): Add IMPLICIT argument to imported_module_or_decl hook. * debug.h (struct gcc_debug_hooks): Add IMPLICIT argument to imported_module_or_decl hook. (debug_nothing_tree_tree_tree_bool): Remove. (debug_nothing_tree_tree_tree_bool_bool): New declaration. * debug.c (do_nothing_debug_hooks): Use debug_nothing_tree_tree_tree_bool_bool instead of debug_nothing_tree_tree_tree_bool. * vmsdbgout.c (vmsdbg_debug_hooks): Likewise. * dbxout.c (dbx_debug_hooks, xcoff_debug_hooks): Likewise. * sdbout.c (sdb_debug_hooks): Likewise. * dwarf2out.c (dwarf2_lineno_debug_hooks): Likewise. (gen_namespace_die): Add DW_AT_export_symbols attribute if langhook wants it. (dwarf2out_imported_module_or_decl): Add IMPLICIT argument, if true, -gdwarf-5 and decl will have DW_AT_export_symbols attribute, don't add anything. cp/ * cp-objcp-common.c (cp_decl_dwarf_attribute): Handle DW_AT_export_symbols. * name-lookup.c (emit_debug_info_using_namespace): Add IMPLICIT argument, pass it through to the debug hook. (finish_namespace_using_directive): Adjust emit_debug_info_using_namespace caller. (push_namespace): Likewise. Call it after setting DECL_NAMESPACE_INLINE_P. (cp_emit_debug_info_for_using): Pass false as new argument to the imported_module_or_decl debug hook. fortran/ * trans-decl.c (gfc_trans_use_stmts): Pass false as new argument to the imported_module_or_decl debug hook. ada/ * gcc-interface/utils.c (gnat_write_global_declarations): Pass false as new argument to the imported_module_or_decl debug hook. testsuite/ * g++.dg/debug/dwarf2/inline-ns-1.C: New test. * g++.dg/debug/dwarf2/inline-ns-2.C: New test. From-SVN: r250713 --- gcc/cp/cp-objcp-common.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'gcc/cp/cp-objcp-common.c') diff --git a/gcc/cp/cp-objcp-common.c b/gcc/cp/cp-objcp-common.c index 5a7da5b..4475b6c 100644 --- a/gcc/cp/cp-objcp-common.c +++ b/gcc/cp/cp-objcp-common.c @@ -212,6 +212,13 @@ cp_decl_dwarf_attribute (const_tree decl, int attr) } break; + case DW_AT_export_symbols: + if (TREE_CODE (decl) == NAMESPACE_DECL + && (DECL_NAMESPACE_INLINE_P (decl) + || (DECL_NAME (decl) == NULL_TREE && dwarf_version >= 5))) + return 1; + break; + default: break; } -- cgit v1.1