From a78a19b15254de31c3d38b7e27469aaef0a30e97 Mon Sep 17 00:00:00 2001 From: Andrew Burgess Date: Mon, 1 Jun 2020 22:17:59 +0100 Subject: gdb: Convert language la_lookup_symbol_nonlocal field to a method This commit changes the language_data::la_lookup_symbol_nonlocal function pointer member variable into a member function of language_defn. There should be no user visible changes after this commit. gdb/ChangeLog: * ada-lang.c (ada_lookup_symbol_nonlocal): Rename to ada_language::lookup_symbol_nonlocal. (ada_language_data): Delete la_lookup_symbol_nonlocal initializer. (ada_language::lookup_symbol_nonlocal): New member function, implementation from ada_lookup_symbol_nonlocal. * c-lang.c (c_language_data): Delete la_lookup_symbol_nonlocal initializer. (cplus_language_data): Delete la_lookup_symbol_nonlocal initializer. (cplus_language::lookup_symbol_nonlocal): New member function. (asm_language_data): Delete la_lookup_symbol_nonlocal initializer. (minimal_language_data) Likewise. * cp-namespace.c (cp_lookup_nested_symbol): Update comment. * d-lang.c (d_language_data): Delete la_lookup_symbol_nonlocal initializer. (d_language::lookup_symbol_nonlocal): New member function. * f-lang.c (f_language_data): Delete la_lookup_symbol_nonlocal initializer. (f_language::lookup_symbol_nonlocal): New member function. * go-lang.c (go_language_data): Delete la_lookup_symbol_nonlocal initializer. * language.c (unknown_language_data): Likewise. (auto_language_data): Likewise. * language.h (language_data): Delete la_lookup_symbol_nonlocal field. (language_defn::lookup_symbol_nonlocal): New member function. * m2-lang.c (m2_language_data): Delete la_lookup_symbol_nonlocal initializer. * objc-lang.c (objc_language_data): Likewise. * opencl-lang.c (opencl_language_data): Likewise. * p-lang.c (pascal_language_data): Likewise. * rust-lang.c (rust_lookup_symbol_nonlocal): Rename to rust_language::lookup_symbol_nonlocal. (rust_language_data): Delete la_lookup_symbol_nonlocal initializer. (rust_language::lookup_symbol_nonlocal): New member function, implementation from rust_lookup_symbol_nonlocal. * symtab.c (lookup_symbol_aux): Update call to lookup_symbol_nonlocal. (basic_lookup_symbol_nonlocal): Rename to... (language_defn::lookup_symbol_nonlocal): ...this, and update header comment. Remove language_defn parameter, and replace with uses of `this'. * symtab.h (basic_lookup_symbol_nonlocal): Delete declaration. --- gdb/c-lang.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'gdb/c-lang.c') diff --git a/gdb/c-lang.c b/gdb/c-lang.c index cead372..64dfd71 100644 --- a/gdb/c-lang.c +++ b/gdb/c-lang.c @@ -897,7 +897,6 @@ extern const struct language_data c_language_data = c_print_typedef, /* Print a typedef using appropriate syntax */ NULL, /* name_of_this */ true, /* la_store_sym_names_in_linkage_form_p */ - basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */ c_op_print_tab, /* expression operators for printing */ 1, /* c-style arrays */ 0, /* String lower bound */ @@ -1006,7 +1005,6 @@ extern const struct language_data cplus_language_data = c_print_typedef, /* Print a typedef using appropriate syntax */ "this", /* name_of_this */ false, /* la_store_sym_names_in_linkage_form_p */ - cp_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */ c_op_print_tab, /* expression operators for printing */ 1, /* c-style arrays */ 0, /* String lower bound */ @@ -1162,6 +1160,15 @@ public: return cp_class_name_from_physname (physname); } + /* See language.h. */ + + struct block_symbol lookup_symbol_nonlocal + (const char *name, const struct block *block, + const domain_enum domain) const override + { + return cp_lookup_symbol_nonlocal (this, name, block, domain); + } + protected: /* See language.h. */ @@ -1203,7 +1210,6 @@ extern const struct language_data asm_language_data = c_print_typedef, /* Print a typedef using appropriate syntax */ NULL, /* name_of_this */ true, /* la_store_sym_names_in_linkage_form_p */ - basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */ c_op_print_tab, /* expression operators for printing */ 1, /* c-style arrays */ 0, /* String lower bound */ @@ -1267,7 +1273,6 @@ extern const struct language_data minimal_language_data = c_print_typedef, /* Print a typedef using appropriate syntax */ NULL, /* name_of_this */ true, /* la_store_sym_names_in_linkage_form_p */ - basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */ c_op_print_tab, /* expression operators for printing */ 1, /* c-style arrays */ 0, /* String lower bound */ -- cgit v1.1