diff options
author | Andrew Burgess <andrew.burgess@embecosm.com> | 2020-05-14 18:41:39 +0100 |
---|---|---|
committer | Andrew Burgess <andrew.burgess@embecosm.com> | 2020-06-02 13:53:11 +0100 |
commit | fbfb0a463fc7de88a2da8858ac5cd6c2f4796514 (patch) | |
tree | 9a451ad9b5d2edfe0cb960839ba1cee9c015dcf2 /gdb/rust-lang.c | |
parent | 6f8270197a2909607f2c076018e30677bbac652e (diff) | |
download | binutils-fbfb0a463fc7de88a2da8858ac5cd6c2f4796514.zip binutils-fbfb0a463fc7de88a2da8858ac5cd6c2f4796514.tar.gz binutils-fbfb0a463fc7de88a2da8858ac5cd6c2f4796514.tar.bz2 |
gdb: Convert language la_print_type field to a method
This commit changes the language_data::la_print_type 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_type
initializer.
(ada_language::print_type): New member function.
* c-lang.c (c_language_data): Delete la_print_type initializer.
(c_language::print_type): New member function.
(cplus_language_data): Delete la_print_type initializer.
(cplus_language::print_type): New member function.
(asm_language_data): Delete la_print_type initializer.
(asm_language::print_type): New member function.
(minimal_language_data): Delete la_print_type initializer.
(minimal_language::print_type): New member function.
* d-lang.c (d_language_data): Delete la_print_type initializer.
(d_language::print_type): New member function.
* f-lang.c (f_language_data): Delete la_print_type initializer.
(f_language::print_type): New member function.
* go-lang.c (go_language_data): Delete la_print_type initializer.
(go_language::print_type): New member function.
* language.c (unk_lang_print_type): Delete.
(unknown_language_data): Delete la_print_type initializer.
(unknown_language::print_type): New member function.
(auto_language_data): Delete la_print_type initializer.
(auto_language::print_type): New member function.
* language.h (language_data): Delete la_print_type field.
(language_defn::print_type): New function.
(LA_PRINT_TYPE): Update.
* m2-lang.c (m2_language_data): Delete la_print_type initializer.
(m2_language::print_type): New member function.
* objc-lang.c (objc_language_data): Delete la_print_type
initializer.
(objc_language::print_type): New member function.
* opencl-lang.c (opencl_print_type): Delete, implementation moved
to opencl_language::print_type.
(opencl_language_data): Delete la_print_type initializer.
(opencl_language::print_type): New member function, implementation
from opencl_print_type.
* p-lang.c (pascal_language_data): Delete la_print_type
initializer.
(pascal_language::print_type): New member function.
* rust-lang.c (rust_print_type): Delete, implementation moved to
rust_language::print_type.
(rust_language_data): Delete la_print_type initializer.
(rust_language::print_type): New member function, implementation
from rust_print_type.
Diffstat (limited to 'gdb/rust-lang.c')
-rw-r--r-- | gdb/rust-lang.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c index d75f34d..f78686a 100644 --- a/gdb/rust-lang.c +++ b/gdb/rust-lang.c @@ -951,16 +951,6 @@ rust_internal_print_type (struct type *type, const char *varstring, } } -static void -rust_print_type (struct type *type, const char *varstring, - struct ui_file *stream, int show, int level, - const struct type_print_options *flags) -{ - print_offset_data podata; - rust_internal_print_type (type, varstring, stream, show, level, - flags, false, &podata); -} - /* Like arch_composite_type, but uses TYPE to decide how to allocate @@ -2063,7 +2053,6 @@ extern const struct language_data rust_language_data = rust_printchar, /* Print a character constant */ rust_printstr, /* Function to print string constant */ rust_emitchar, /* Print a single char */ - rust_print_type, /* Print a type using appropriate syntax */ rust_print_typedef, /* Print a typedef using appropriate syntax */ rust_value_print_inner, /* la_value_print_inner */ c_value_print, /* Print a top-level value */ @@ -2144,6 +2133,17 @@ public: *demangled = gdb_demangle (mangled, DMGL_PARAMS | DMGL_ANSI); return *demangled != NULL; } + + /* See language.h. */ + + void print_type (struct type *type, const char *varstring, + struct ui_file *stream, int show, int level, + const struct type_print_options *flags) const override + { + print_offset_data podata; + rust_internal_print_type (type, varstring, stream, show, level, + flags, false, &podata); + } }; /* Single instance of the Rust language class. */ |