aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2025-09-08 10:21:18 -0600
committerTom Tromey <tromey@adacore.com>2025-09-09 09:27:04 -0600
commitcfd104b66c917222d516747a38ad98d4a8520b76 (patch)
tree87fccfdc9a16154f9a26a1d4403ce150b7390a90 /gdb
parente8f2fcd0a36b2ba7410ee0a38c5b4066f88ba7c7 (diff)
downloadbinutils-cfd104b66c917222d516747a38ad98d4a8520b76.zip
binutils-cfd104b66c917222d516747a38ad98d4a8520b76.tar.gz
binutils-cfd104b66c917222d516747a38ad98d4a8520b76.tar.bz2
Remove ada_unop_in_range
ada_unop_in_range can be merged with its sole caller. This change points out that one of the arguments was not needed. Approved-By: Simon Marchi <simon.marchi@efficios.com>
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ada-exp.h11
-rw-r--r--gdb/ada-lang.c17
2 files changed, 13 insertions, 15 deletions
diff --git a/gdb/ada-exp.h b/gdb/ada-exp.h
index 8c9bfe8..87e2aa1 100644
--- a/gdb/ada-exp.h
+++ b/gdb/ada-exp.h
@@ -34,10 +34,6 @@ extern struct value *ada_abs (struct type *expect_type,
struct expression *exp,
enum noside noside, enum exp_opcode op,
struct value *arg1);
-extern struct value *ada_unop_in_range (struct type *expect_type,
- struct expression *exp,
- enum noside noside, enum exp_opcode op,
- struct value *arg1, struct type *type);
extern struct value *ada_mult_binop (struct type *expect_type,
struct expression *exp,
enum noside noside, enum exp_opcode op,
@@ -224,12 +220,7 @@ public:
value *evaluate (struct type *expect_type,
struct expression *exp,
- enum noside noside) override
- {
- value *val = std::get<0> (m_storage)->evaluate (nullptr, exp, noside);
- return ada_unop_in_range (expect_type, exp, noside, UNOP_IN_RANGE,
- val, std::get<1> (m_storage));
- }
+ enum noside noside) override;
enum exp_opcode opcode () const override
{ return UNOP_IN_RANGE; }
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index b62f545..4ee1a2a 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -10041,14 +10041,19 @@ ada_unop_neg (struct type *expect_type,
return value_neg (arg1);
}
-/* A helper function for UNOP_IN_RANGE. */
+namespace expr
+{
+
+/* Implement UNOP_IN_RANGE. */
value *
-ada_unop_in_range (struct type *expect_type,
- struct expression *exp,
- enum noside noside, enum exp_opcode op,
- struct value *arg1, struct type *type)
+ada_unop_range_operation::evaluate (struct type *expect_type,
+ struct expression *exp,
+ enum noside noside)
{
+ value *arg1 = std::get<0> (m_storage)->evaluate (nullptr, exp, noside);
+ struct type *type = std::get<1> (m_storage);
+
struct value *arg2, *arg3;
switch (type->code ())
{
@@ -10075,6 +10080,8 @@ ada_unop_in_range (struct type *expect_type,
}
}
+} /* namespace expr */
+
/* A helper function for OP_ATR_TAG. */
value *