From: Joel Brobecker Date: Thu, 26 Jan 2012 04:21:40 +0000 (+0000) Subject: Remove language param from name_matcher in struct quick_symbol_functions X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e078317b28df990d6b0d54020f364df44d1b9ce4;p=binutils-gdb.git Remove language param from name_matcher in struct quick_symbol_functions The quick_symbol_functions struct contains a field which is pointer a function which takes another function, called name_matcher, as its parameter. This name_matcher currently has 3 arguments, one of them being the language. This parameter is no longer used, and thus deleted. gdb/ChangeLog: * symfile.h (struct quick_symbol_functions) [expand_symtabs_matching]: Remove language parameter from name_matcher. Adjust the comment. * symtab.c (search_symbols_name_matches, expand_partial_symbol_name): Remove language parameter. * ada-lang.c (ada_expand_partial_symbol_name): Likewise. * linespec.c (iterate_name_matcher): Likewise. * dwarf2read.c (dw2_expand_symtabs_matching): Adjust type of name_matcher. Adjust call accordingly. * psymtab.c (expand_symtabs_matching_via_partial): Likewise. (maintenance_check_symtabs): Adjust type of parameter "fun". * psymtab.h (maintenance_check_symtabs): Likewise. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index ab288c9b0f9..bf53d7bff43 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,17 @@ +2012-01-26 Joel Brobecker + + * symfile.h (struct quick_symbol_functions) [expand_symtabs_matching]: + Remove language parameter from name_matcher. Adjust the comment. + * symtab.c (search_symbols_name_matches, expand_partial_symbol_name): + Remove language parameter. + * ada-lang.c (ada_expand_partial_symbol_name): Likewise. + * linespec.c (iterate_name_matcher): Likewise. + * dwarf2read.c (dw2_expand_symtabs_matching): Adjust type of + name_matcher. Adjust call accordingly. + * psymtab.c (expand_symtabs_matching_via_partial): Likewise. + (maintenance_check_symtabs): Adjust type of parameter "fun". + * psymtab.h (maintenance_check_symtabs): Likewise. + 2012-01-26 Joel Brobecker * language.h (symbol_name_match_p_ftype): New typedef. diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 2f70980b4ca..55e318f8194 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -5699,8 +5699,7 @@ struct add_partial_datum /* A callback for expand_partial_symbol_names. */ static int -ada_expand_partial_symbol_name (const struct language_defn *language, - const char *name, void *user_data) +ada_expand_partial_symbol_name (const char *name, void *user_data) { struct add_partial_datum *data = user_data; diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 0ef0a5b38d5..76f8510e57b 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -2691,7 +2691,7 @@ static void dw2_expand_symtabs_matching (struct objfile *objfile, int (*file_matcher) (const char *, void *), - int (*name_matcher) (const struct language_defn *, const char *, void *), + int (*name_matcher) (const char *, void *), enum search_domain kind, void *data) { @@ -2745,7 +2745,7 @@ dw2_expand_symtabs_matching name = index->constant_pool + MAYBE_SWAP (index->symbol_table[idx]); - if (! (*name_matcher) (current_language, name, data)) + if (! (*name_matcher) (name, data)) continue; /* The name was matched, now expand corresponding CUs that were diff --git a/gdb/linespec.c b/gdb/linespec.c index 28fcf4dd4dd..dc9dfc60b57 100644 --- a/gdb/linespec.c +++ b/gdb/linespec.c @@ -336,8 +336,7 @@ struct symbol_matcher_data callback to the expand_symtabs_matching method. */ static int -iterate_name_matcher (const struct language_defn *language, - const char *name, void *d) +iterate_name_matcher (const char *name, void *d) { const struct symbol_matcher_data *data = d; diff --git a/gdb/psymtab.c b/gdb/psymtab.c index 998bc05b730..4d3dced1dac 100644 --- a/gdb/psymtab.c +++ b/gdb/psymtab.c @@ -1250,7 +1250,7 @@ static void expand_symtabs_matching_via_partial (struct objfile *objfile, int (*file_matcher) (const char *, void *), - int (*name_matcher) (const struct language_defn *, const char *, void *), + int (*name_matcher) (const char *, void *), enum search_domain kind, void *data) { @@ -1302,8 +1302,7 @@ expand_symtabs_matching_via_partial && SYMBOL_CLASS (*psym) == LOC_BLOCK) || (kind == TYPES_DOMAIN && SYMBOL_CLASS (*psym) == LOC_TYPEDEF)) - && (*name_matcher) (current_language, - SYMBOL_SEARCH_NAME (*psym), data)) + && (*name_matcher) (SYMBOL_SEARCH_NAME (*psym), data)) { PSYMTAB_TO_SYMTAB (ps); keep_going = 0; @@ -1943,8 +1942,7 @@ maintenance_check_symtabs (char *ignore, int from_tty) void -expand_partial_symbol_names (int (*fun) (const struct language_defn *, - const char *, void *), +expand_partial_symbol_names (int (*fun) (const char *, void *), void *data) { struct objfile *objfile; diff --git a/gdb/psymtab.h b/gdb/psymtab.h index 8fd91ee283e..4089d462b8c 100644 --- a/gdb/psymtab.h +++ b/gdb/psymtab.h @@ -30,8 +30,7 @@ extern struct psymbol_bcache *psymbol_bcache_init (void); extern void psymbol_bcache_free (struct psymbol_bcache *); extern struct bcache *psymbol_bcache_get_bcache (struct psymbol_bcache *); -void expand_partial_symbol_names (int (*fun) (const struct language_defn *, - const char *, void *), +void expand_partial_symbol_names (int (*fun) (const char *, void *), void *data); void map_partial_symbol_filenames (symbol_filename_ftype *fun, void *data, diff --git a/gdb/symfile.h b/gdb/symfile.h index 7af6094561a..d4f3fd90385 100644 --- a/gdb/symfile.h +++ b/gdb/symfile.h @@ -260,8 +260,8 @@ struct quick_symbol_functions Otherwise, if KIND does not match this symbol is skipped. If even KIND matches, then NAME_MATCHER is called for each symbol - defined in the file. The current language, the symbol "search" - name and DATA are passed to NAME_MATCHER. + defined in the file. The symbol "search" name and DATA are passed + to NAME_MATCHER. If NAME_MATCHER returns zero, then this symbol is skipped. @@ -272,7 +272,7 @@ struct quick_symbol_functions void (*expand_symtabs_matching) (struct objfile *objfile, int (*file_matcher) (const char *, void *), - int (*name_matcher) (const struct language_defn *, const char *, void *), + int (*name_matcher) (const char *, void *), enum search_domain kind, void *data); diff --git a/gdb/symtab.c b/gdb/symtab.c index 1746d69a3e8..d3e7b04c23c 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -3201,8 +3201,7 @@ search_symbols_file_matches (const char *filename, void *user_data) /* A callback for expand_symtabs_matching. */ static int -search_symbols_name_matches (const struct language_defn *language, - const char *symname, void *user_data) +search_symbols_name_matches (const char *symname, void *user_data) { struct search_symbols_data *data = user_data; @@ -4010,8 +4009,7 @@ add_macro_name (const char *name, const struct macro_definition *ignore, /* A callback for expand_partial_symbol_names. */ static int -expand_partial_symbol_name (const struct language_defn *language, - const char *name, void *user_data) +expand_partial_symbol_name (const char *name, void *user_data) { struct add_name_data *datum = (struct add_name_data *) user_data;