From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 96100 invoked by alias); 28 Jul 2015 20:24:24 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 96089 invoked by uid 89); 28 Jul 2015 20:24:23 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-wi0-f169.google.com Received: from mail-wi0-f169.google.com (HELO mail-wi0-f169.google.com) (209.85.212.169) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Tue, 28 Jul 2015 20:24:22 +0000 Received: by wicgb10 with SMTP id gb10so172375842wic.1 for ; Tue, 28 Jul 2015 13:24:19 -0700 (PDT) X-Received: by 10.194.24.196 with SMTP id w4mr68621826wjf.137.1438115059429; Tue, 28 Jul 2015 13:24:19 -0700 (PDT) Received: from localhost ([95.144.14.199]) by smtp.googlemail.com with ESMTPSA id h9sm34935455wjx.20.2015.07.28.13.24.17 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Jul 2015 13:24:18 -0700 (PDT) From: Richard Sandiford To: Trevor Saunders Mail-Followup-To: Trevor Saunders ,Jeff Law , Richard Biener , tbsaunde+gcc@tbsaunde.org, GCC Patches , rdsandiford@googlemail.com Cc: Jeff Law , Richard Biener , tbsaunde+gcc@tbsaunde.org, GCC Patches Subject: Re: [PATCH 0/9] start converting POINTER_SIZE to a hook References: <1437966615-21093-1-git-send-email-tbsaunde+gcc@tbsaunde.org> <55B658F1.10300@redhat.com> <87a8uhfjt7.fsf@googlemail.com> <20150728034406.GB23293@tsaunders-iceball.corp.tor1.mozilla.com> Date: Tue, 28 Jul 2015 20:36:00 -0000 In-Reply-To: <20150728034406.GB23293@tsaunders-iceball.corp.tor1.mozilla.com> (Trevor Saunders's message of "Mon, 27 Jul 2015 23:44:06 -0400") Message-ID: <873808f2tq.fsf@googlemail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2015-07/txt/msg02406.txt.bz2 Trevor Saunders writes: > On Mon, Jul 27, 2015 at 09:05:08PM +0100, Richard Sandiford wrote: >> Alternatively we could have a new target_globals structure that is >> initialised with the result of calling the hook. If we do that though, >> it might make sense to consolidate the hooks rather than have one for >> every value. E.g. having one function for UNITS_PER_WORD, one for >> POINTER_SIZE, one for Pmode, etc., would lead to some very verbose >> target code. > > so something like > > struct target_types > { > unsigned long pointer_size; > ... > }; > > const target_types &targetm.get_type_data () > > ? that seems pretty reasonable, and I wouldn't expect too many ordering > issues, but who knows. Its too bad nobody has taken on the big job of > turning targetm into a class so we can hope for some devirt help from > the compiler. I was thinking more: void targetm.get_type_data (target_types *); The caller could then initialise or post-process the defaults. The target_types would eventually end up in some target_globals structure. Thanks, Richard