This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
lto-symtab.c change
- From: Tom Tromey <tromey at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Richard Guenther <rguenther at suse dot de>
- Date: Sat, 15 May 2010 12:31:54 -0600
- Subject: lto-symtab.c change
- Reply-to: tromey at redhat dot com
I couldn't find a gcc-patches message for r152491, which changed
lto_symtab_entry_hash to hash on the identifier's contents.
I just wanted to point out that identifiers store a hash value, so
calling htab_hash_string (IDENTIFIER_POINTER (x)) is unnecessary.
You can simply use IDENTIFIER_HASH_VALUE (x) instead.
This actually occurs in several places, not just lto-symtab.c:
grep -nH -e htab_hash_string.\*IDENTIFIER_POINTER *.c
lto-symtab.c:75: return htab_hash_string (IDENTIFIER_POINTER (base->id));
optabs.c:6035: return htab_hash_string (IDENTIFIER_POINTER (DECL_NAME ((const_tree) entry)));
tree.c:645: return htab_hash_string (IDENTIFIER_POINTER (asmname));
varasm.c:368: in.hash = htab_hash_string (IDENTIFIER_POINTER (name));
... though at least the tree.c one seems like it could not use
IDENTIFIER_HASH_VALUE. I didn't examine the others closely.
Tom