found_sym = false;
for (struct symbol *sym : block_iterator_range (block, &lookup_name))
{
- if (symbol_matches_domain (sym->language (), sym->domain (), domain))
+ if (sym->matches (domain))
{
if (sym->aclass () != LOC_UNRESOLVED)
{
for (struct symbol *sym : block_iterator_range (block))
{
- if (symbol_matches_domain (sym->language (),
- sym->domain (), domain))
+ if (sym->matches (domain))
{
int cmp;
STRUCT vs VAR domain symbols. So if a matching symbol is found,
make sure there is no "better" matching symbol, i.e., one with
exactly the same domain. PR 16253. */
- if (symbol_matches_domain (sym->language (),
- sym->domain (), domain))
+ if (sym->matches (domain))
other = better_symbol (other, sym, domain);
}
return other;
for (struct symbol *sym : block_iterator_range (block, &lookup_name))
{
- if (symbol_matches_domain (sym->language (),
- sym->domain (), domain))
+ if (sym->matches (domain))
{
sym_found = sym;
if (!sym->is_argument ())
if (best_symbol (sym, domain))
return sym;
- /* This is a bit of a hack, but symbol_matches_domain might ignore
+ /* This is a bit of a hack, but 'matches' might ignore
STRUCT vs VAR domain symbols. So if a matching symbol is found,
make sure there is no "better" matching symbol, i.e., one with
exactly the same domain. PR 16253. */
- if (symbol_matches_domain (sym->language (), sym->domain (), domain))
+ if (sym->matches (domain))
other = better_symbol (other, sym, domain);
}
{
/* MATCHER is deliberately called second here so that it never sees
a non-domain-matching symbol. */
- if (symbol_matches_domain (sym->language (), sym->domain (), domain)
+ if (sym->matches (domain)
&& matcher (sym, data))
return sym;
}
for (struct symbol *sym : block_iterator_range (block))
{
- if (symbol_matches_domain (sym->language (),
- sym->domain (), LABEL_DOMAIN)
+ if (sym->matches (LABEL_DOMAIN)
&& cmp (sym->search_name (), name, name_len) == 0)
{
result->push_back ({sym, block});
other = result;
break;
}
- if (symbol_matches_domain (result.symbol->language (),
- result.symbol->domain (), domain))
+ if (result.symbol->matches (domain))
{
struct symbol *better
= better_symbol (other.symbol, result.symbol, domain);
{
for (struct symbol *sym : block_iterator_range (block, &name))
{
- if (symbol_matches_domain (sym->language (), sym->domain (), domain))
+ if (sym->matches (domain))
{
struct block_symbol block_sym = {sym, block};
extern gdb::array_view<const struct symbol_impl> symbol_impls;
+bool symbol_matches_domain (enum language symbol_language,
+ domain_enum symbol_domain,
+ domain_enum domain);
+
/* This structure is space critical. See space comments at the top. */
struct symbol : public general_symbol_info, public allocate_on_obstack
return this->impl ().aclass;
}
+ /* Call symbol_matches_domain on this symbol, using the symbol's
+ domain. */
+ bool matches (domain_enum d) const
+ {
+ return symbol_matches_domain (language (), domain (), d);
+ }
+
domain_enum domain () const
{
return m_domain;
const char *multiple_symbols_select_mode (void);
-bool symbol_matches_domain (enum language symbol_language,
- domain_enum symbol_domain,
- domain_enum domain);
-
/* lookup a symbol table by source file name. */
extern struct symtab *lookup_symtab (const char *);