libiberty: add htab_eq_string
authorTom Tromey <tom@tromey.com>
Thu, 29 Apr 2021 00:44:48 +0000 (18:44 -0600)
committerRichard Earnshaw <rearnsha@arm.com>
Fri, 7 May 2021 10:17:11 +0000 (11:17 +0100)
commitc759c777c98fab555d28d133ef0793607f8c3afc
tree05b6f52b6a4ec335853f019ce9cd2a9e6330f034
parent4cf88725da1cb503be04d3237354105ec170bc86
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.
include/hashtab.h
libiberty/hashtab.c
This page took 0.023956 seconds and 4 git commands to generate.