diff options
author | Tom Tromey <tom@tromey.com> | 2021-03-08 07:27:57 -0700 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2021-03-08 07:28:20 -0700 |
commit | 9307d17b7a97bd49baf0d877785c43cf203b7cee (patch) | |
tree | 2a3cc7312867dfa2d2c1565739a3bf77b2be9e4c /gdb/eval.c | |
parent | ae64ba58b3bc5a9a023974f37515aee9862548fd (diff) | |
download | gdb-9307d17b7a97bd49baf0d877785c43cf203b7cee.zip gdb-9307d17b7a97bd49baf0d877785c43cf203b7cee.tar.gz gdb-9307d17b7a97bd49baf0d877785c43cf203b7cee.tar.bz2 |
Implement some unary operations
This introduces a couple of new template classes and then uses them to
implement some simple unary operations.
gdb/ChangeLog
2021-03-08 Tom Tromey <tom@tromey.com>
* expop.h (unary_ftype): New typedef.
(unop_operation, usual_ax_binop_operation): New templates.
(unary_plus_operation, unary_neg_operation)
(unary_complement_operation, unary_logical_not_operation): New
typedefs.
* eval.c (eval_op_plus, eval_op_neg, eval_op_complement)
(eval_op_lognot): No longer static.
* ax-gdb.c (gen_expr_unop): New function.
Diffstat (limited to 'gdb/eval.c')
-rw-r--r-- | gdb/eval.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -1754,7 +1754,7 @@ eval_op_repeat (struct type *expect_type, struct expression *exp, /* A helper function for UNOP_PLUS. */ -static struct value * +struct value * eval_op_plus (struct type *expect_type, struct expression *exp, enum noside noside, enum exp_opcode op, struct value *arg1) @@ -1772,7 +1772,7 @@ eval_op_plus (struct type *expect_type, struct expression *exp, /* A helper function for UNOP_NEG. */ -static struct value * +struct value * eval_op_neg (struct type *expect_type, struct expression *exp, enum noside noside, enum exp_opcode op, struct value *arg1) @@ -1790,7 +1790,7 @@ eval_op_neg (struct type *expect_type, struct expression *exp, /* A helper function for UNOP_COMPLEMENT. */ -static struct value * +struct value * eval_op_complement (struct type *expect_type, struct expression *exp, enum noside noside, enum exp_opcode op, struct value *arg1) @@ -1808,7 +1808,7 @@ eval_op_complement (struct type *expect_type, struct expression *exp, /* A helper function for UNOP_LOGICAL_NOT. */ -static struct value * +struct value * eval_op_lognot (struct type *expect_type, struct expression *exp, enum noside noside, enum exp_opcode op, struct value *arg1) |