lto-symtab.c change
Tom Tromey
tromey@redhat.com
Sat May 15 18:32:00 GMT 2010
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
More information about the Gcc-patches
mailing list