From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2126) id 05D39385DC02; Wed, 16 Mar 2022 15:44:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 05D39385DC02 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom Tromey To: gdb-cvs@sourceware.org Subject: [binutils-gdb] Remove eval_op_concat X-Act-Checkin: binutils-gdb X-Git-Author: Tom Tromey X-Git-Refname: refs/heads/master X-Git-Oldrev: fc18a21b65a7a0fc05d5e41118e072d253aeca0a X-Git-Newrev: a73c128df6e149c36940240f2b2198f9732ab6c7 Message-Id: <20220316154458.05D39385DC02@sourceware.org> Date: Wed, 16 Mar 2022 15:44:58 +0000 (GMT) X-BeenThere: gdb-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2022 15:44:58 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Da73c128df6e1= 49c36940240f2b2198f9732ab6c7 commit a73c128df6e149c36940240f2b2198f9732ab6c7 Author: Tom Tromey Date: Wed Mar 9 14:35:10 2022 -0700 Remove eval_op_concat =20 eval_op_concat has code to search for an operator overload of BINOP_CONCAT. However, the operator overloading code is specific to C++, which does not have this operator. And, binop_types_user_defined_p rejects this case right at the start, and value_x_binop does not handle this case. I think this code has been dead for a very long time. This patch removes it and hoists the remaining call into concatenation::evaluate, removing eval_op_concat entirely. Diff: --- gdb/eval.c | 12 ------------ gdb/expop.h | 6 +----- gdb/valarith.c | 2 +- 3 files changed, 2 insertions(+), 18 deletions(-) diff --git a/gdb/eval.c b/gdb/eval.c index b7b8915fa89..266a4f7699f 100644 --- a/gdb/eval.c +++ b/gdb/eval.c @@ -1106,18 +1106,6 @@ eval_op_objc_selector (struct type *expect_type, str= uct expression *exp, lookup_child_selector (exp->gdbarch, sel)); } =20 -/* Helper function that implements the body of BINOP_CONCAT. */ - -struct value * -eval_op_concat (struct type *expect_type, struct expression *exp, - enum noside noside, struct value *arg1, struct value *arg2) -{ - if (binop_user_defined_p (BINOP_CONCAT, arg1, arg2)) - return value_x_binop (arg1, arg2, BINOP_CONCAT, OP_NULL, noside); - else - return value_concat (arg1, arg2); -} - /* A helper function for TERNOP_SLICE. */ =20 struct value * diff --git a/gdb/expop.h b/gdb/expop.h index 1592568a857..d903ab0bb7e 100644 --- a/gdb/expop.h +++ b/gdb/expop.h @@ -83,10 +83,6 @@ extern struct value *eval_op_member (struct type *expect= _type, struct expression *exp, enum noside noside, struct value *arg1, struct value *arg2); -extern struct value *eval_op_concat (struct type *expect_type, - struct expression *exp, - enum noside noside, - struct value *arg1, struct value *arg2); extern struct value *eval_op_add (struct type *expect_type, struct expression *exp, enum noside noside, @@ -1158,7 +1154,7 @@ public: =3D std::get<0> (m_storage)->evaluate_with_coercion (exp, noside); value *rhs =3D std::get<1> (m_storage)->evaluate_with_coercion (exp, noside); - return eval_op_concat (expect_type, exp, noside, lhs, rhs); + return value_concat (lhs, rhs); } =20 enum exp_opcode opcode () const override diff --git a/gdb/valarith.c b/gdb/valarith.c index e13db10ab55..791c1cd9a06 100644 --- a/gdb/valarith.c +++ b/gdb/valarith.c @@ -252,7 +252,7 @@ int binop_types_user_defined_p (enum exp_opcode op, struct type *type1, struct type *type2) { - if (op =3D=3D BINOP_ASSIGN || op =3D=3D BINOP_CONCAT) + if (op =3D=3D BINOP_ASSIGN) return 0; =20 type1 =3D check_typedef (type1);