[069/203] Change value_val_atr to ada_val_atr

Message ID 20210101214723.1784144-70-tom@tromey.com
State Superseded
Headers show
Series
  • Refactor expressions
Related show

Commit Message

Tom Tromey Jan. 1, 2021, 9:45 p.m.
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-01-01  Tom Tromey  <tom@tromey.com>

	* ada-lang.c (ada_val_atr): Rename from value_val_atr.  Change
	parameters.
	(ada_evaluate_subexp): Use it.
---
 gdb/ChangeLog  |  6 ++++++
 gdb/ada-lang.c | 12 +++++-------
 2 files changed, 11 insertions(+), 7 deletions(-)

-- 
2.26.2

Patch

diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index a3164ccd709..04d203d84cd 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -194,8 +194,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);
 
@@ -8953,8 +8951,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)))
@@ -11074,10 +11075,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);