This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: adding GGC events for plugins.


On Tuesday 12 May 2009 09:34:02 pm Basile STARYNKEVITCH wrote:
> In particular, it provides the following features to future plugins:
>
> The plugin events PLUGIN_GGC_START and PLUGIN_GGC_END are called by
> ggc_collect at start and at end of garbage collection.
>
> The plugin event PLUGIN_GGC_MARKING is called by ggc_mark_roots and
> could be used by the plugins which need to mark some extra data.
>
> The function ggc_register_root_tab is added to register extra GGC roots,
> and can be used by plugins using the plugin event
> PLUGIN_REGISTER_GGC_ROOTS. 
Could you add that documentation to gcc/doc/plugins.texi? Also, could you 
document the callback function data (which looks like is always NULL)?


===================================================================
--- gcc/doc/plugins.texi	(revision 147426)
+++ gcc/doc/plugins.texi	(working copy)
@@ -71,6 +71,9 @@
   PLUGIN_FINISH_UNIT,           /* Useful for summary processing.  */
   PLUGIN_CXX_CP_PRE_GENERICIZE, /* Allows to see low level AST in C++ FE.  */
   PLUGIN_FINISH,                /* Called before GCC exits.  */
+  PLUGIN_GGC_START,		/* Called at start of Gcc Garbage Collection */
+  PLUGIN_GGC_MARKING,		/* To extend the GGC marking */
+  PLUGIN_GGC_END,		/* Called at end of GGC */
   PLUGIN_EVENT_LAST             /* Dummy event used for indexing callback
                                    array.  */
 @};
Why doesn't the list of event types in the documentation match the list of 
event types in the plugin API?

Index: gcc/gcc-plugin.h
===================================================================
--- gcc/gcc-plugin.h	(revision 147426)
+++ gcc/gcc-plugin.h	(working copy)
@@ -29,6 +29,10 @@
   PLUGIN_CXX_CP_PRE_GENERICIZE, /* Allows to see low level AST in C++ FE.  */
   PLUGIN_FINISH,                /* Called before GCC exits.  */
   PLUGIN_INFO,                  /* Information about the plugin */
+  PLUGIN_GGC_START,		/* Called at start of Gcc Garbage Collection */
+  PLUGIN_GGC_MARKING,		/* To extend the GGC marking */
+  PLUGIN_GGC_END,		/* Called at end of GGC */
+  PLUGIN_REGISTER_GGC_ROOTS,	/* register an extra GGC root table */
   PLUGIN_EVENT_LAST             /* Dummy event used for indexing callback
                                    array.  */
 };

Could we have an example / test case?

Brad


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]