aboutsummaryrefslogtreecommitdiff
path: root/gdb/language.h
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2020-06-01 11:07:52 +0100
committerAndrew Burgess <andrew.burgess@embecosm.com>2020-06-17 09:25:09 +0100
commit9a49ad8c522a1ce83645d477bf6ced574c3bf651 (patch)
treed7094bdb142f991e9147938c8ea7553b62fcab49 /gdb/language.h
parenteff93b4d48eb0e79b7879475bb47eec55dbb41be (diff)
downloadgdb-9a49ad8c522a1ce83645d477bf6ced574c3bf651.zip
gdb-9a49ad8c522a1ce83645d477bf6ced574c3bf651.tar.gz
gdb-9a49ad8c522a1ce83645d477bf6ced574c3bf651.tar.bz2
gdb: Convert language la_compute_program field to a method
This commit changes the language_data::la_compute_program 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_compute_program initializer. * c-lang.c (c_language_data): Likewise. (c_language::compute_program): New member function. (cplus_language_data): Delete la_compute_program initializer. (cplus_language::compute_program): New member function. (asm_language_data): Delete la_compute_program initializer. (minimal_language_data): Likewise. * c-lang.h (c_compute_program): Update comment. (cplus_compute_program): Likewise. * compile/compile-c-support.c (c_compute_program): Likewise. (cplus_compute_program): Likewise. * compile/compile.c (compile_to_object): Update call to la_compute_program. * d-lang.c (d_language_data): Delete la_compute_program initializer. * f-lang.c (f_language_data): Likewise. * go-lang.c (go_language_data): Likewise. * language.c (unknown_language_data): Likewise. (auto_language_data): Likewise. * language.h (language_data): Delete la_compute_program field. (language_defn::compute_program): New member function. * m2-lang.c (m2_language_data): Delete la_compute_program 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.h42
1 files changed, 22 insertions, 20 deletions
diff --git a/gdb/language.h b/gdb/language.h
index 36fc2c5..523a7a9 100644
--- a/gdb/language.h
+++ b/gdb/language.h
@@ -354,26 +354,6 @@ struct language_data
/* Various operations on varobj. */
const struct lang_varobj_ops *la_varobj_ops;
- /* This method must be defined if 'la_get_gcc_context' is defined.
- If 'la_get_gcc_context' is not defined, then this method is
- ignored.
-
- This takes the user-supplied text and returns a new bit of code
- to compile.
-
- INST is the compiler instance being used.
- INPUT is the user's input text.
- GDBARCH is the architecture to use.
- EXPR_BLOCK is the block in which the expression is being
- parsed.
- EXPR_PC is the PC at which the expression is being parsed. */
-
- std::string (*la_compute_program) (compile_instance *inst,
- const char *input,
- struct gdbarch *gdbarch,
- const struct block *expr_block,
- CORE_ADDR expr_pc);
-
/* Return true if TYPE is a string type. */
bool (*la_is_string_type_p) (struct type *type);
@@ -476,6 +456,28 @@ struct language_defn : language_data
return nullptr;
}
+ /* This method must be overridden if 'get_compile_instance' is
+ overridden.
+
+ This takes the user-supplied text and returns a new bit of code
+ to compile.
+
+ INST is the compiler instance being used.
+ INPUT is the user's input text.
+ GDBARCH is the architecture to use.
+ EXPR_BLOCK is the block in which the expression is being
+ parsed.
+ EXPR_PC is the PC at which the expression is being parsed. */
+
+ virtual std::string compute_program (compile_instance *inst,
+ const char *input,
+ struct gdbarch *gdbarch,
+ const struct block *expr_block,
+ CORE_ADDR expr_pc) const
+ {
+ gdb_assert_not_reached ("language_defn::compute_program");
+ }
+
/* Hash the given symbol search name. */
virtual unsigned int search_name_hash (const char *name) const;