diff options
author | Trevor Saunders <tsaunders@mozilla.com> | 2014-12-10 03:45:40 +0000 |
---|---|---|
committer | Trevor Saunders <tbsaunde@gcc.gnu.org> | 2014-12-10 03:45:40 +0000 |
commit | 63f5d5b818319129217e41bcb23db53f99ff11b0 (patch) | |
tree | d68af710e723e37215793eba5a9d183e68b6f322 /gcc/doc | |
parent | 59bce71381be24449aaf902bc1bc64a12b373bf4 (diff) | |
download | gcc-63f5d5b818319129217e41bcb23db53f99ff11b0.zip gcc-63f5d5b818319129217e41bcb23db53f99ff11b0.tar.gz gcc-63f5d5b818319129217e41bcb23db53f99ff11b0.tar.bz2 |
remove gengtype support for param_is use_param, if_marked and splay tree allocators
gcc/
* plugin.c, plugin.def, ggc.h, ggc-common.c, gengtype.h, gengtype.c,
gengtype-state.c, gengtype-parse.c, gentype-lex.l, gcc-plugin.h,
doc/plugins.texi, doc/gty.texi: Remove support for if_marked and
param_is.
include/
* hashtab.h, splay-tree.h: Remove GTY markers.
From-SVN: r218558
Diffstat (limited to 'gcc/doc')
-rw-r--r-- | gcc/doc/gty.texi | 65 | ||||
-rw-r--r-- | gcc/doc/plugins.texi | 27 |
2 files changed, 13 insertions, 79 deletions
diff --git a/gcc/doc/gty.texi b/gcc/doc/gty.texi index e4d2b60..aa6f84f 100644 --- a/gcc/doc/gty.texi +++ b/gcc/doc/gty.texi @@ -245,54 +245,6 @@ The @code{desc} and @code{tag} options can also be used for inheritance to denote which subclass an instance is. See @ref{Inheritance and GTY} for more information. -@findex param_is -@findex use_param -@item param_is (@var{type}) -@itemx use_param - -Sometimes it's convenient to define some data structure to work on -generic pointers (that is, @code{PTR}) and then use it with a specific -type. @code{param_is} specifies the real type pointed to, and -@code{use_param} says where in the generic data structure that type -should be put. - -For instance, to have a @code{htab_t} that points to trees, one would -write the definition of @code{htab_t} like this: -@smallexample -typedef struct GTY(()) @{ - @dots{} - void ** GTY ((use_param, @dots{})) entries; - @dots{} -@} htab_t; -@end smallexample -and then declare variables like this: -@smallexample - static htab_t GTY ((param_is (union tree_node))) ict; -@end smallexample - -@findex param@var{n}_is -@findex use_param@var{n} -@item param@var{n}_is (@var{type}) -@itemx use_param@var{n} - -In more complicated cases, the data structure might need to work on -several different types, which might not necessarily all be pointers. -For this, @code{param1_is} through @code{param9_is} may be used to -specify the real type of a field identified by @code{use_param1} through -@code{use_param9}. - -@findex use_params -@item use_params - -When a structure contains another structure that is parameterized, -there's no need to do anything special, the inner structure inherits the -parameters of the outer one. When a structure contains a pointer to a -parameterized structure, the type machinery won't automatically detect -this (it could, it just doesn't yet), so it's necessary to tell it that -the pointed-to structure should use the same parameters as the outer -structure. This is done by marking the pointer with the -@code{use_params} option. - @findex cache @item cache @@ -309,23 +261,6 @@ garbage collection runs, there's no need to mark anything pointed to by this variable, it can just be set to @code{NULL} instead. This is used to keep a list of free structures around for re-use. -@findex if_marked -@item if_marked ("@var{expression}") - -Suppose you want some kinds of object to be unique, and so you put them -in a hash table. If garbage collection marks the hash table, these -objects will never be freed, even if the last other reference to them -goes away. GGC has special handling to deal with this: if you use the -@code{if_marked} option on a global hash table, GGC will call the -routine whose name is the parameter to the option on each hash table -entry. If the routine returns nonzero, the hash table entry will -be marked as usual. If the routine returns zero, the hash table entry -will be deleted. - -The routine @code{ggc_marked_p} can be used to determine if an element -has been marked already; in fact, the usual case is to use -@code{if_marked ("ggc_marked_p")}. - @findex mark_hook @item mark_hook ("@var{hook-routine-name}") diff --git a/gcc/doc/plugins.texi b/gcc/doc/plugins.texi index 4a839b8..96df506 100644 --- a/gcc/doc/plugins.texi +++ b/gcc/doc/plugins.texi @@ -185,7 +185,6 @@ 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_PRAGMAS, /* Called during pragma registration. */ @@ -233,10 +232,9 @@ the arguments: @item @code{void *user_data}: Pointer to plugin-specific data. @end itemize -For the @i{PLUGIN_PASS_MANAGER_SETUP}, @i{PLUGIN_INFO}, -@i{PLUGIN_REGISTER_GGC_ROOTS} and @i{PLUGIN_REGISTER_GGC_CACHES} -pseudo-events the @code{callback} should be null, and the -@code{user_data} is specific. +For the @i{PLUGIN_PASS_MANAGER_SETUP}, @i{PLUGIN_INFO}, and +@i{PLUGIN_REGISTER_GGC_ROOTS} pseudo-events the @code{callback} should be null, +and the @code{user_data} is specific. When the @i{PLUGIN_PRAGMAS} event is triggered (with a null pointer as data from GCC), plugins may register their own pragmas. Notice that @@ -321,21 +319,22 @@ done by registering a callback (called with a null @code{gcc_data}) for the @code{PLUGIN_GGC_MARKING} event. Such callbacks can call the @code{ggc_set_mark} routine, preferably through the @code{ggc_mark} macro (and conversely, these routines should usually not be used in plugins -outside of the @code{PLUGIN_GGC_MARKING} event). +outside of the @code{PLUGIN_GGC_MARKING} event). Plugins that wish to hold +weak references to gc data may also use this event to drop weak references when +the object is about to be collected. The @code{ggc_marked_p} function can be +used to tell if an object is marked, or is about to be collected. The +@code{gt_clear_cache} overloads which some types define may also be of use in +managing weak references. 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. +ggc_root_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}, @code{PLUGIN_REGISTER_GGC_ROOTS} -or @code{PLUGIN_REGISTER_GGC_CACHES}. +before using @code{PLUGIN_GGC_MARKING} or @code{PLUGIN_REGISTER_GGC_ROOTS}. @node Plugins description |