From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gnu.wildebeest.org (wildebeest.demon.nl [212.238.236.112]) by sourceware.org (Postfix) with ESMTPS id B15BF3858402 for ; Thu, 26 Aug 2021 19:19:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B15BF3858402 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=klomp.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=klomp.org Received: from reform (deer0x0b.wildebeest.org [172.31.17.141]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id 4963C3000ADC; Thu, 26 Aug 2021 21:19:44 +0200 (CEST) Received: by reform (Postfix, from userid 1000) id 26BA12E80C8B; Thu, 26 Aug 2021 21:19:44 +0200 (CEST) Date: Thu, 26 Aug 2021 21:19:44 +0200 From: Mark Wielaard To: The Other Cc: gcc-rust@gcc.gnu.org Subject: Re: [PATCH] Get rid of get_locus_slow Message-ID: References: <20210826000927.104493-1-mark@klomp.org> <12501AC4-F3A0-4A4E-8984-7F3318009241@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <12501AC4-F3A0-4A4E-8984-7F3318009241@gmail.com> X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-rust@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: gcc-rust mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Aug 2021 19:19:48 -0000 On Thu, Aug 26, 2021 at 10:31:06AM +0800, The Other wrote: > The original point of the distinction between get_locus_slow() and > get_locus() was to avoid the overhead of virtual function calls > whenever possible, but still have a way to access locations from > abstract base classes like Expr. If only we had Traits :) > As such, I’d at least make the overridden calls ‘final override’ in > the hope that the compiler can optimise out the virtual call. Yes, makes sense. I'll sent an updated patch. Thanks, Mark