aboutsummaryrefslogtreecommitdiff
path: root/gdb/language.h
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2020-05-01 17:18:36 +0100
committerAndrew Burgess <andrew.burgess@embecosm.com>2020-06-02 13:53:10 +0100
commit5bd40f2a3feb273e92b640544f6e5307c8124d90 (patch)
treec3ba117050973c6ccd8534667b3eeb408f459863 /gdb/language.h
parent0874fd075b2a519022259a3cc48e650dc1daeeab (diff)
downloadfsf-binutils-gdb-5bd40f2a3feb273e92b640544f6e5307c8124d90.zip
fsf-binutils-gdb-5bd40f2a3feb273e92b640544f6e5307c8124d90.tar.gz
fsf-binutils-gdb-5bd40f2a3feb273e92b640544f6e5307c8124d90.tar.bz2
gdb: Convert language la_print_array_index field to a method
This commit changes the language_data::la_print_array_index 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_print_array_index): Delete function, move implementation to... (ada_language::print_array_index): ...here. (ada_language_data): Delete la_print_array_index initializer. * c-lang.c (c_language_data): Likewise. (cplus_language_data): Likewise. (minimal_language_data): Likewise. * d-lang.c (d_language_data): Likewise. * f-lang.c (f_language_data): Likewise. * go-lang.c (go_language_data): Likewise. * language.c (default_print_array_index): Delete function, move implementation to... (language_defn::print_array_index): ...here. (unknown_language_data): Delete la_print_array_index initializer. (auto_language_data): Likewise. * language.h (struct language_data): Delete la_print_array_index field. (language_defn::print_array_index): New member function. (LA_PRINT_ARRAY_INDEX): Update. (default_print_array_index): Delete declaration. * m2-lang.c (m2_language_data): Delete la_print_array_index 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.
Diffstat (limited to 'gdb/language.h')
-rw-r--r--gdb/language.h23
1 files changed, 10 insertions, 13 deletions
diff --git a/gdb/language.h b/gdb/language.h
index 351ad49..8960f1e 100644
--- a/gdb/language.h
+++ b/gdb/language.h
@@ -387,12 +387,6 @@ struct language_data
void (*la_language_arch_info) (struct gdbarch *,
struct language_arch_info *);
- /* Print the index of an element of an array. */
- void (*la_print_array_index) (struct type *index_type,
- LONGEST index_value,
- struct ui_file *stream,
- const struct value_print_options *options);
-
/* Return information about whether TYPE should be passed
(and returned) by reference at the language level. */
struct language_pass_by_ref_info (*la_pass_by_reference)
@@ -495,6 +489,14 @@ struct language_defn : language_data
languages[lang] = this;
}
+ /* Print the index of an element of an array. This default
+ implementation prints using C99 syntax. */
+
+ virtual void print_array_index (struct type *index_type,
+ LONGEST index_value,
+ struct ui_file *stream,
+ const value_print_options *options) const;
+
/* List of all known languages. */
static const struct language_defn *languages[nr_languages];
};
@@ -600,8 +602,8 @@ extern enum language set_language (enum language);
(current_language->la_emitchar(ch, type, stream, quoter))
#define LA_PRINT_ARRAY_INDEX(index_type, index_value, stream, options) \
- (current_language->la_print_array_index(index_type, index_value, stream, \
- options))
+ (current_language->print_array_index(index_type, index_value, stream, \
+ options))
#define LA_ITERATE_OVER_SYMBOLS(BLOCK, NAME, DOMAIN, CALLBACK) \
(current_language->la_iterate_over_symbols (BLOCK, NAME, DOMAIN, CALLBACK))
@@ -663,11 +665,6 @@ extern char *language_class_name_from_physname (const struct language_defn *,
/* Splitting strings into words. */
extern const char *default_word_break_characters (void);
-/* Print the index of an array element using the C99 syntax. */
-extern void default_print_array_index (struct type *index_type, LONGEST index,
- struct ui_file *stream,
- const struct value_print_options *options);
-
/* Return information about whether TYPE should be passed
(and returned) by reference at the language level. */
struct language_pass_by_ref_info language_pass_by_reference (struct type *type);