aboutsummaryrefslogtreecommitdiff
path: root/gdb/block.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/block.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/block.c')
-rw-r--r--gdb/block.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/gdb/block.c b/gdb/block.c
index 0bdd0f9..079053c 100644
--- a/gdb/block.c
+++ b/gdb/block.c
@@ -679,17 +679,14 @@ better_symbol (struct symbol *a, struct symbol *b,
non-encoded names tested for a match. */
struct symbol *
-block_lookup_symbol (const struct block *block, const char *name,
- symbol_name_match_type match_type,
+block_lookup_symbol (const struct block *block, const lookup_name_info &name,
const domain_search_flags domain)
{
- lookup_name_info lookup_name (name, match_type);
-
if (!block->function ())
{
struct symbol *other = NULL;
- for (struct symbol *sym : block_iterator_range (block, &lookup_name))
+ for (struct symbol *sym : block_iterator_range (block, &name))
{
/* See comment related to PR gcc/debug/91507 in
block_lookup_symbol_primary. */
@@ -717,7 +714,7 @@ block_lookup_symbol (const struct block *block, const char *name,
struct symbol *sym_found = NULL;
- for (struct symbol *sym : block_iterator_range (block, &lookup_name))
+ for (struct symbol *sym : block_iterator_range (block, &name))
{
if (sym->matches (domain))
{