diff options
author | Tom Tromey <tom@tromey.com> | 2021-03-08 07:27:57 -0700 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2021-03-08 07:28:13 -0700 |
commit | 3848abd6e1d50d7b3da96a018ac39e0a5db2ac6b (patch) | |
tree | 693f0ce2a2a118ae3c4c6d5731af0f023f566ad2 | |
parent | 38dc70cfeea6bf0cc97ac08dc61878726cb60204 (diff) | |
download | binutils-3848abd6e1d50d7b3da96a018ac39e0a5db2ac6b.zip binutils-3848abd6e1d50d7b3da96a018ac39e0a5db2ac6b.tar.gz binutils-3848abd6e1d50d7b3da96a018ac39e0a5db2ac6b.tar.bz2 |
Change value_val_atr to ada_val_atr
This renames value_val_atr to ada_val_atr, changing its parameters to
more closely mirror other expression helpers. The
EVAL_AVOID_SIDE_EFFECTS case is moved into this function as well.
gdb/ChangeLog
2021-03-08 Tom Tromey <tom@tromey.com>
* ada-lang.c (ada_val_atr): Rename from value_val_atr. Change
parameters.
(ada_evaluate_subexp): Use it.
-rw-r--r-- | gdb/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/ada-lang.c | 12 |
2 files changed, 11 insertions, 7 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 6863877..924497e 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,11 @@ 2021-03-08 Tom Tromey <tom@tromey.com> + * ada-lang.c (ada_val_atr): Rename from value_val_atr. Change + parameters. + (ada_evaluate_subexp): Use it. + +2021-03-08 Tom Tromey <tom@tromey.com> + * ada-lang.c (ada_binop_minmax): New function. (ada_evaluate_subexp): Use it. diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index aa2912f..910eec8 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -192,8 +192,6 @@ static struct value *value_pos_atr (struct type *, struct value *); static struct value *val_atr (struct type *, LONGEST); -static struct value *value_val_atr (struct type *, struct value *); - static struct symbol *standard_lookup (const char *, const struct block *, domain_enum); @@ -8845,8 +8843,11 @@ val_atr (struct type *type, LONGEST val) } static struct value * -value_val_atr (struct type *type, struct value *arg) +ada_val_atr (enum noside noside, struct type *type, struct value *arg) { + if (noside == EVAL_AVOID_SIDE_EFFECTS) + return value_zero (type, not_lval); + if (!discrete_type_p (type)) error (_("'VAL only defined on discrete types")); if (!integer_type_p (value_type (arg))) @@ -10918,10 +10919,7 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp, type = exp->elts[pc + 2].type; if (noside == EVAL_SKIP) goto nosideret; - else if (noside == EVAL_AVOID_SIDE_EFFECTS) - return value_zero (type, not_lval); - else - return value_val_atr (type, arg1); + return ada_val_atr (noside, type, arg1); case BINOP_EXP: arg1 = evaluate_subexp (nullptr, exp, pos, noside); |