Add symbol::matches method

This adds symbol::matches, a wrapper for symbol_matches_domain.  Most
places calling symbol_matches_domain can call this method instead,
which is a bit less wordy and also (IMO) clearer.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
This commit is contained in:
Tom Tromey
2023-03-14 16:56:38 -06:00
parent 8c329d5c65
commit 911e1e795e
5 changed files with 21 additions and 19 deletions

View File

@@ -6051,7 +6051,7 @@ ada_add_block_symbols (std::vector<struct block_symbol> &result,
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)
{
@@ -6086,8 +6086,7 @@ ada_add_block_symbols (std::vector<struct block_symbol> &result,
for (struct symbol *sym : block_iterator_range (block))
{
if (symbol_matches_domain (sym->language (),
sym->domain (), domain))
if (sym->matches (domain))
{
int cmp;