aboutsummaryrefslogtreecommitdiff
path: root/gdb/language.h
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2020-06-02 21:54:49 +0100
committerAndrew Burgess <andrew.burgess@embecosm.com>2020-06-23 13:34:11 +0100
commitec8cec5b96e2ebbd5e25a737c69d311970a8b219 (patch)
tree6ec122e770ec9883edf23d867e98c4ee2b920f12 /gdb/language.h
parent1bf9c36374d9c758bc49dc18dca7acf0719e290d (diff)
downloadgdb-ec8cec5b96e2ebbd5e25a737c69d311970a8b219.zip
gdb-ec8cec5b96e2ebbd5e25a737c69d311970a8b219.tar.gz
gdb-ec8cec5b96e2ebbd5e25a737c69d311970a8b219.tar.bz2
gdb: Convert language la_emitchar field to a method
This commit changes the language_data::la_emitchar 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 (emit_char): Renamed to ada_language::emitchar. (ada_language_data): Delete la_emitchar initializer. (ada_language::emitchar): New member function, implementation from emit_char. * c-lang.c (c_language_data): Delete la_emitchar initializer. (cplus_language_data): Likewise. (asm_language_data): Likewise. (minimal_language_data): Likewise. * d-lang.c (d_language_data): Likewise. * f-lang.c (f_emit_char): Rename to f_language::emitchar. (f_language_data): Delete la_emitchar initializer. (f_language::emitchar): New member function, implementation from f_emit_char. * go-lang.c (go_language_data): Delete la_emitchar initializer. * language.c (unk_lang_emit_char): Delete. (language_defn::emitchar): New member function definition. (unknown_language_data): Delete la_emitchar initializer. (unknown_language::emitchar): New member function. (auto_language_data): Delete la_emitchar initializer. (auto_language::emitchar): New member function. * language.h (language_data): Delete la_emitchar field. (language_defn::emitchar): New member field declaration. (LA_EMIT_CHAR): Update call to emitchar. * m2-lang.c (m2_emit_char): Rename to m2_language::emitchar. (m2_language_data): Delete la_emitchar initializer. (m2_language::emitchar): New member function, implementation from m2_emit_char. * objc-lang.c (objc_language_data): Delete la_emitchar initializer. * opencl-lang.c (opencl_language_data): Likewise. * p-lang.c (pascal_emit_char): Rename to pascal_language::emitchar. (pascal_language_data): Delete la_emitchar initializer. (pascal_language::emitchar): New member function, implementation from pascal_emit_char. * rust-lang.c (rust_emitchar): Rename to rust_language::emitchar. (rust_language_data): Delete la_emitchar initializer. (rust_language::emitchar): New member function, implementation from rust_emitchar.
Diffstat (limited to 'gdb/language.h')
-rw-r--r--gdb/language.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/gdb/language.h b/gdb/language.h
index d5b106d..612afb3 100644
--- a/gdb/language.h
+++ b/gdb/language.h
@@ -233,9 +233,6 @@ struct language_data
const char *encoding, int force_ellipses,
const struct value_print_options *);
- void (*la_emitchar) (int ch, struct type *chtype,
- struct ui_file * stream, int quoter);
-
/* Print a typedef using syntax appropriate for this language.
TYPE is the underlying type. NEW_SYMBOL is the symbol naming
the type. STREAM is the output stream on which to print. */
@@ -544,6 +541,12 @@ struct language_defn : language_data
/* By default the post-parser does nothing. */
}
+ /* Print the character CH (of type CHTYPE) on STREAM as part of the
+ contents of a literal string whose delimiter is QUOTER. */
+
+ virtual void emitchar (int ch, struct type *chtype,
+ struct ui_file *stream, int quoter) const;
+
protected:
/* This is the overridable part of the GET_SYMBOL_NAME_MATCHER method.
@@ -651,7 +654,7 @@ extern enum language set_language (enum language);
(current_language->la_printstr(stream, elttype, string, length, \
encoding, force_ellipses,options))
#define LA_EMIT_CHAR(ch, type, stream, quoter) \
- (current_language->la_emitchar(ch, type, stream, quoter))
+ (current_language->emitchar (ch, type, stream, quoter))
#define LA_PRINT_ARRAY_INDEX(index_type, index_value, stream, options) \
(current_language->print_array_index(index_type, index_value, stream, \