]> git.ipfire.org Git - thirdparty/gcc.git/commit - libiberty/hashtab.c
libiberty: add htab_eq_string
authorTom Tromey <tom@tromey.com>
Thu, 29 Apr 2021 00:44:48 +0000 (18:44 -0600)
committerTom Tromey <tom@tromey.com>
Thu, 6 May 2021 14:51:28 +0000 (08:51 -0600)
commit77380c6806515baf8a30412c29550c257b01133b
tree64da23212825d86de5c67fac7e7897a3f9fe1d77
parente69ac0203725fb8da83a1cc88d32191b7a0b2c0c
libiberty: add htab_eq_string

The libiberty hash table includes a helper function for strings, but
no equality function.  Consequently, this equality function has been
reimplemented a number of times in both the gcc and binutils-gdb
source trees.  This patch adds the function to the libiberty hash
table, as a step toward the goal of removing all the copies.

One change to gcc is included here.  Normally I would have put this in
the next patch, but gensupport.c used the most natural name for its
reimplementation of this function, and this can't coexist with the
extern function in libiberty.

include

* hashtab.h (htab_eq_string): Declare.

libiberty

* hashtab.c (htab_eq_string): New function.

gcc

* gensupport.c (htab_eq_string): Remove.
gcc/gensupport.c
include/hashtab.h
libiberty/hashtab.c