From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id BCBDF385F00F for ; Wed, 16 Mar 2022 13:33:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BCBDF385F00F Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-427-y9EGu8fvMI2kOXnaZKxuFw-1; Wed, 16 Mar 2022 09:32:59 -0400 X-MC-Unique: y9EGu8fvMI2kOXnaZKxuFw-1 Received: by mail-wm1-f71.google.com with SMTP id m34-20020a05600c3b2200b0038115c73361so719680wms.5 for ; Wed, 16 Mar 2022 06:32:57 -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:in-reply-to:references:date :message-id:mime-version; bh=Tc+Mf7aawGMWS4IGKVIhl2Nf0Ft04ahfUHa3384X2iM=; b=AtgI30B2wv1/jCETh19aiVvHOzbusTqxhrkQgWmuYPkHL/yoC/kqcv72fUisTIENWz iyogFtqDmhtGbTMHYDuCuxZzPq02lfG7nb0uhEPYDSZci6tgNM9CpYVjEAG7NlYANusS lE3H9aKptLwrxqsj/E1OAyoRhFIUAR0CMmUy9TxzMkmIbWqpk1SXDfEGu3fvIjNR2W0X veX+/3f/gGjs8zRI0yxo0ryeUDaonvBRHNxXIjxNP0T286vl6TGE+K9cGyeIqISbwKBn Iz8a8j7PGKDVjOqn321UYAnXsmx5YiIXrwtjSjIgPPiPlAjLDN2/cDc9N6wkkfxZt/Iv nIGw== X-Gm-Message-State: AOAM533D67CxnUSFS9O4Ox5+5K1R2G7nvlHvwjWeIfLXp+WZqqMJUt/Q uADpqOHlhnQ6JpsKfBneGX+8+6J2hCiB1BUYxE6eLDkK8kcnEOkdEhisMPabJZEXwngpYvhMqVR v/h9HG05ORF3qWT4ymb00F3J4wc1qIdM941WB/9Hn/OjJ1uVC8IaD7Vl9DcMSZidWGQqN7wctyw == X-Received: by 2002:a7b:cd1a:0:b0:38c:720a:a123 with SMTP id f26-20020a7bcd1a000000b0038c720aa123mr1427376wmj.5.1647437576116; Wed, 16 Mar 2022 06:32:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzR9YFZ/17PQ/zfzDdwsXVr6P4APmMtyVZxPPfiYSxwQdx3DSI107CLX355CX6KfEGShmYZVw== X-Received: by 2002:a7b:cd1a:0:b0:38c:720a:a123 with SMTP id f26-20020a7bcd1a000000b0038c720aa123mr1427351wmj.5.1647437575882; Wed, 16 Mar 2022 06:32:55 -0700 (PDT) Received: from localhost (host109-154-72-186.range109-154.btcentralplus.com. [109.154.72.186]) by smtp.gmail.com with ESMTPSA id g12-20020a5d698c000000b001f1d8bb4618sm2375953wru.36.2022.03.16.06.32.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Mar 2022 06:32:55 -0700 (PDT) From: Andrew Burgess To: Tom Tromey via Gdb-patches , gdb-patches@sourceware.org Cc: Tom Tromey Subject: Re: [PATCH 3/4] Remove eval_op_concat In-Reply-To: <20220315132500.1032991-4-tromey@adacore.com> References: <20220315132500.1032991-1-tromey@adacore.com> <20220315132500.1032991-4-tromey@adacore.com> Date: Wed, 16 Mar 2022 13:32:54 +0000 Message-ID: <87v8wet43d.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, 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: Wed, 16 Mar 2022 13:33:02 -0000 Tom Tromey via Gdb-patches writes: > 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. I think this change makes sense. So LGTM. Thanks, Andrew > --- > 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