diff options
author | Duncan Sands <baldrick@free.fr> | 2009-09-28 10:50:39 +0200 |
---|---|---|
committer | Duncan Sands <baldrick@gcc.gnu.org> | 2009-09-28 08:50:39 +0000 |
commit | 32c9b4e92473a94323f4198c4fc2a34f6052f30e (patch) | |
tree | 194a436e90764acef2d9ddd4041e1b96fecade5a /gcc/doc | |
parent | bd77e02dac3326a073283468832c6e5bb66291bf (diff) | |
download | gcc-32c9b4e92473a94323f4198c4fc2a34f6052f30e.zip gcc-32c9b4e92473a94323f4198c4fc2a34f6052f30e.tar.gz gcc-32c9b4e92473a94323f4198c4fc2a34f6052f30e.tar.bz2 |
Add support for using ggc cache tables from plugins.
Approved by Ian Lance Taylor.
From-SVN: r152232
Diffstat (limited to 'gcc/doc')
-rw-r--r-- | gcc/doc/plugins.texi | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/gcc/doc/plugins.texi b/gcc/doc/plugins.texi index 4dfb159..bb32bcc 100644 --- a/gcc/doc/plugins.texi +++ b/gcc/doc/plugins.texi @@ -133,6 +133,7 @@ enum plugin_event PLUGIN_GGC_MARKING, /* Extend the GGC marking. */ PLUGIN_GGC_END, /* Called at end of GGC. */ PLUGIN_REGISTER_GGC_ROOTS, /* Register an extra GGC root table. */ + PLUGIN_REGISTER_GGC_CACHES, /* Register an extra GGC cache table. */ PLUGIN_ATTRIBUTES, /* Called during attribute registration */ PLUGIN_START_UNIT, /* Called before processing a translation unit. */ PLUGIN_EVENT_LAST /* Dummy event used for indexing callback @@ -151,8 +152,8 @@ the arguments: @item @code{void *user_data}: Pointer to plugin-specific data. @end itemize -For the PLUGIN_PASS_MANAGER_SETUP, PLUGIN_INFO, and -PLUGIN_REGISTER_GGC_ROOTS pseudo-events the @code{callback} should be +For the PLUGIN_PASS_MANAGER_SETUP, PLUGIN_INFO, PLUGIN_REGISTER_GGC_ROOTS +and PLUGIN_REGISTER_GGC_CACHES pseudo-events the @code{callback} should be null, and the @code{user_data} is specific. @section Interacting with the pass manager @@ -222,16 +223,19 @@ for the @code{PLUGIN_GGC_MARKING} event. Such callbacks can call the (and conversely, these routines should usually not be used in plugins outside of the @code{PLUGIN_GGC_MARKING} event). -Some plugins may need to add extra GGC root tables, e.g. to handle -their own @code{GTY}-ed data. This can be done with the -@code{PLUGIN_REGISTER_GGC_ROOTS} pseudo-event with a null callback and -the extra root table as @code{user_data}. Running the @code{gengtype --p @var{source-dir} @var{file-list} @var{plugin*.c} ...} utility -generates this extra root table. +Some plugins may need to add extra GGC root tables, e.g. to handle their own +@code{GTY}-ed data. This can be done with the @code{PLUGIN_REGISTER_GGC_ROOTS} +pseudo-event with a null callback and the extra root table (of type @code{struct +ggc_root_tab*}) as @code{user_data}. Plugins that want to use the +@code{if_marked} hash table option can add the extra GGC cache tables generated +by @code{gengtype} using the @code{PLUGIN_REGISTER_GGC_CACHES} pseudo-event with +a null callback and the extra cache table (of type @code{struct ggc_cache_tab*}) +as @code{user_data}. Running the @code{gengtype -p @var{source-dir} +@var{file-list} @var{plugin*.c} ...} utility generates these extra root tables. You should understand the details of memory management inside GCC -before using @code{PLUGIN_GGC_MARKING} or -@code{PLUGIN_REGISTER_GGC_ROOTS}. +before using @code{PLUGIN_GGC_MARKING}, @code{PLUGIN_REGISTER_GGC_ROOTS} +or @code{PLUGIN_REGISTER_GGC_CACHES}. @section Giving information about a plugin |