From a94323b60793e11ca1fc449e44b57dcff76affd8 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Mon, 8 Mar 2021 07:27:57 -0700 Subject: Introduce add_operation This adds class add_operation, which implements BINOP_ADD. gdb/ChangeLog 2021-03-08 Tom Tromey * expop.h (class add_operation): New. * eval.c (eval_op_add): No longer static. Remove "op" parameter. (evaluate_subexp_standard): Update. --- gdb/eval.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'gdb/eval.c') diff --git a/gdb/eval.c b/gdb/eval.c index b78fa3b..cba5bcc 100644 --- a/gdb/eval.c +++ b/gdb/eval.c @@ -1459,15 +1459,15 @@ eval_op_member (struct type *expect_type, struct expression *exp, /* A helper function for BINOP_ADD. */ -static struct value * +struct value * eval_op_add (struct type *expect_type, struct expression *exp, - enum noside noside, enum exp_opcode op, + enum noside noside, struct value *arg1, struct value *arg2) { if (noside == EVAL_SKIP) return eval_skip_value (exp); - if (binop_user_defined_p (op, arg1, arg2)) - return value_x_binop (arg1, arg2, op, OP_NULL, noside); + if (binop_user_defined_p (BINOP_ADD, arg1, arg2)) + return value_x_binop (arg1, arg2, BINOP_ADD, OP_NULL, noside); else if (ptrmath_type_p (exp->language_defn, value_type (arg1)) && is_integral_or_integral_reference (value_type (arg2))) return value_ptradd (arg1, value_as_long (arg2)); @@ -2822,7 +2822,7 @@ evaluate_subexp_standard (struct type *expect_type, case BINOP_ADD: arg1 = evaluate_subexp_with_coercion (exp, pos, noside); arg2 = evaluate_subexp_with_coercion (exp, pos, noside); - return eval_op_add (expect_type, exp, noside, op, arg1, arg2); + return eval_op_add (expect_type, exp, noside, arg1, arg2); case BINOP_SUB: arg1 = evaluate_subexp_with_coercion (exp, pos, noside); -- cgit v1.1