From: Tom Tromey Date: Mon, 8 Sep 2025 16:21:18 +0000 (-0600) Subject: Remove ada_unop_in_range X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cfd104b66c917222d516747a38ad98d4a8520b76;p=thirdparty%2Fbinutils-gdb.git 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 --- diff --git a/gdb/ada-exp.h b/gdb/ada-exp.h index 8c9bfe8abb2..87e2aa1e1d4 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 b62f545e1e3..4ee1a2ad51f 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 *