gdb: Convert language la_print_typedef field to a method
This commit changes the language_data::la_print_typedef 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_print_typedef initializer. (ada_language::print_typedef): New member function. * c-lang.c (c_language_data): Delete la_print_typedef initializer. (cplus_language_data): Likewise. (asm_language_data): Likewise. (minimal_language_data): Likewise. * d-lang.c (d_language_data): Likewise. * f-lang.c (f_language_data): Likewise. (f_language::print_typedef): New member function. * go-lang.c (go_language_data): Delete la_print_typedef initializer. * language.c (language_defn::print_typedef): Define member function. (unknown_language_data): Delete la_print_typedef initializer. (unknown_language::print_typedef): New member function. (auto_language_data): Delete la_print_typedef initializer. (auto_language::print_typedef): New member function. * language.h (language_data): Delete la_print_typedef field. (language_defn::print_typedef): Declare new member function. (LA_PRINT_TYPEDEF): Update call to print_typedef. (default_print_typedef): Delete declaration. * m2-lang.c (m2_language_data): Delete la_print_typedef initializer. (m2_language::print_typedef): New member function. * objc-lang.c (objc_language_data): Delete la_print_typedef initializer. * opencl-lang.c (opencl_language_data): Likewise. * p-lang.c (pascal_language_data): Likewise. (pascal_language::print_typedef): New member function. * rust-lang.c (rust_print_typedef): Delete function, implementation moved to rust_language::print_typedef. (rust_language): Delete la_print_typedef initializer. (rust_language::print_typedef): New member function, implementation from rust_print_typedef. * typeprint.c (default_print_typedef): Delete.
This commit is contained in:
parent
d711ee67ac
commit
4ffc13fb0e
14 changed files with 118 additions and 51 deletions
|
@ -765,19 +765,6 @@ rust_print_struct_def (struct type *type, const char *varstring,
|
|||
fputs_filtered (is_tuple_struct ? ")" : "}", stream);
|
||||
}
|
||||
|
||||
/* la_print_typedef implementation for Rust. */
|
||||
|
||||
static void
|
||||
rust_print_typedef (struct type *type,
|
||||
struct symbol *new_symbol,
|
||||
struct ui_file *stream)
|
||||
{
|
||||
type = check_typedef (type);
|
||||
fprintf_filtered (stream, "type %s = ", new_symbol->print_name ());
|
||||
type_print (type, "", stream, 0);
|
||||
fprintf_filtered (stream, ";");
|
||||
}
|
||||
|
||||
/* la_print_type implementation for Rust. */
|
||||
|
||||
static void
|
||||
|
@ -1953,7 +1940,6 @@ extern const struct language_data rust_language_data =
|
|||
macro_expansion_no,
|
||||
rust_extensions,
|
||||
&exp_descriptor_rust,
|
||||
rust_print_typedef, /* Print a typedef using appropriate syntax */
|
||||
NULL, /* name_of_this */
|
||||
false, /* la_store_sym_names_in_linkage_form_p */
|
||||
c_op_print_tab, /* expression operators for printing */
|
||||
|
@ -2155,6 +2141,17 @@ public:
|
|||
rust_printstr (stream, elttype, string, length, encoding,
|
||||
force_ellipses, options);
|
||||
}
|
||||
|
||||
/* See language.h. */
|
||||
|
||||
void print_typedef (struct type *type, struct symbol *new_symbol,
|
||||
struct ui_file *stream) const override
|
||||
{
|
||||
type = check_typedef (type);
|
||||
fprintf_filtered (stream, "type %s = ", new_symbol->print_name ());
|
||||
type_print (type, "", stream, 0);
|
||||
fprintf_filtered (stream, ";");
|
||||
}
|
||||
};
|
||||
|
||||
/* Single instance of the Rust language class. */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue