gengtype should generate gtype-desc.h in plugin mode

Basile STARYNKEVITCH basile@starynkevitch.net
Mon Jul 6 14:50:00 GMT 2009


Hello All,

I am pinging http://gcc.gnu.org/ml/gcc-patches/2009-07/msg00174.html and 
attaching a slightly enhanced patch to trunk rev149284
>
>
> in plugin mode, gengtype should also generate gtype-desc.h because it 
> contains macros useful to the other generated gt-*.h files. 
> Concretely, if one have a plugin with a GTY-ed union containing 
> pointers to some GTY-ed struct (inside the same plugin.c)
I patched gcc/gengtype.c and added a few sentence in gcc/doc/plugins.texi
> I also feel it would be better to have it be an include-once file 
> (wrapped with appropriate #ifdef). 
I patched gcc/gengtype.c for that.

> I strongly believe that plugins using PLUGIN_REGISTER_GGC_ROOTS or 
> PLUGIN_GGC_MARKING (like MELT) are strongly incompatible with 
> precompiled headers (at least the idea of *writing* *.pch files from a 
> compilation using such plugins).
I also added a sentence in gcc/doc/plugins.texi about that.

gcc/ChangeLog:
2009-07-06  Basile Starynkevitch  <basile@starynkevitch.net>

    * gcc/doc/plugins.texi (Interacting with the GCC Garbage
    Collector): In plugin mode, gtype-desc.h is generated.
    PLUGIN_REGISTER_GGC_ROOTS may break precompiled headers if used
    without care.

    * gcc/gengtype.c (open_base_files): generate the header_file
    gtype-desc.h even in plugin mode, and wrap it in an #ifdef.
    (main): emit the #endif in header_file.


Ok to commit if it bootstraps (Debian/Sid/AMD64 = x86-64-gnu-linux) ? I 
am bootstrapping it now (it did a few days ago).

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 mines, sont seulement les miennes} ***

-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch-gengtype-plugin-gtype-desc-r149283.diff
Type: text/x-patch
Size: 2192 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20090706/4b9d6091/attachment.bin>


More information about the Gcc-patches mailing list