adding GGC events for plugins.

Basile STARYNKEVITCH basile@starynkevitch.net
Tue May 12 17:35:00 GMT 2009


Diego Novillo wrote:
> Some comments in addition to what's been suggested earlier in the
> thread:
Thanks to Diego Novillo & Rafael Espindola & Brad Hards & Paolo Bonzini 
for their feedback. Here is my improved patch (including updated 
documentation about plugins).

This is a patch to trunk rev147442

gcc/ChangeLog:

2009-05-12  Basile Starynkevitch  <basile@starynkevitch.net>

    * doc/plugins.texi (Loading Plugins): Typo: -ldl instead of -ld
    (Plugin initialization): updated plugin_init description.
    (Plugin callbacks): updated plugin_event description, and added
    PLUGIN_INFO, PLUGIN_GGC_START, PLUGIN_GGC_MARKING, PLUGIN_GGC_END,
    PLUGIN_REGISTER_GGC_ROOTS. Documented the pseudo-events.
    (Interacting with the GCC Garbage Collector) Added section.
    (Giving information about a plugin) Added section.
    * gcc-plugin.h (enum plugin_event): Added PLUGIN_GGC_START,
    PLUGIN_GGC_MARKING, PLUGIN_GGC_END, PLUGIN_REGISTER_GGC_ROOTS and
    updated comment of register_callback.
    * ggc.h: Declared ggc_register_root_tab.
    * ggc-common.c: including "plugin.h" & "vec.h".
    (extra_root_vec): new static vector.
    (ggc_register_root_tab): added new function.
    (ggc_mark_roots): scan the extra_root_vec if needed, and do the
    PLUGIN_GGC_MARKING callback.
    * ggc-zone.c (ggc_collect): call PLUGIN_GGC_START & PLUGIN_GGC_END
    callbacks.
    * ggc-page.c (ggc_collect): likewise.
    * plugin.c (plugin_event_name, register_callback)
    (invoke_plugin_callbacks): handle PLUGIN_GGC_START,
    PLUGIN_GGC_MARKING, PLUGIN_GGC_END, PLUGIN_REGISTER_GGC_ROOTS.
    * Makefile.in: plugin.o also depends upon $(GGC_H) and
    ggc-common.h depends upon plugin.h & vec.h.


gcc/testsuite/ChangeLog:

2009-05-12  Basile Starynkevitch  <basile@starynkevitch.net>

    * gcc.dg/plugin/ggcplug-test-1.c: Added new file.
    * gcc.dg/plugin/ggcplug.c: Added new file.
    * gcc.dg/plugin/plugin.exp: added ggcplug test.

Bootstraped on x86_64-linux-gnu (Debian/Sid/AMD64) with enable-languages=c.

Ok to commit ?

Respectful 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-plugin-ggc-trunk-rev147442.diff
Type: text/x-patch
Size: 18695 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20090512/35051711/attachment.bin>


More information about the Gcc-patches mailing list