[PATCH 191/203] Remove two Ada opcodes

Tom Tromey
2021-01-01T21:49:50Z

The OP_ATR_MIN and OP_ATR_MAX constants aren't truly needed.
Internally, they are converted to BINOP_MIN and BINOP_MAX. This patch
removes them in favor of simple reuse.

gdb/ChangeLog
2021-01-01 Tom Tromey <tom@tromey.com>

* std-operator.def (OP_ATR_MIN, OP_ATR_MAX): Remove.
* ada-lang.c (ada_binop_minmax): Update.
* ada-exp.h (ada_binop_min_operation, ada_binop_max_operation):
Use BINOP_MIN and BINOP_MAX.
---
gdb/ChangeLog | 7 +++++++
gdb/ada-exp.h | 4 ++--
gdb/ada-lang.c | 3 +--
gdb/std-operator.def | 2 --
4 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/gdb/ada-exp.h b/gdb/ada-exp.h
index 7dfc64e2ec7..b215c58dfb3 100644
--- a/gdb/ada-exp.h
+++ b/gdb/ada-exp.h
@@ -195,8 +195,8 @@ using ada_binop_div_operation = binop_operation<BINOP_DIV, ada_mult_binop>;
using ada_binop_rem_operation = binop_operation<BINOP_REM, ada_mult_binop>;
using ada_binop_mod_operation = binop_operation<BINOP_MOD, ada_mult_binop>;

-using ada_binop_min_operation = binop_operation<OP_ATR_MIN, ada_binop_minmax>;
-using ada_binop_max_operation = binop_operation<OP_ATR_MAX, ada_binop_minmax>;
+using ada_binop_min_operation = binop_operation<BINOP_MIN, ada_binop_minmax>;
+using ada_binop_max_operation = binop_operation<BINOP_MAX, ada_binop_minmax>;

using ada_binop_exp_operation = binop_operation<BINOP_EXP, ada_binop_exp>;

diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index e7bfe9967e9..4331a063cb0 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -10265,8 +10265,7 @@ ada_binop_minmax (struct type *expect_type,
else
{
binop_promote (exp->language_defn, exp->gdbarch, &arg1, &arg2);
- return value_binop (arg1, arg2,
- op == OP_ATR_MIN ? BINOP_MIN : BINOP_MAX);
+ return value_binop (arg1, arg2, op);
}
}

diff --git a/gdb/std-operator.def b/gdb/std-operator.def
index 925e2b6484e..de3d9ec18a9 100644
--- a/gdb/std-operator.def
+++ b/gdb/std-operator.def
@@ -359,8 +359,6 @@ OP (OP_ATR_FIRST)
OP (OP_ATR_LAST)
OP (OP_ATR_LENGTH)
OP (OP_ATR_IMAGE)
-OP (OP_ATR_MAX)
-OP (OP_ATR_MIN)
OP (OP_ATR_MODULUS)
OP (OP_ATR_POS)
OP (OP_ATR_SIZE)
--
2.26.2