diff options
author | Tom Tromey <tom@tromey.com> | 2020-11-30 01:37:10 -0700 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2020-11-30 01:37:10 -0700 |
commit | 88b91969e1ae5d23f81b86ae6cd3c85b284c6294 (patch) | |
tree | 33a677f9adac503851cc9e659d7e2b896e11dddd /gdb/parser-defs.h | |
parent | 1cd49c43f340e4de62922356ed859ee806e52f6f (diff) | |
download | gdb-88b91969e1ae5d23f81b86ae6cd3c85b284c6294.zip gdb-88b91969e1ae5d23f81b86ae6cd3c85b284c6294.tar.gz gdb-88b91969e1ae5d23f81b86ae6cd3c85b284c6294.tar.bz2 |
Remove per-language op_name functions
enum exp_opcode is created from all the .def files, but then each
language is required to implement its own op_name function to turn an
enum value to a string. This seemed over-complicated to me, and this
patch removes the per-language functions in favor of simply using the
.def names for all languages. Note that op_name is only used for
dumping expressions, which is a maintainer/debug feature.
Furthermore, I don't think there was any case where the .def name and
the string name differed.
gdb/ChangeLog
2020-11-30 Tom Tromey <tom@tromey.com>
* rust-lang.c (rust_op_name): Remove.
(exp_descriptor_rust): Update.
* parser-defs.h (op_name_standard): Don't declare.
(struct exp_descriptor) <op_name>: Remove.
* parse.c (exp_descriptor_standard): Update.
* opencl-lang.c (exp_descriptor_opencl): Update.
* m2-lang.c (m2_language::exp_descriptor_modula2): Update.
* f-lang.c (op_name_f): Remove.
(f_language::exp_descriptor_tab): Update.
* expression.h (op_name): Update.
* expprint.c (op_name): Rewrite.
(op_name_standard): Remove.
(dump_raw_expression, dump_subexp): Update.
* c-lang.c (exp_descriptor_c): Update.
* ax-gdb.c (gen_expr): Update.
* ada-lang.c (ada_op_name): Remove.
(ada_exp_descriptor): Update.
Diffstat (limited to 'gdb/parser-defs.h')
-rw-r--r-- | gdb/parser-defs.h | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/gdb/parser-defs.h b/gdb/parser-defs.h index bc6fc2f..1721605 100644 --- a/gdb/parser-defs.h +++ b/gdb/parser-defs.h @@ -355,8 +355,6 @@ extern int operator_check_standard (struct expression *exp, int pos, (struct objfile *objfile, void *data), void *data); -extern const char *op_name_standard (enum exp_opcode); - extern bool parse_float (const char *p, int len, const struct type *type, gdb_byte *data); @@ -417,12 +415,6 @@ struct exp_descriptor void *data), void *data); - /* Name of this operator for dumping purposes. - The returned value should never be NULL, even if EXP_OPCODE is - an unknown opcode (a string containing an image of the numeric - value of the opcode can be returned, for instance). */ - const char *(*op_name) (enum exp_opcode); - /* Dump the rest of this (prefix) expression after the operator itself has been printed. See dump_subexp_body_standard in (expprint.c). */ |