diff options
author | Andrew Burgess <andrew.burgess@embecosm.com> | 2020-06-01 11:46:54 +0100 |
---|---|---|
committer | Andrew Burgess <andrew.burgess@embecosm.com> | 2020-06-17 09:25:09 +0100 |
commit | c9debfb97e052c32cf0308157cae529ce2059f48 (patch) | |
tree | b1aa4df0a0b049c766e6b29eac377655ed77adbd /gdb/cp-support.h | |
parent | 9a49ad8c522a1ce83645d477bf6ced574c3bf651 (diff) | |
download | gdb-c9debfb97e052c32cf0308157cae529ce2059f48.zip gdb-c9debfb97e052c32cf0308157cae529ce2059f48.tar.gz gdb-c9debfb97e052c32cf0308157cae529ce2059f48.tar.bz2 |
gdb: Convert language la_get_symbol_name_matcher field to a method
This commit changes the language_data::la_get_symbol_name_matcher
function pointer member variable into a member function of
language_defn.
There should be no user visible changes after this commit.
Before this commit access to the la_get_symbol_name_matcher function
pointer was through the get_symbol_name_matcher function, which looked
something like this (is pseudo-code):
<return-type>
get_symbol_name_matcher (language_defn *lang, <other args>)
{
if (current_language == ada)
current_language->la_get_symbol_name_matcher (<other args>);
else
lang->la_get_symbol_name_matcher (<other args>);
}
In this commit I moved the get_symbol_name_matcher as a non-virtual
function in the language_defn base class, I then add a new virtual
method that is only used from within get_symbol_name_matcher, this can
then be overridden by specific languages as needed. So we now have:
class language_defn
{
<return-type> get_symbol_name_matcher (<args>)
{
if (current_language == ada)
return current_language->get_symbol_name_matcher_inner (<args>);
else
return this->get_symbol_name_matcher_inner (<args>);
}
virtual <return-type> get_symbol_name_matcher_inner (<args>)
{
....
}
}
gdb/ChangeLog:
* ada-lang.c (ada_get_symbol_name_matcher): Update header comment.
(ada_language_data): Delete la_get_symbol_name_matcher
initializer.
(language_defn::get_symbol_name_matcher_inner): New member
function.
* c-lang.c (c_language_data): Delete la_get_symbol_name_matcher
initializer.
(cplus_language_data): Likewise.
(cplus_language::get_symbol_name_matcher_inner): New member
function.
(asm_language_data): Delete la_get_symbol_name_matcher initializer.
(minimal_language_data): Likewise.
* cp-support.h (cp_get_symbol_name_matcher): Update header comment.
* d-lang.c (d_language_data): Delete la_get_symbol_name_matcher
initializer.
* dictionary.c (iter_match_first_hashed): Update call to
get_symbol_name_matcher.
(iter_match_next_hashed): Likewise.
(iter_match_next_linear): Likewise.
* dwarf2/read.c (dw2_expand_symtabs_matching_symbol): Likewise.
* f-lang.c (f_language_data): Delete la_get_symbol_name_matcher
initializer.
(f_language::get_symbol_name_matcher_inner): New member function.
* go-lang.c (go_language_data): Delete la_get_symbol_name_matcher
initializer.
* language.c (default_symbol_name_matcher): Update header comment,
make static.
(language_defn::get_symbol_name_matcher): New definition.
(language_defn::get_symbol_name_matcher_inner): Likewise.
(get_symbol_name_matcher): Delete.
(unknown_language_data): Delete la_get_symbol_name_matcher
initializer.
(auto_language_data): Likewise.
* language.h (language_data): Delete la_get_symbol_name_matcher
field.
(language_defn::get_symbol_name_matcher): New member function.
(language_defn::get_symbol_name_matcher_inner): Likewise.
(default_symbol_name_matcher): Delete declaration.
* linespec.c (find_methods): Update call to
get_symbol_name_matcher.
* m2-lang.c (m2_language_data): Delete la_get_symbol_name_matcher
initializer.
* minsyms.c (lookup_minimal_symbol): Update call to
get_symbol_name_matcher.
(iterate_over_minimal_symbols): Likewise.
* objc-lang.c (objc_language_data): Delete
la_get_symbol_name_matcher initializer.
* opencl-lang.c (opencl_language_data): Likewise.
* p-lang.c (pascal_language_data): Likewise.
* psymtab.c (psymbol_name_matches): Update call to
get_symbol_name_matcher.
* rust-lang.c (rust_language_data): Delete
la_get_symbol_name_matcher initializer.
* symtab.c (symbol_matches_search_name): Update call to
get_symbol_name_matcher.
(compare_symbol_name): Likewise.
Diffstat (limited to 'gdb/cp-support.h')
-rw-r--r-- | gdb/cp-support.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/gdb/cp-support.h b/gdb/cp-support.h index 7c948b2..d031ad9 100644 --- a/gdb/cp-support.h +++ b/gdb/cp-support.h @@ -127,8 +127,7 @@ extern struct type *cp_lookup_rtti_type (const char *name, "function" or "bar::function" in all namespaces is possible. */ extern unsigned int cp_search_name_hash (const char *search_name); -/* Implement the "la_get_symbol_name_matcher" language_defn method for - C++. */ +/* Implement the "get_symbol_name_matcher" language_defn method for C++. */ extern symbol_name_matcher_ftype *cp_get_symbol_name_matcher (const lookup_name_info &lookup_name); |