From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2610:1c1:1:606c::19:2]) by sourceware.org (Postfix) with ESMTPS id 1D2993858D28 for ; Mon, 28 Aug 2023 21:12:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1D2993858D28 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=FreeBSD.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits)) (Client CN "mx1.freebsd.org", Issuer "R3" (verified OK)) by mx2.freebsd.org (Postfix) with ESMTPS id 4RZNY21GG9z3XHN; Mon, 28 Aug 2023 21:12:06 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RZNY20F0fz4Ltr; Mon, 28 Aug 2023 21:12:06 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693257126; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VySQS5O2VDONJJ+MtjXu7UrwWSBfX0rgrTIn5fOZl8I=; b=gmCXidI06HnWLZYH3O955rcMn8vBeexLA9mG2ROEzEpFlbl59yycP+1mIlpffU9FDDIPJX PFosm2ZGojxAkYSjnhYK+291zKcPZjFSifBQbe4aBGbdk47BfqUXtdK7TJW39QOdY9E+yK wy4t29VSPHiSnJwIURIydBmxzRFmZsH+jEC61XZe1SIOgncIKd80kdumGlfeaCDnBCgkP0 1GHxZfIY4nrMEww/uZ0drISZ0gtp8tmfX3XOIi93ysvaHJcoTMzJRsueZcjVWcHhFgzIfN t0hSCrSEstAFCt4NYfd+JPKRMcPXj4hAwc+kC0f+3rRyH+KXg13r7mf9TcYIHg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1693257126; a=rsa-sha256; cv=none; b=B1ZSgcHZZn79XKiJkrrshw8rUZwVKrW71Gyv7vwCneNEDZjjXyR1hCZJlcKqCGGzjUO4Wp H1zwzJs55oXaT5QWjdy0ElLjwhRKiLwwVGroypu6W3XydkAd7iXRDNzC6/sdOF7W/0KI4t kvEsKLarrChg4MLCloAF7j3z2KmvHqHQl6k1QugVYuSxEwvZ4kTtLr5bHx2vjXoR5c1/YC EISODD1SZin0YgpYWAYBHIbrHpszJLiur9Y+wYfsJ4FwTqAte2ood46CzzUxIfMa4nl1oS ZdjUXuPlXmWZ3AfCfCKe1uC/yFcMWYC8rOn/Tb+d+cl8JpGNmj6K/HzJxDVgsA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693257126; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VySQS5O2VDONJJ+MtjXu7UrwWSBfX0rgrTIn5fOZl8I=; b=FA9nZvXRpVr3ycKNkESjYAny2qA1VTLtDxmBzM00MsXCazXJJPuqeFYx0Xshfj7/7fc03r 9yOcBnY0YYbPFLYkLzKRJZ1wNbS5a1fcOn2qiaLk39lSnyWo4OemI6iJJxqz9nNHguvxs1 zzQVXC3fTj6zGBD34PglWeyyX7wg1el9fbX3V2jqlqyAZV/LPHZIzPHexDFVappzUy9NWi 9luPuAWqLazgoWeGOZ5Oit/hTJEoMi4dhTBRpAR3YwvphjeKSUDL5s9Rso4Xe+2kmBSPER fincn9bdW4Xcfx/QZIVTnn8F6MCKp5XZPE9+s3Q+ZccZRl2+8WkPHeTOajRafQ== Received: from [IPV6:2601:648:8683:a9e0:9cd8:9cdb:14b9:93d0] (unknown [IPv6:2601:648:8683:a9e0:9cd8:9cdb:14b9:93d0]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4RZNY14YdVzkcv; Mon, 28 Aug 2023 21:12:05 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: Date: Mon, 28 Aug 2023 14:12:03 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.14.0 To: Tom Tromey , gdb-patches@sourceware.org References: <20230828-cleanup-array-op-v1-0-12ca00f20917@adacore.com> Content-Language: en-US From: John Baldwin Subject: Re: [PATCH 0/5] Small cleanups in array_operation::evaluate In-Reply-To: <20230828-cleanup-array-op-v1-0-12ca00f20917@adacore.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 8/28/23 12:59 PM, Tom Tromey via Gdb-patches wrote: > While working on another, larger, series, I found a few small cleanups > to do in array_operation::evaluate. I've made each one a separate > patch to try to keep each one reasonably obvious. > > Regression tested on x86-64 Fedora 36. > > --- > Tom Tromey (5): > Use gdb::array_view for value_array > Declare 'tem' in loop header in array_operation::evaluate > Hoist array bounds check in array_operation::evaluate > Remove redundant variable from array_operation::evaluate > Remove another redundant variable from array_operation::evaluate > > gdb/eval.c | 29 +++++++++++------------------ > gdb/rust-lang.c | 2 +- > gdb/valops.c | 3 ++- > gdb/value.h | 2 +- > 4 files changed, 15 insertions(+), 21 deletions(-) > --- > base-commit: b8a175b415454df6a039ba0b5d2ff13c3c180275 > change-id: 20230828-cleanup-array-op-49e3af3bd743 > > Best regards, All lgtm. It might be nice as a further cleanup to rename tem2 and tem3. Based on the arguments passed to value_array, the ideal names for those would be something like 'lowbound' and 'highbound' but that clashes with the 'low_bound' and 'high_bound' used for the nested array. :( Reviewed-by: John Baldwin -- John Baldwin