+2020-09-16 Andrew Burgess <andrew.burgess@embecosm.com>
+
+ * ada-lang.c (ada_language_data): Remove la_op_print_tab
+ initializer.
+ (ada_language::opcode_print_table): New member function.
+ * c-lang.c (c_language_data): Remove la_op_print_tab initializer.
+ (c_language::opcode_print_table): New member function.
+ (cplus_language_data): Remove la_op_print_tab initializer.
+ (cplus_language::opcode_print_table): New member function.
+ (asm_language_data): Remove la_op_print_tab initializer.
+ (asm_language::opcode_print_table): New member function.
+ (minimal_language_data): Remove la_op_print_tab initializer.
+ (minimal_language::opcode_print_table): New member function.
+ * d-lang.c (d_language_data): Remove la_op_print_tab initializer.
+ (d_language::opcode_print_table): New member function.
+ * expprint.c (print_subexp_standard): Update call to
+ opcode_print_table.
+ (op_string): Likewise.
+ * f-lang.c (f_language_data): Remove la_op_print_tab initializer.
+ (f_language::opcode_print_table): New member function.
+ * go-lang.c (go_language_data): Remove la_op_print_tab
+ initializer.
+ (go_language::opcode_print_table): New member function.
+ * language.c (unknown_language_data): Remove la_op_print_tab
+ initializer.
+ (unknown_language::opcode_print_table): New member function.
+ (auto_language_data): Remove la_op_print_tab initializer.
+ (auto_language::opcode_print_table): New member function.
+ * language.h (language_data): Remove la_op_print_tab field.
+ (language_defn::opcode_print_table): Declare new member function.
+ * m2-lang.c (m2_language_data): Remove la_op_print_tab
+ initializer.
+ (m2_language::opcode_print_table): New member function.
+ * objc-lang.c (objc_language_data): Remove la_op_print_tab
+ initializer.
+ (objc_language::opcode_print_table): New member function.
+ * opencl-lang.c (opencl_language_data): Remove la_op_print_tab
+ initializer.
+ (opencl_language::opcode_print_table): New member function.
+ * p-lang.c (pascal_language_data): Remove la_op_print_tab
+ initializer.
+ (pascal_language::opcode_print_table): New member function.
+ * rust-lang.c (rust_language_data): Remove la_op_print_tab
+ initializer.
+ (rust_language::opcode_print_table): New member function.
+
2020-09-16 Andrew Burgess <andrew.burgess@embecosm.com>
* ada-lang.c (ada_language_data): Remove la_exp_desc initializer.
extern const struct language_data ada_language_data =
{
- ada_op_print_tab, /* expression operators for printing */
};
/* Class representing the Ada language. */
const struct exp_descriptor *expression_ops () const override
{ return &ada_exp_descriptor; }
+ /* See language.h. */
+
+ const struct op_print *opcode_print_table () const override
+ { return ada_op_print_tab; }
+
protected:
/* See language.h. */
extern const struct language_data c_language_data =
{
- c_op_print_tab, /* expression operators for printing */
};
/* Class representing the C language. */
const struct exp_descriptor *expression_ops () const override
{ return &exp_descriptor_c; }
+
+ /* See language.h. */
+
+ const struct op_print *opcode_print_table () const override
+ { return c_op_print_tab; }
};
/* Single instance of the C language class. */
extern const struct language_data cplus_language_data =
{
- c_op_print_tab, /* expression operators for printing */
};
/* A class for the C++ language. */
const struct exp_descriptor *expression_ops () const override
{ return &exp_descriptor_c; }
+ /* See language.h. */
+
+ const struct op_print *opcode_print_table () const override
+ { return c_op_print_tab; }
+
protected:
/* See language.h. */
extern const struct language_data asm_language_data =
{
- c_op_print_tab, /* expression operators for printing */
};
/* A class for the ASM language. */
const struct exp_descriptor *expression_ops () const override
{ return &exp_descriptor_c; }
+
+ /* See language.h. */
+
+ const struct op_print *opcode_print_table () const override
+ { return c_op_print_tab; }
};
/* The single instance of the ASM language class. */
extern const struct language_data minimal_language_data =
{
- c_op_print_tab, /* expression operators for printing */
};
/* A class for the minimal language. */
const struct exp_descriptor *expression_ops () const override
{ return &exp_descriptor_c; }
+
+ /* See language.h. */
+
+ const struct op_print *opcode_print_table () const override
+ { return c_op_print_tab; }
};
/* The single instance of the minimal language class. */
extern const struct language_data d_language_data =
{
- d_op_print_tab, /* Expression operators for printing. */
};
/* Class representing the D language. */
const struct exp_descriptor *expression_ops () const override
{ return &exp_descriptor_c; }
+
+ /* See language.h. */
+
+ const struct op_print *opcode_print_table () const override
+ { return d_op_print_tab; }
};
/* Single instance of the D language class. */
struct value *val;
char *tempstr = NULL;
- op_print_tab = exp->language_defn->la_op_print_tab;
+ op_print_tab = exp->language_defn->opcode_print_table ();
pc = (*pos)++;
opcode = exp->elts[pc].opcode;
switch (opcode)
int tem;
const struct op_print *op_print_tab;
- op_print_tab = current_language->la_op_print_tab;
+ op_print_tab = current_language->opcode_print_table ();
for (tem = 0; op_print_tab[tem].opcode != OP_NULL; tem++)
if (op_print_tab[tem].opcode == op)
return op_print_tab[tem].string;
extern const struct language_data f_language_data =
{
- f_op_print_tab, /* expression operators for printing */
};
/* Class representing the Fortran language. */
const struct exp_descriptor *expression_ops () const override
{ return &exp_descriptor_f; }
+ /* See language.h. */
+
+ const struct op_print *opcode_print_table () const override
+ { return f_op_print_tab; }
+
protected:
/* See language.h. */
extern const struct language_data go_language_data =
{
- go_op_print_tab, /* Expression operators for printing. */
};
/* Class representing the Go language. */
const struct exp_descriptor *expression_ops () const override
{ return &exp_descriptor_c; }
+
+ /* See language.h. */
+
+ const struct op_print *opcode_print_table () const override
+ { return go_op_print_tab; }
};
/* Single instance of the Go language class. */
extern const struct language_data unknown_language_data =
{
- unk_op_print_tab, /* expression operators for printing */
};
/* Class representing the unknown language. */
bool store_sym_names_in_linkage_form_p () const override
{ return true; }
+
+ /* See language.h. */
+
+ const struct op_print *opcode_print_table () const override
+ { return unk_op_print_tab; }
};
/* Single instance of the unknown language class. */
extern const struct language_data auto_language_data =
{
- unk_op_print_tab, /* expression operators for printing */
};
/* Class representing the fake "auto" language. */
const char *name_of_this () const override
{ return "this"; }
+
+ /* See language.h. */
+
+ const struct op_print *opcode_print_table () const override
+ { return unk_op_print_tab; }
};
/* Single instance of the fake "auto" language. */
struct language_data
{
- /* Table for printing expressions. */
-
- const struct op_print *la_op_print_tab;
};
/* Base class from which all other language classes derive. */
virtual const struct exp_descriptor *expression_ops () const;
+ /* Table for printing expressions. */
+
+ virtual const struct op_print *opcode_print_table () const = 0;
+
protected:
/* This is the overridable part of the GET_SYMBOL_NAME_MATCHER method.
extern const struct language_data m2_language_data =
{
- m2_op_print_tab, /* expression operators for printing */
};
/* Class representing the M2 language. */
const struct exp_descriptor *expression_ops () const override
{ return &exp_descriptor_modula2; }
+
+ /* See language.h. */
+
+ const struct op_print *opcode_print_table () const override
+ { return m2_op_print_tab; }
};
/* Single instance of the M2 language. */
extern const struct language_data objc_language_data =
{
- objc_op_print_tab, /* Expression operators for printing */
};
/* Class representing the Objective-C language. */
enum macro_expansion macro_expansion () const override
{ return macro_expansion_c; }
+
+ /* See language.h. */
+
+ const struct op_print *opcode_print_table () const override
+ { return c_op_print_tab; }
};
/* Single instance of the class representing the Objective-C language. */
/* Constant data representing the OpenCL language. */
extern const struct language_data opencl_language_data =
{
- c_op_print_tab, /* expression operators for printing */
};
/* Class representing the OpenCL language. */
const struct exp_descriptor *expression_ops () const override
{ return &exp_descriptor_opencl; }
+
+ /* See language.h. */
+
+ const struct op_print *opcode_print_table () const override
+ { return c_op_print_tab; }
};
/* Single instance of the OpenCL language class. */
extern const struct language_data pascal_language_data =
{
- pascal_op_print_tab, /* expression operators for printing */
};
/* Class representing the Pascal language. */
bool range_checking_on_by_default () const override
{ return true; }
+
+ /* See language.h. */
+
+ const struct op_print *opcode_print_table () const override
+ { return pascal_op_print_tab; }
};
/* Single instance of the Pascal language class. */
extern const struct language_data rust_language_data =
{
- c_op_print_tab, /* expression operators for printing */
};
/* Class representing the Rust language. */
const struct exp_descriptor *expression_ops () const override
{ return &exp_descriptor_rust; }
+
+ /* See language.h. */
+
+ const struct op_print *opcode_print_table () const override
+ { return c_op_print_tab; }
};
/* Single instance of the Rust language class. */