aboutsummaryrefslogtreecommitdiff
path: root/gdb/expop.h
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2021-03-08 07:27:57 -0700
committerTom Tromey <tom@tromey.com>2021-03-08 07:28:19 -0700
commit224d6424bab021a0a8e16f07d52f8af5e153e91f (patch)
tree8f2d47a925f9b24ea251bde9fb2801f678065ee0 /gdb/expop.h
parent373907ffb2db9232af14d2a7e4433f41cc1fc56c (diff)
downloadgdb-224d6424bab021a0a8e16f07d52f8af5e153e91f.zip
gdb-224d6424bab021a0a8e16f07d52f8af5e153e91f.tar.gz
gdb-224d6424bab021a0a8e16f07d52f8af5e153e91f.tar.bz2
Introduce subscript_operation
This adds class subscript_operation, which implements BINOP_SUBSCRIPT. gdb/ChangeLog 2021-03-08 Tom Tromey <tom@tromey.com> * expop.h (class subscript_operation): New. * eval.c (eval_op_subscript): No longer static.
Diffstat (limited to 'gdb/expop.h')
-rw-r--r--gdb/expop.h16
1 files changed, 16 insertions, 0 deletions
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<BINOP_BITWISE_XOR, eval_op_binary>;
+class subscript_operation
+ : public usual_ax_binop_operation<BINOP_SUBSCRIPT, eval_op_subscript>
+{
+public:
+ using usual_ax_binop_operation<BINOP_SUBSCRIPT,
+ eval_op_subscript>::usual_ax_binop_operation;
+
+ value *evaluate_for_sizeof (struct expression *exp,
+ enum noside noside) override;
+};
+
} /* namespace expr */
#endif /* EXPOP_H */