From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18509 invoked by alias); 7 Apr 2011 02:46:32 -0000 Received: (qmail 18501 invoked by uid 22791); 7 Apr 2011 02:46:31 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-fx0-f47.google.com (HELO mail-fx0-f47.google.com) (209.85.161.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 07 Apr 2011 02:46:26 +0000 Received: by fxm19 with SMTP id 19so1644081fxm.20 for ; Wed, 06 Apr 2011 19:46:25 -0700 (PDT) Received: by 10.223.6.198 with SMTP id a6mr310932faa.130.1302144362123; Wed, 06 Apr 2011 19:46:02 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.81.75 with HTTP; Wed, 6 Apr 2011 19:45:42 -0700 (PDT) In-Reply-To: <20110404215335.032d7b9c.basile@starynkevitch.net> References: <20110404215335.032d7b9c.basile@starynkevitch.net> From: Laurynas Biveinis Date: Thu, 07 Apr 2011 02:46:00 -0000 Message-ID: Subject: Re: PATCH [trunk] gengtype should generate ggc_alloc macros in plugin mode. To: Basile Starynkevitch Cc: gcc-patches@gcc.gnu.org Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes 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 X-SW-Source: 2011-04/txt/msg00529.txt.bz2 Hello Basile - The patch is correct in general. But a few nitpicks: > 2011-04-04 Basile Starynkevitch > * gengtype.c (write_typed_alloc_def): Gets extra outf_p argument > and use it. ...: New argument f. Use it instead of header_file. > (write_typed_struct_alloc_def, write_typed_typedef_alloc_def) > (write_typed_alloc_defns): Likewise. > (main): Calls write_typed_alloc_defns with output_header. > Index: gcc/gengtype.c > =================================================================== > --- gcc/gengtype.c (revision 171950) > +++ gcc/gengtype.c (working copy) > @@ -4197,52 +4197,56 @@ enum alloc_zone > the allocator will be zone-specific. */ > > static void > -write_typed_alloc_def (bool variable_size, const char *type_specifier, > +write_typed_alloc_def (outf_p f, > + bool variable_size, const char *type_specifier, Here and for the rest of changed functions: 1) please describe f in the function header comment; 2) please align the second line of argument list. > + if (!f) > + return; If f is NULL, it must be a bug, please use gcc_assert (f) instead. Likewise in write_typed_alloc_defns. > + oprintf (f, "#define ggc_alloc_%s%s", allocator_type, type_name); > + oprintf (f, "(%s%s%s%s%s) ", > (variable_size ? "SIZE" : ""), Here and in similar places please also align the argument list. Thanks, -- Laurynas