PATCH [trunk] gengtype should generate ggc_alloc macros in plugin mode on for plugin files
Basile Starynkevitch
basile@starynkevitch.net
Mon Apr 11 01:37:00 GMT 2011
On Fri, 8 Apr 2011 19:55:51 +0200
Basile Starynkevitch <basile@starynkevitch.net> wrote:
> Committed revision 172203 (on trunk).
>
> Actually, the above committed patch is better than nothing, but not
> perfect. It happens to generate ggc_alloc macros for things which are
> not defined in the plugin (however, this is not a big deal in practice,
> since it generates some macros in common with those inside
> gtype-desc.h).
>
> I have no clear idea on how to improve it. We could for instance write
> the ggc_alloc macros only for struct & typedefs defined in the plugin
> files. We then would need a way to know if a file is a plugin file or
> not. What do you think?
The attached file improves the situation, by flagging input files and
generating ggc_alloc macros only relevant to plugin files.
########## gcc/ChangeLog entry #####
2011-04-11 Basile Starynkevitch <basile@starynkevitch.net>
* gengtype.h (struct input_file_st): Add inpisplugin field.
(type_fileloc): New function.
* gengtype.c
(write_typed_struct_alloc_def): Add gcc_assert.
(write_typed_alloc_defns): Ditto. Don't output for plugin files.
(write_typed_alloc_defns): Don't output for plugin files.
(input_file_by_name): Clear inpisplugin field.
(main): Set inpisplugin field for plugin files.
########
Comments are welcome. Ok for trunk with what changes?
Regards.
--
Basile STARYNKEVITCH http://starynkevitch.net/Basile/
email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mine, sont seulement les miennes} ***
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gengtype-allocplugin-r172252.diff
Type: text/x-diff
Size: 3585 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20110411/5a3a6bc3/attachment.bin>
More information about the Gcc-patches
mailing list