summaryrefslogtreecommitdiff
path: root/gdb/ada-exp.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:32 -0700
commit73796c73263da16cedbefd5a43ab7e1887836115 (patch)
treec6d74fd8ea50be3c5f5643c26dc518d802c2f511 /gdb/ada-exp.h
parentcd9a314824b2b87207a8ba7a8003639989d2406b (diff)
downloadbinutils-gdb-73796c73263da16cedbefd5a43ab7e1887836115.tar.gz
Introduce ada_binop_addsub_operation
This adds class ada_binop_addsub_operation, which implements the Ada + and - operators. gdb/ChangeLog 2021-03-08 Tom Tromey <tom@tromey.com> * ada-lang.c (ada_binop_addsub_operation::evaluate): New method. * ada-exp.h (class ada_binop_addsub_operation): New.
Diffstat (limited to 'gdb/ada-exp.h')
-rw-r--r--gdb/ada-exp.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/gdb/ada-exp.h b/gdb/ada-exp.h
index de69210bd2a..ad69d939489 100644
--- a/gdb/ada-exp.h
+++ b/gdb/ada-exp.h
@@ -134,6 +134,22 @@ public:
{ return UNOP_IN_RANGE; }
};
+/* The Ada + and - operators. */
+class ada_binop_addsub_operation
+ : public tuple_holding_operation<enum exp_opcode, operation_up, operation_up>
+{
+public:
+
+ using tuple_holding_operation::tuple_holding_operation;
+
+ value *evaluate (struct type *expect_type,
+ struct expression *exp,
+ enum noside noside) override;
+
+ enum exp_opcode opcode () const override
+ { return std::get<0> (m_storage); }
+};
+
} /* namespace expr */
#endif /* ADA_EXP_H */