diff options
author | Tom Tromey <tromey@adacore.com> | 2025-09-08 10:27:40 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2025-09-09 09:28:40 -0600 |
commit | ea1bd34d53cf21f5f6632c9e9fbc48b292d2f826 (patch) | |
tree | d27e4000b14688f68253344ebebb0d851a64f8d8 | |
parent | 118245e166cdf7fb7e442fa88ca677dae2d7da82 (diff) | |
download | binutils-ea1bd34d53cf21f5f6632c9e9fbc48b292d2f826.zip binutils-ea1bd34d53cf21f5f6632c9e9fbc48b292d2f826.tar.gz binutils-ea1bd34d53cf21f5f6632c9e9fbc48b292d2f826.tar.bz2 |
Remove ada_binop_in_bounds
ada_binop_in_bounds can be merged with its sole caller.
Approved-By: Simon Marchi <simon.marchi@efficios.com>
-rw-r--r-- | gdb/ada-exp.h | 13 | ||||
-rw-r--r-- | gdb/ada-lang.c | 15 |
2 files changed, 11 insertions, 17 deletions
diff --git a/gdb/ada-exp.h b/gdb/ada-exp.h index 6703a54..7354d65 100644 --- a/gdb/ada-exp.h +++ b/gdb/ada-exp.h @@ -38,11 +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_binop_in_bounds (struct expression *exp, - enum noside noside, - struct value *arg1, - struct value *arg2, - int n); extern struct value *ada_binop_minmax (struct type *expect_type, struct expression *exp, enum noside noside, enum exp_opcode op, @@ -304,13 +299,7 @@ public: value *evaluate (struct type *expect_type, struct expression *exp, - enum noside noside) override - { - value *arg1 = std::get<0> (m_storage)->evaluate (nullptr, exp, noside); - value *arg2 = std::get<1> (m_storage)->evaluate (nullptr, exp, noside); - return ada_binop_in_bounds (exp, noside, arg1, arg2, - std::get<2> (m_storage)); - } + enum noside noside) override; enum exp_opcode opcode () const override { return BINOP_IN_BOUNDS; } diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 323abee..b7039fd 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -10284,14 +10284,17 @@ ada_ternop_slice_operation::evaluate (struct type *expect_type, longest_to_int (high_bound)); } -} /* namespace expr */ - -/* A helper function for BINOP_IN_BOUNDS. */ +/* Implement BINOP_IN_BOUNDS. */ value * -ada_binop_in_bounds (struct expression *exp, enum noside noside, - struct value *arg1, struct value *arg2, int n) +ada_binop_in_bounds_operation::evaluate (struct type *expect_type, + struct expression *exp, + enum noside noside) { + value *arg1 = std::get<0> (m_storage)->evaluate (nullptr, exp, noside); + value *arg2 = std::get<1> (m_storage)->evaluate (nullptr, exp, noside); + int n = std::get<2> (m_storage); + if (noside == EVAL_AVOID_SIDE_EFFECTS) { struct type *type = language_bool_type (exp->language_defn, @@ -10316,6 +10319,8 @@ ada_binop_in_bounds (struct expression *exp, enum noside noside, || value_equal (arg2, arg1))); } +} /* namespace expr */ + /* A helper function for some attribute operations. */ static value * |