This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

lto-symtab.c change


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]