This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH [trunk] gengtype should generate ggc_alloc macros in plugin mode.
- From: Laurynas Biveinis <laurynas dot biveinis at gmail dot com>
- To: Basile Starynkevitch <basile at starynkevitch dot net>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 7 Apr 2011 05:45:42 +0300
- Subject: Re: PATCH [trunk] gengtype should generate ggc_alloc macros in plugin mode.
- References: <20110404215335.032d7b9c.basile@starynkevitch.net>
Hello Basile -
The patch is correct in general. But a few nitpicks:
> 2011-04-04 Basile Starynkevitch <basile@starynkevitch.net>
> * 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