aboutsummaryrefslogtreecommitdiff
path: root/gdb/symtab.h
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2023-03-14 16:56:38 -0600
committerTom Tromey <tom@tromey.com>2023-08-31 12:41:02 -0600
commit911e1e795e2496e1a5315601ab89e56afcd10fb0 (patch)
tree6238e7783a5cf642c10652b3651c85768781c22a /gdb/symtab.h
parent8c329d5c651e671f9aa9ed87224dc9943a7f76e6 (diff)
downloadgdb-911e1e795e2496e1a5315601ab89e56afcd10fb0.zip
gdb-911e1e795e2496e1a5315601ab89e56afcd10fb0.tar.gz
gdb-911e1e795e2496e1a5315601ab89e56afcd10fb0.tar.bz2
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>
Diffstat (limited to 'gdb/symtab.h')
-rw-r--r--gdb/symtab.h15
1 files changed, 11 insertions, 4 deletions
diff --git a/gdb/symtab.h b/gdb/symtab.h
index fa77fc1..ca3b1a4 100644
--- a/gdb/symtab.h
+++ b/gdb/symtab.h
@@ -1226,6 +1226,10 @@ enum symbol_subclass_kind
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
@@ -1272,6 +1276,13 @@ 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;
@@ -2021,10 +2032,6 @@ extern const char multiple_symbols_cancel[];
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 *);