From: Tom Tromey Date: Mon, 8 Sep 2025 16:23:15 +0000 (-0600) Subject: Remove ada_equal_binop X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b1618ec21a5659ebee144cabf35de31048fad309;p=thirdparty%2Fbinutils-gdb.git Remove ada_equal_binop ada_equal_binop can be merged with its sole caller. Approved-By: Simon Marchi --- diff --git a/gdb/ada-exp.h b/gdb/ada-exp.h index 87e2aa1e1d4..d797cdad750 100644 --- a/gdb/ada-exp.h +++ b/gdb/ada-exp.h @@ -38,10 +38,6 @@ extern struct value *ada_mult_binop (struct type *expect_type, struct expression *exp, enum noside noside, enum exp_opcode op, struct value *arg1, struct value *arg2); -extern struct value *ada_equal_binop (struct type *expect_type, - struct expression *exp, - enum noside noside, enum exp_opcode op, - struct value *arg1, struct value *arg2); extern struct value *ada_ternop_slice (struct expression *exp, enum noside noside, struct value *array, @@ -262,14 +258,7 @@ public: value *evaluate (struct type *expect_type, struct expression *exp, - enum noside noside) override - { - value *arg1 = std::get<1> (m_storage)->evaluate (nullptr, exp, noside); - value *arg2 = std::get<2> (m_storage)->evaluate (arg1->type (), - exp, noside); - return ada_equal_binop (expect_type, exp, noside, std::get<0> (m_storage), - arg1, arg2); - } + enum noside noside) override; void do_generate_ax (struct expression *exp, struct agent_expr *ax, diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 4ee1a2ad51f..253b85ed135 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -10169,14 +10169,21 @@ ada_mult_binop (struct type *expect_type, } } -/* A helper function for BINOP_EQUAL and BINOP_NOTEQUAL. */ +namespace expr +{ + +/* Implement BINOP_EQUAL and BINOP_NOTEQUAL. */ value * -ada_equal_binop (struct type *expect_type, - struct expression *exp, - enum noside noside, enum exp_opcode op, - struct value *arg1, struct value *arg2) +ada_binop_equal_operation::evaluate (struct type *expect_type, + struct expression *exp, + enum noside noside) { + enum exp_opcode op = std::get<0> (m_storage); + value *arg1 = std::get<1> (m_storage)->evaluate (nullptr, exp, noside); + value *arg2 = std::get<2> (m_storage)->evaluate (arg1->type (), + exp, noside); + int tem; if (noside == EVAL_AVOID_SIDE_EFFECTS) tem = 0; @@ -10191,6 +10198,8 @@ ada_equal_binop (struct type *expect_type, return value_from_longest (type, tem); } +} /* namespace expr */ + /* A helper function for TERNOP_SLICE. */ value *