Avoid some copying in psymtab.c
authorTom Tromey <tromey@adacore.com>
Wed, 1 Apr 2020 13:47:13 +0000 (07:47 -0600)
committerTom Tromey <tromey@adacore.com>
Wed, 1 Apr 2020 13:47:13 +0000 (07:47 -0600)
commit8c072cb6a19abdc9d4b93c19a1d609fe1a486c32
treec86d4d5e1100f0394e216a397bd125557c7e7c29
parent81e3a1d00cbe19c1a9b189601c269d1b5db02343
Avoid some copying in psymtab.c

I noticed that psymtab.c was always copying the search string in
psymtab_search_name, even when it wasn't necessary.  This patch
removes this function in favor of using the make_ignore_params feature
of lookup_name_info.

Once I had done that, I noticed that lookup_partial_symbol was
creating a lookup_name_info.  However, this function called in loops,
causing even more excess allocation.  This patch further fixes this by
hosting the creation of the lookup_name_info into the callers.

gdb/ChangeLog
2020-04-01  Tom Tromey  <tromey@adacore.com>

* psymtab.c (psymtab_search_name): Remove function.
(psym_lookup_symbol): Create search name and lookup name here.
(lookup_partial_symbol): Remove "name" parameter; add
lookup_name.
(psym_expand_symtabs_for_function): Update.
gdb/ChangeLog
gdb/psymtab.c