From 9730bc27c97e294a05b6d71f82f500de2890056b Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Wed, 7 Jul 2010 17:23:39 +0000 Subject: tm.texi: Update. gcc * doc/tm.texi: Update. * doc/tm.texi.in (SDB and DWARF) : Add @hook. * target.def (want_debug_pub_sections): New hook. * config/darwin.h (TARGET_WANT_DEBUG_PUB_SECTIONS): Define. * dwarf2out.c (add_pubname_string): Check targetm.want_debug_pub_sections. (add_pubname): Likewise. (add_pubtype): Likewise. gcc/testsuite * g++.dg/debug/dwarf2/pubnames-1.C: Make darwin-specific. From-SVN: r161924 --- gcc/dwarf2out.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'gcc/dwarf2out.c') diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 55fef55..434783a 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -11238,17 +11238,20 @@ dwarf2_name (tree decl, int scope) static void add_pubname_string (const char *str, dw_die_ref die) { - pubname_entry e; + if (targetm.want_debug_pub_sections) + { + pubname_entry e; - e.die = die; - e.name = xstrdup (str); - VEC_safe_push (pubname_entry, gc, pubname_table, &e); + e.die = die; + e.name = xstrdup (str); + VEC_safe_push (pubname_entry, gc, pubname_table, &e); + } } static void add_pubname (tree decl, dw_die_ref die) { - if (TREE_PUBLIC (decl)) + if (targetm.want_debug_pub_sections && TREE_PUBLIC (decl)) { const char *name = dwarf2_name (decl, 1); if (name) @@ -11263,6 +11266,9 @@ add_pubtype (tree decl, dw_die_ref die) { pubname_entry e; + if (!targetm.want_debug_pub_sections) + return; + e.name = NULL; if ((TREE_PUBLIC (decl) || die->die_parent == comp_unit_die) -- cgit v1.1