[v3,194/206] Remove two Ada opcodes

Message ID 20210220201609.838264-195-tom@tromey.com
State New
Headers show
Series
  • Refactor expressions
Related show

Commit Message

Tom Tromey Feb. 20, 2021, 8:15 p.m.
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-02-20  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(-)

-- 
2.26.2

Patch

diff --git a/gdb/ada-exp.h b/gdb/ada-exp.h
index 1ae0cbc3546..0b6f1f22e79 100644
--- a/gdb/ada-exp.h
+++ b/gdb/ada-exp.h
@@ -213,8 +213,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 ea0f91845c3..36d37b6aa85 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -10264,8 +10264,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 f3533aa3908..db24fc9c172 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)