Change get_std_name_hint to use generated hash table
authorUlrich Drepper <drepper@gmail.com>
Tue, 30 Aug 2022 14:33:51 +0000 (16:33 +0200)
committerUlrich Drepper <drepper@gmail.com>
Tue, 30 Aug 2022 14:33:51 +0000 (16:33 +0200)
commit0c92f895e0b92b8057b84f8584873258760d227b
treef08fb4ccea13c9a7a1dd80c0957c7ff4226da3cc
parent1ddf31af2f3fbfba45882a95dd6eb81bae59f90a
Change get_std_name_hint to use generated hash table

The get_std_name_hint function so far uses linear search to locate
matching entries.  After adding more hint entries this might not be
appropriate anymore.  Therefore this patch also replaces the linear
array with a gperf-generated hash table.

contrib/ChangeLog

* gcc_update (files_and_dependencies): Add rule for
gcc/cp/std-name-hint.h.

gcc/cp/ChangeLog

* Make-lang.in: Add rule to rebuild std-name-hint.h from
std-name-hint.gperf.
* name-lookup.cc (get_std_name_hint): Remove hints array.
Use gperf-generated class std_name_hint_lookup.
Include "std-name-hint.h".
* std-name-hint.gperf: New file.
* std-name-hint.h: New file.  Generated from the .gperf file.
contrib/gcc_update
gcc/cp/Make-lang.in
gcc/cp/name-lookup.cc
gcc/cp/std-name-hint.gperf [new file with mode: 0644]
gcc/cp/std-name-hint.h [new file with mode: 0644]