aboutsummaryrefslogtreecommitdiff
path: root/gdb/psymtab.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2024-01-25 11:17:24 -0700
committerTom Tromey <tromey@adacore.com>2024-02-15 10:16:48 -0700
commite70d6457a648c25d4382bcc030e9f5a94f3ca189 (patch)
tree3f52408d44a03e39787392ac5b5fa30abde5d029 /gdb/psymtab.c
parent7921285b6c2ba0bee9bb21d8e23fdea4c790c181 (diff)
downloadfsf-binutils-gdb-e70d6457a648c25d4382bcc030e9f5a94f3ca189.zip
fsf-binutils-gdb-e70d6457a648c25d4382bcc030e9f5a94f3ca189.tar.gz
fsf-binutils-gdb-e70d6457a648c25d4382bcc030e9f5a94f3ca189.tar.bz2
Move lookup_name_info creation into basic_lookup_transparent_type
I noticed that basic_lookup_transparent_type calls two different functions that both proceed to create a lookup_name_info. It's more efficient to create this object in the outermost layer possible. Making this change required a few related changes, resulting in this patch. There are still more changes of this sort that could be made. Regression tested on x86-64 Fedora 38.
Diffstat (limited to 'gdb/psymtab.c')
-rw-r--r--gdb/psymtab.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/gdb/psymtab.c b/gdb/psymtab.c
index cb7a397..334a941 100644
--- a/gdb/psymtab.c
+++ b/gdb/psymtab.c
@@ -1505,8 +1505,9 @@ maintenance_check_psymtabs (const char *ignore, int from_tty)
&& psym->ginfo.value_address () == 0)
continue;
- sym = block_lookup_symbol (b, psym->ginfo.search_name (),
- symbol_name_match_type::SEARCH_NAME,
+ lookup_name_info lookup_name
+ (psym->ginfo.search_name (), symbol_name_match_type::SEARCH_NAME);
+ sym = block_lookup_symbol (b, lookup_name,
to_search_flags (psym->domain));
if (!sym)
{
@@ -1520,8 +1521,9 @@ maintenance_check_psymtabs (const char *ignore, int from_tty)
b = bv->global_block ();
for (partial_symbol *psym : ps->global_psymbols)
{
- sym = block_lookup_symbol (b, psym->ginfo.search_name (),
- symbol_name_match_type::SEARCH_NAME,
+ lookup_name_info lookup_name
+ (psym->ginfo.search_name (), symbol_name_match_type::SEARCH_NAME);
+ sym = block_lookup_symbol (b, lookup_name,
to_search_flags (psym->domain));
if (!sym)
{