aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2008-07-13 12:06:19 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2008-07-13 10:06:19 +0000
commit266ad5c82612749d080ab25f67a677c89b344567 (patch)
tree1ee8898b82ca9a88353189796c35234da2da21d2 /gcc/tree.c
parent52ca125521c3e1d5b9fff7e3710ccbfdd3b2d797 (diff)
downloadgcc-266ad5c82612749d080ab25f67a677c89b344567.zip
gcc-266ad5c82612749d080ab25f67a677c89b344567.tar.gz
gcc-266ad5c82612749d080ab25f67a677c89b344567.tar.bz2
cgraph.c (assembler_name_hash): New static var.
* cgraph.c (assembler_name_hash): New static var. (hash_node_by_assembler_name, eq_assembler_name): New. (cgraph_node_for_asm): Use hashtable. (cgraph_remove_node): Maintain hashtable. (change_decl_assembler_name): Sanity check that names are not changing after aliasing was processed. * cgraph.h (varpoon_node): Add next GGC marker. * tree.c (decl_assembler_name_equal): Constify. (decl_assembler_name_hash): New. * tree.h (decl_assembler_name_equal): Constify. (decl_assembler_name_hash): Update. From-SVN: r137753
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index 14ecf38..81c471b 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -347,7 +347,7 @@ decl_assembler_name (tree decl)
/* Compare ASMNAME with the DECL_ASSEMBLER_NAME of DECL. */
bool
-decl_assembler_name_equal (tree decl, tree asmname)
+decl_assembler_name_equal (tree decl, const_tree asmname)
{
tree decl_asmname = DECL_ASSEMBLER_NAME (decl);
@@ -378,6 +378,27 @@ decl_assembler_name_equal (tree decl, tree asmname)
return false;
}
+/* Hash asmnames ignoring the user specified marks. */
+
+hashval_t
+decl_assembler_name_hash (const_tree asmname)
+{
+ if (IDENTIFIER_POINTER (asmname)[0] == '*')
+ {
+ const char *decl_str = IDENTIFIER_POINTER (asmname) + 1;
+ size_t ulp_len = strlen (user_label_prefix);
+
+ if (ulp_len == 0)
+ ;
+ else if (strncmp (decl_str, user_label_prefix, ulp_len) == 0)
+ decl_str += ulp_len;
+
+ return htab_hash_string (decl_str);
+ }
+
+ return htab_hash_string (IDENTIFIER_POINTER (asmname));
+}
+
/* 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, PHI_NODE, STRING_CST, and CALL_EXPR. */