forked from Imagelibrary/binutils-gdb
gdb: Convert language_data::la_op_print_tab to a method
Convert language_data::la_op_print_tab member variable to a virtual method language_defn::opcode_print_table. I changed the name in order to make it clearer (I hope) what the method does. There should be no user visible changes after this commit. gdb/ChangeLog: * 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.
This commit is contained in:
24
gdb/c-lang.c
24
gdb/c-lang.c
@@ -875,7 +875,6 @@ const struct exp_descriptor exp_descriptor_c =
|
||||
|
||||
extern const struct language_data c_language_data =
|
||||
{
|
||||
c_op_print_tab, /* expression operators for printing */
|
||||
};
|
||||
|
||||
/* Class representing the C language. */
|
||||
@@ -951,6 +950,11 @@ public:
|
||||
|
||||
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. */
|
||||
@@ -989,7 +993,6 @@ enum cplus_primitive_types {
|
||||
|
||||
extern const struct language_data cplus_language_data =
|
||||
{
|
||||
c_op_print_tab, /* expression operators for printing */
|
||||
};
|
||||
|
||||
/* A class for the C++ language. */
|
||||
@@ -1187,6 +1190,11 @@ public:
|
||||
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. */
|
||||
@@ -1206,7 +1214,6 @@ static cplus_language cplus_language_defn;
|
||||
|
||||
extern const struct language_data asm_language_data =
|
||||
{
|
||||
c_op_print_tab, /* expression operators for printing */
|
||||
};
|
||||
|
||||
/* A class for the ASM language. */
|
||||
@@ -1269,6 +1276,11 @@ public:
|
||||
|
||||
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. */
|
||||
@@ -1281,7 +1293,6 @@ static asm_language asm_language_defn;
|
||||
|
||||
extern const struct language_data minimal_language_data =
|
||||
{
|
||||
c_op_print_tab, /* expression operators for printing */
|
||||
};
|
||||
|
||||
/* A class for the minimal language. */
|
||||
@@ -1333,6 +1344,11 @@ public:
|
||||
|
||||
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. */
|
||||
|
||||
Reference in New Issue
Block a user