aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2014-05-28 12:38:23 -0400
committerJason Merrill <jason@gcc.gnu.org>2014-05-28 12:38:23 -0400
commitd67ff7b75deab58eaac2edccafbc55d32f60ed0d (patch)
tree53efc05fb878998b2cf66e3d30efe41a6bfd5650 /gcc/tree.c
parenta41acf5f3e06afa2790ff826b16ccccf1959842c (diff)
downloadgcc-d67ff7b75deab58eaac2edccafbc55d32f60ed0d.zip
gcc-d67ff7b75deab58eaac2edccafbc55d32f60ed0d.tar.gz
gcc-d67ff7b75deab58eaac2edccafbc55d32f60ed0d.tar.bz2
re PR c++/47202 (Endless recursion during mangling)
PR c++/47202 gcc/cp/ * decl.c (cxx_comdat_group): Return a decl. * optimize.c (cdtor_comdat_group): Get its DECL_ASSEMBLER_NAME. gcc/ * cgraph.h (symtab_node::get_comdat_group_id): New. * cgraphunit.c (analyze_functions): Call it. * symtab.c (dump_symtab_node): Likewise. * tree.c (decl_comdat_group_id): New. * tree.h: Declare it. * lto-streamer-out.c (write_symbol): Use it. * trans-mem.c (ipa_tm_create_version_alias): Likewise. From-SVN: r211026
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index 394a821..cf7e362 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -603,7 +603,9 @@ decl_assembler_name (tree decl)
return DECL_WITH_VIS_CHECK (decl)->decl_with_vis.assembler_name;
}
-/* Return comdat group of DECL. */
+/* When the target supports COMDAT groups, this indicates which group the
+ DECL is associated with. This can be either an IDENTIFIER_NODE or a
+ decl, in which case its DECL_ASSEMBLER_NAME identifies the group. */
tree
decl_comdat_group (tree node)
{
@@ -613,6 +615,16 @@ decl_comdat_group (tree node)
return snode->get_comdat_group ();
}
+/* Likewise, but make sure it's been reduced to an IDENTIFIER_NODE. */
+tree
+decl_comdat_group_id (tree node)
+{
+ struct symtab_node *snode = symtab_get_node (node);
+ if (!snode)
+ return NULL;
+ return snode->get_comdat_group_id ();
+}
+
/* Compute the number of bytes occupied by a tree with code CODE.
This function cannot be used for nodes that have variable sizes,
including TREE_VEC, INTEGER_CST, STRING_CST, and CALL_EXPR. */