diff options
author | Tom Tromey <tromey@adacore.com> | 2025-09-08 10:25:13 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2025-09-09 09:28:22 -0600 |
commit | 118245e166cdf7fb7e442fa88ca677dae2d7da82 (patch) | |
tree | 79c665bf76200bcecc63edbdcdf4062659fe2079 /gdb | |
parent | b1618ec21a5659ebee144cabf35de31048fad309 (diff) | |
download | binutils-118245e166cdf7fb7e442fa88ca677dae2d7da82.zip binutils-118245e166cdf7fb7e442fa88ca677dae2d7da82.tar.gz binutils-118245e166cdf7fb7e442fa88ca677dae2d7da82.tar.bz2 |
Remove ada_ternop_slice
ada_ternop_slice can be merged with its sole caller.
Approved-By: Simon Marchi <simon.marchi@efficios.com>
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ada-exp.h | 13 | ||||
-rw-r--r-- | gdb/ada-lang.c | 19 |
2 files changed, 13 insertions, 19 deletions
diff --git a/gdb/ada-exp.h b/gdb/ada-exp.h index d797cda..6703a54 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_ternop_slice (struct expression *exp, - enum noside noside, - struct value *array, - struct value *low_bound_val, - struct value *high_bound_val); extern struct value *ada_binop_in_bounds (struct expression *exp, enum noside noside, struct value *arg1, @@ -287,13 +282,7 @@ public: value *evaluate (struct type *expect_type, struct expression *exp, - enum noside noside) override - { - value *array = std::get<0> (m_storage)->evaluate (nullptr, exp, noside); - value *low = std::get<1> (m_storage)->evaluate (nullptr, exp, noside); - value *high = std::get<2> (m_storage)->evaluate (nullptr, exp, noside); - return ada_ternop_slice (exp, noside, array, low, high); - } + enum noside noside) override; enum exp_opcode opcode () const override { return TERNOP_SLICE; } diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 253b85e..323abee 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -10198,16 +10198,19 @@ ada_binop_equal_operation::evaluate (struct type *expect_type, return value_from_longest (type, tem); } -} /* namespace expr */ - -/* A helper function for TERNOP_SLICE. */ +/* Implement TERNOP_SLICE. */ value * -ada_ternop_slice (struct expression *exp, - enum noside noside, - struct value *array, struct value *low_bound_val, - struct value *high_bound_val) +ada_ternop_slice_operation::evaluate (struct type *expect_type, + struct expression *exp, + enum noside noside) { + value *array = std::get<0> (m_storage)->evaluate (nullptr, exp, noside); + value *low_bound_val + = std::get<1> (m_storage)->evaluate (nullptr, exp, noside); + value *high_bound_val + = std::get<2> (m_storage)->evaluate (nullptr, exp, noside); + LONGEST low_bound; LONGEST high_bound; @@ -10281,6 +10284,8 @@ ada_ternop_slice (struct expression *exp, longest_to_int (high_bound)); } +} /* namespace expr */ + /* A helper function for BINOP_IN_BOUNDS. */ value * |