aboutsummaryrefslogtreecommitdiff
path: root/gdb/f-lang.c
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2020-05-01 21:51:15 +0100
committerAndrew Burgess <andrew.burgess@embecosm.com>2020-06-02 13:53:10 +0100
commit1fb314aaa3142711e452e66c2dced781a4d1ef87 (patch)
treece4f8ed92b2c79139a274e51c53d782a3682fb05 /gdb/f-lang.c
parent48448202d7e607d7423c6186438099f442732a95 (diff)
downloadgdb-1fb314aaa3142711e452e66c2dced781a4d1ef87.zip
gdb-1fb314aaa3142711e452e66c2dced781a4d1ef87.tar.gz
gdb-1fb314aaa3142711e452e66c2dced781a4d1ef87.tar.bz2
gdb: Convert language la_language_arch_info field to a method
This commit changes the language_data::la_language_arch_info 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_arch_info): Delete function, move implementation to... (ada_language::language_arch_info): ...here, a new member function. (ada_language_data): Delete la_language_arch_info. * c-lang.c (c_language_data): Likewise. (c_language::language_arch_info): New member function. (cplus_language_arch_info): Delete function, move implementation to... (cplus_language::language_arch_info): ...here, a new member function. (cplus_language_data): Delete la_language_arch_info. (asm_language_data): Likewise. (asm_language::language_arch_info): New member function. (minimal_language_data): Delete la_language_arch_info. (minimal_language::language_arch_info): New member function. * d-lang.c (d_language_arch_info): Delete function, move implementation to... (d_language::language_arch_info): ...here, a new member function. (d_language_data): Delete la_language_arch_info. * f-lang.c (f_language_arch_info): Delete function, move implementation to... (f_language::language_arch_info): ...here, a new member function. (f_language_data): Delete la_language_arch_info. * go-lang.c (go_language_arch_info): Delete function, move implementation to... (go_language::language_arch_info): ...here, a new member function. (go_language_data): Delete la_language_arch_info. * language.c (unknown_language_data): Likewise. (unknown_language::language_arch_info): New member function. (auto_language_data): Delete la_language_arch_info. (auto_language::language_arch_info): New member function. (language_gdbarch_post_init): Update call to la_language_arch_info. * language.h (language_data): Delete la_language_arch_info function pointer. (language_defn::language_arch_info): New function. * m2-lang.c (m2_language_arch_info): Delete function, move implementation to... (m2_language::language_arch_info): ...here, a new member function. (m2_language_data): Delete la_language_arch_info. * objc-lang.c (objc_language_arch_info): Delete function, move implementation to... (objc_language::language_arch_info): ...here, a new member function. (objc_language_data): Delete la_language_arch_info. * opencl-lang.c (opencl_language_arch_info): Delete function, move implementation to... (opencl_language::language_arch_info): ...here, a new member function. (opencl_language_data): Delete la_language_arch_info. * p-lang.c (pascal_language_arch_info): Delete function, move implementation to... (pascal_language::language_arch_info): ...here, a new member function. (pascal_language_data): Delete la_language_arch_info. * rust-lang.c (rust_language_arch_info): Delete function, move implementation to... (rust_language::language_arch_info): ...here, a new member function. (rust_language_data): Delete la_language_arch_info.
Diffstat (limited to 'gdb/f-lang.c')
-rw-r--r--gdb/f-lang.c77
1 files changed, 38 insertions, 39 deletions
diff --git a/gdb/f-lang.c b/gdb/f-lang.c
index 78959b1..1eeb507 100644
--- a/gdb/f-lang.c
+++ b/gdb/f-lang.c
@@ -165,44 +165,6 @@ enum f_primitive_types {
nr_f_primitive_types
};
-static void
-f_language_arch_info (struct gdbarch *gdbarch,
- struct language_arch_info *lai)
-{
- const struct builtin_f_type *builtin = builtin_f_type (gdbarch);
-
- lai->string_char_type = builtin->builtin_character;
- lai->primitive_type_vector
- = GDBARCH_OBSTACK_CALLOC (gdbarch, nr_f_primitive_types + 1,
- struct type *);
-
- lai->primitive_type_vector [f_primitive_type_character]
- = builtin->builtin_character;
- lai->primitive_type_vector [f_primitive_type_logical]
- = builtin->builtin_logical;
- lai->primitive_type_vector [f_primitive_type_logical_s1]
- = builtin->builtin_logical_s1;
- lai->primitive_type_vector [f_primitive_type_logical_s2]
- = builtin->builtin_logical_s2;
- lai->primitive_type_vector [f_primitive_type_logical_s8]
- = builtin->builtin_logical_s8;
- lai->primitive_type_vector [f_primitive_type_real]
- = builtin->builtin_real;
- lai->primitive_type_vector [f_primitive_type_real_s8]
- = builtin->builtin_real_s8;
- lai->primitive_type_vector [f_primitive_type_real_s16]
- = builtin->builtin_real_s16;
- lai->primitive_type_vector [f_primitive_type_complex_s8]
- = builtin->builtin_complex_s8;
- lai->primitive_type_vector [f_primitive_type_complex_s16]
- = builtin->builtin_complex_s16;
- lai->primitive_type_vector [f_primitive_type_void]
- = builtin->builtin_void;
-
- lai->bool_type_symbol = "logical";
- lai->bool_type_default = builtin->builtin_logical_s2;
-}
-
/* Remove the modules separator :: from the default break list. */
static const char *
@@ -670,7 +632,6 @@ extern const struct language_data f_language_data =
1, /* String lower bound */
f_word_break_characters,
f_collect_symbol_completion_matches,
- f_language_arch_info,
c_watch_location_expression,
cp_get_symbol_name_matcher, /* la_get_symbol_name_matcher */
iterate_over_symbols,
@@ -690,6 +651,44 @@ public:
f_language ()
: language_defn (language_fortran, f_language_data)
{ /* Nothing. */ }
+
+ /* See language.h. */
+ void language_arch_info (struct gdbarch *gdbarch,
+ struct language_arch_info *lai) const override
+ {
+ const struct builtin_f_type *builtin = builtin_f_type (gdbarch);
+
+ lai->string_char_type = builtin->builtin_character;
+ lai->primitive_type_vector
+ = GDBARCH_OBSTACK_CALLOC (gdbarch, nr_f_primitive_types + 1,
+ struct type *);
+
+ lai->primitive_type_vector [f_primitive_type_character]
+ = builtin->builtin_character;
+ lai->primitive_type_vector [f_primitive_type_logical]
+ = builtin->builtin_logical;
+ lai->primitive_type_vector [f_primitive_type_logical_s1]
+ = builtin->builtin_logical_s1;
+ lai->primitive_type_vector [f_primitive_type_logical_s2]
+ = builtin->builtin_logical_s2;
+ lai->primitive_type_vector [f_primitive_type_logical_s8]
+ = builtin->builtin_logical_s8;
+ lai->primitive_type_vector [f_primitive_type_real]
+ = builtin->builtin_real;
+ lai->primitive_type_vector [f_primitive_type_real_s8]
+ = builtin->builtin_real_s8;
+ lai->primitive_type_vector [f_primitive_type_real_s16]
+ = builtin->builtin_real_s16;
+ lai->primitive_type_vector [f_primitive_type_complex_s8]
+ = builtin->builtin_complex_s8;
+ lai->primitive_type_vector [f_primitive_type_complex_s16]
+ = builtin->builtin_complex_s16;
+ lai->primitive_type_vector [f_primitive_type_void]
+ = builtin->builtin_void;
+
+ lai->bool_type_symbol = "logical";
+ lai->bool_type_default = builtin->builtin_logical_s2;
+ }
};
/* Single instance of the Fortran language class. */