summaryrefslogtreecommitdiff
path: root/gcc/dwarf2out.c
diff options
context:
space:
mode:
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2010-07-07 17:23:39 +0000
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2010-07-07 17:23:39 +0000
commit1651aa771c5d90bfcf9456a86670e430b6eb49a7 (patch)
tree36e5a2d6ff28400d1fe31caff904f627834f515a /gcc/dwarf2out.c
parent103aa1240a2527d0fd5a3b215d12decd9697168b (diff)
downloadgcc-1651aa771c5d90bfcf9456a86670e430b6eb49a7.tar.gz
gcc
* doc/tm.texi: Update. * doc/tm.texi.in (SDB and DWARF) <TARGET_WANT_DEBUG_PUB_SECTIONS>: 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@161924 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r--gcc/dwarf2out.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 55fef55ed3f..434783ac2a5 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)