Commit 1bde0042 by Jakub Jelinek Committed by Jakub Jelinek

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
parent 32534ed1
2007-09-25 Jakub Jelinek <jakub@redhat.com>
* tree.c (cxx_printable_name): Compare FUNCTION_DECL uids
rather than pointers.
2007-09-24 Danny Smith <dannysmith@user.sourceforge.net> 2007-09-24 Danny Smith <dannysmith@user.sourceforge.net>
PR c++/14688 PR c++/14688
* search.c (check_final_overrider): Fail if * search.c (check_final_overrider): Fail if
targetm.comp_type_attributes returns 0. targetm.comp_type_attributes returns 0.
2007-09-24 Jason Merrill <jason@redhat.com> 2007-09-24 Jason Merrill <jason@redhat.com>
PR c++/33239 PR c++/33239
......
...@@ -1155,7 +1155,7 @@ build_overload (tree decl, tree chain) ...@@ -1155,7 +1155,7 @@ build_overload (tree decl, tree chain)
const char * const char *
cxx_printable_name (tree decl, int v) 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 char *print_ring[PRINT_RING_SIZE];
static int ring_counter; static int ring_counter;
int i; int i;
...@@ -1168,7 +1168,7 @@ cxx_printable_name (tree decl, int v) ...@@ -1168,7 +1168,7 @@ cxx_printable_name (tree decl, int v)
/* See if this print name is lying around. */ /* See if this print name is lying around. */
for (i = 0; i < PRINT_RING_SIZE; i++) for (i = 0; i < PRINT_RING_SIZE; i++)
if (decl_ring[i] == decl) if (uid_ring[i] == DECL_UID (decl))
/* yes, so return it. */ /* yes, so return it. */
return print_ring[i]; return print_ring[i];
...@@ -1177,18 +1177,18 @@ cxx_printable_name (tree decl, int v) ...@@ -1177,18 +1177,18 @@ cxx_printable_name (tree decl, int v)
if (current_function_decl != NULL_TREE) 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; ring_counter += 1;
if (ring_counter == PRINT_RING_SIZE) if (ring_counter == PRINT_RING_SIZE)
ring_counter = 0; 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]) if (print_ring[ring_counter])
free (print_ring[ring_counter]); free (print_ring[ring_counter]);
print_ring[ring_counter] = xstrdup (lang_decl_name (decl, v)); 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]; return print_ring[ring_counter];
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment