gdb: Convert language la_compute_program field to a method

This commit changes the language_data::la_compute_program 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_language_data): Delete la_compute_program
	initializer.
	* c-lang.c (c_language_data): Likewise.
	(c_language::compute_program): New member function.
	(cplus_language_data): Delete la_compute_program initializer.
	(cplus_language::compute_program): New member function.
	(asm_language_data): Delete la_compute_program initializer.
	(minimal_language_data): Likewise.
	* c-lang.h (c_compute_program): Update comment.
	(cplus_compute_program): Likewise.
	* compile/compile-c-support.c (c_compute_program): Likewise.
	(cplus_compute_program): Likewise.
	* compile/compile.c (compile_to_object): Update call to
	la_compute_program.
	* d-lang.c (d_language_data): Delete la_compute_program
	initializer.
	* f-lang.c (f_language_data): Likewise.
	* go-lang.c (go_language_data): Likewise.
	* language.c (unknown_language_data): Likewise.
	(auto_language_data): Likewise.
	* language.h (language_data): Delete la_compute_program field.
	(language_defn::compute_program): New member function.
	* m2-lang.c (m2_language_data): Delete la_compute_program
	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_language_data): Likewise.
This commit is contained in:
Andrew Burgess 2020-06-01 11:07:52 +01:00
parent eff93b4d48
commit 9a49ad8c52
16 changed files with 79 additions and 41 deletions

View file

@ -919,7 +919,6 @@ extern const struct language_data c_language_data =
c_watch_location_expression,
NULL, /* la_get_symbol_name_matcher */
&c_varobj_ops,
c_compute_program,
c_is_string_type_p,
"{...}" /* la_struct_too_deep_ellipsis */
};
@ -946,6 +945,16 @@ public:
return c_get_compile_context ();
}
/* See language.h. */
std::string compute_program (compile_instance *inst,
const char *input,
struct gdbarch *gdbarch,
const struct block *expr_block,
CORE_ADDR expr_pc) const override
{
return c_compute_program (inst, input, gdbarch, expr_block, expr_pc);
}
/* See language.h. */
void print_type (struct type *type, const char *varstring,
@ -1025,7 +1034,6 @@ extern const struct language_data cplus_language_data =
c_watch_location_expression,
cp_get_symbol_name_matcher,
&cplus_varobj_ops,
cplus_compute_program,
c_is_string_type_p,
"{...}" /* la_struct_too_deep_ellipsis */
};
@ -1122,6 +1130,16 @@ public:
return cplus_get_compile_context ();
}
/* See language.h. */
std::string compute_program (compile_instance *inst,
const char *input,
struct gdbarch *gdbarch,
const struct block *expr_block,
CORE_ADDR expr_pc) const override
{
return cplus_compute_program (inst, input, gdbarch, expr_block, expr_pc);
}
/* See language.h. */
unsigned int search_name_hash (const char *name) const override
{
@ -1209,7 +1227,6 @@ extern const struct language_data asm_language_data =
c_watch_location_expression,
NULL, /* la_get_symbol_name_matcher */
&default_varobj_ops,
NULL,
c_is_string_type_p,
"{...}" /* la_struct_too_deep_ellipsis */
};
@ -1280,7 +1297,6 @@ extern const struct language_data minimal_language_data =
c_watch_location_expression,
NULL, /* la_get_symbol_name_matcher */
&default_varobj_ops,
NULL,
c_is_string_type_p,
"{...}" /* la_struct_too_deep_ellipsis */
};