diff options
Diffstat (limited to 'gcc/tree.c')
-rw-r--r-- | gcc/tree.c | 23 |
1 files changed, 22 insertions, 1 deletions
@@ -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. */ |