From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io1-xd33.google.com (mail-io1-xd33.google.com [IPv6:2607:f8b0:4864:20::d33]) by sourceware.org (Postfix) with ESMTPS id 53CB23858403 for ; Tue, 15 Mar 2022 13:25:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 53CB23858403 Received: by mail-io1-xd33.google.com with SMTP id d62so22067952iog.13 for ; Tue, 15 Mar 2022 06:25:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=rcFYNN+l573Sa3axw4ku4x/+cY51vRm9xwrfNLKNzQQ=; b=5vS8IU6Z5vLATaFbDsk6QNEhVxg72StpJqSqgoWRgpTIwcnT5iKb57LJ5x5W6wDimp 9pLtex5p+/rWCa2XJB5SokppMIU6Mzn7+8dBznSC0a/LEQGnGh20htkjLrtAtfHd5aJT OoZ1/16SnQNwIMGx8NjO9NPsZBXHSunbkMvkapYvLTiFQL/DzGNEFG6EazHLfTh1/ffN HzUBlgUeRcMp0jAl/8+HvT0Kaz+0Ao74l/b/4vkOv/78qp8GFnbsUuqCPhg0NN3gh3RB M+E42qPqBL/nxzASCF9H3e43MQdtWu6Ib1KAR+CxzFKvv1Zlg1L9Z/r26KfIA6lRkmUb WVjg== X-Gm-Message-State: AOAM533tJZ1hjLHd8Vh5wfE+kGtuJlGaIeFIqd22g8BTJs/JB9F84jGg PujSS+R/PmEeM7t7cAO9FX6WdQ5UMG3T+g== X-Google-Smtp-Source: ABdhPJynjTL74mROjnm+yZJwVG66yXkM+YWEhpJFIiKwIyV8pk3Vs0Jnl8On+z6BJ1A+VC0xhUe07A== X-Received: by 2002:a5e:d809:0:b0:645:eb2b:d173 with SMTP id l9-20020a5ed809000000b00645eb2bd173mr21591316iok.54.1647350703669; Tue, 15 Mar 2022 06:25:03 -0700 (PDT) Received: from murgatroyd.Home (71-211-175-224.hlrn.qwest.net. [71.211.175.224]) by smtp.gmail.com with ESMTPSA id l14-20020a05660227ce00b00645ebb013c1sm10711430ios.45.2022.03.15.06.25.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Mar 2022 06:25:03 -0700 (PDT) From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 3/4] Remove eval_op_concat Date: Tue, 15 Mar 2022 07:24:59 -0600 Message-Id: <20220315132500.1032991-4-tromey@adacore.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220315132500.1032991-1-tromey@adacore.com> References: <20220315132500.1032991-1-tromey@adacore.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2022 13:25:05 -0000 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. --- 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, struct expression *exp, lookup_child_selector (exp->gdbarch, sel)); } -/* 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. */ 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 @@ class concat_operation = std::get<0> (m_storage)->evaluate_with_coercion (exp, noside); value *rhs = 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); } 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 == BINOP_ASSIGN || op == BINOP_CONCAT) + if (op == BINOP_ASSIGN) return 0; type1 = check_typedef (type1); -- 2.34.1