aboutsummaryrefslogtreecommitdiff
path: root/gdb/f-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:30 -0700
commit58a76c72648ce1e70bbba8320547a5c4353c48a3 (patch)
tree71d17343d39255fa0d26caa31eb6d1e27349ce1b /gdb/f-exp.h
parent2f98abe174b50cf347761345c5e2dc8859dc63b9 (diff)
downloadgdb-58a76c72648ce1e70bbba8320547a5c4353c48a3.zip
gdb-58a76c72648ce1e70bbba8320547a5c4353c48a3.tar.gz
gdb-58a76c72648ce1e70bbba8320547a5c4353c48a3.tar.bz2
Introduce classes for Fortran bound intrinsics
This adds class fortran_bound_1arg and fortran_bound_2arg, to implement the Fortran lbound and ubound intrinsics. gdb/ChangeLog 2021-03-08 Tom Tromey <tom@tromey.com> * f-lang.c (fortran_bound_1arg::evaluate) (fortran_bound_2arg::evaluate): New methods. * f-exp.h (class fortran_bound_1arg, class fortran_bound_2arg): New.
Diffstat (limited to 'gdb/f-exp.h')
-rw-r--r--gdb/f-exp.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/gdb/f-exp.h b/gdb/f-exp.h
index b569c33..e1d351a 100644
--- a/gdb/f-exp.h
+++ b/gdb/f-exp.h
@@ -159,6 +159,38 @@ private:
enum noside noside);
};
+/* Single-argument form of Fortran ubound/lbound intrinsics. */
+class fortran_bound_1arg
+ : public tuple_holding_operation<exp_opcode, 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); }
+};
+
+/* Two-argument form of Fortran ubound/lbound intrinsics. */
+class fortran_bound_2arg
+ : public tuple_holding_operation<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 /* FORTRAN_EXP_H */