From 224d6424bab021a0a8e16f07d52f8af5e153e91f Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Mon, 8 Mar 2021 07:27:57 -0700 Subject: Introduce subscript_operation This adds class subscript_operation, which implements BINOP_SUBSCRIPT. gdb/ChangeLog 2021-03-08 Tom Tromey * expop.h (class subscript_operation): New. * eval.c (eval_op_subscript): No longer static. --- gdb/expop.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'gdb/expop.h') diff --git a/gdb/expop.h b/gdb/expop.h index 4624c2f..5c3b0af 100644 --- a/gdb/expop.h +++ b/gdb/expop.h @@ -100,6 +100,11 @@ extern struct value *eval_op_binary (struct type *expect_type, struct expression *exp, enum noside noside, enum exp_opcode op, struct value *arg1, struct value *arg2); +extern struct value *eval_op_subscript (struct type *expect_type, + struct expression *exp, + enum noside noside, enum exp_opcode op, + struct value *arg1, + struct value *arg2); namespace expr { @@ -1112,6 +1117,17 @@ using bitwise_ior_operation using bitwise_xor_operation = usual_ax_binop_operation; +class subscript_operation + : public usual_ax_binop_operation +{ +public: + using usual_ax_binop_operation::usual_ax_binop_operation; + + value *evaluate_for_sizeof (struct expression *exp, + enum noside noside) override; +}; + } /* namespace expr */ #endif /* EXPOP_H */ -- cgit v1.1