From: Jakub Jelinek Date: Tue, 25 Sep 2007 10:30:21 +0000 (+0200) Subject: tree.c (cxx_printable_name): Compare FUNCTION_DECL uids rather than pointers. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1bde00421fc1d93e9a92ffe6cd0c221f4494fd33;p=gcc.git tree.c (cxx_printable_name): Compare FUNCTION_DECL uids rather than pointers. * tree.c (cxx_printable_name): Compare FUNCTION_DECL uids rather than pointers. From-SVN: r128761 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 0effc4bc2a5..991a669d407 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,10 +1,14 @@ +2007-09-25 Jakub Jelinek + + * tree.c (cxx_printable_name): Compare FUNCTION_DECL uids + rather than pointers. + 2007-09-24 Danny Smith PR c++/14688 * search.c (check_final_overrider): Fail if targetm.comp_type_attributes returns 0. - 2007-09-24 Jason Merrill PR c++/33239 diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index 77aac702f20..11181c2b425 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -1155,7 +1155,7 @@ build_overload (tree decl, tree chain) const char * cxx_printable_name (tree decl, int v) { - static tree decl_ring[PRINT_RING_SIZE]; + static unsigned int uid_ring[PRINT_RING_SIZE]; static char *print_ring[PRINT_RING_SIZE]; static int ring_counter; int i; @@ -1168,7 +1168,7 @@ cxx_printable_name (tree decl, int v) /* See if this print name is lying around. */ for (i = 0; i < PRINT_RING_SIZE; i++) - if (decl_ring[i] == decl) + if (uid_ring[i] == DECL_UID (decl)) /* yes, so return it. */ return print_ring[i]; @@ -1177,18 +1177,18 @@ cxx_printable_name (tree decl, int v) if (current_function_decl != NULL_TREE) { - if (decl_ring[ring_counter] == current_function_decl) + if (uid_ring[ring_counter] == DECL_UID (current_function_decl)) ring_counter += 1; if (ring_counter == PRINT_RING_SIZE) ring_counter = 0; - gcc_assert (decl_ring[ring_counter] != current_function_decl); + gcc_assert (uid_ring[ring_counter] != DECL_UID (current_function_decl)); } if (print_ring[ring_counter]) free (print_ring[ring_counter]); print_ring[ring_counter] = xstrdup (lang_decl_name (decl, v)); - decl_ring[ring_counter] = decl; + uid_ring[ring_counter] = DECL_UID (decl); return print_ring[ring_counter]; }