comparison gcc/doc/gty.texi @ 55:77e2b8dfacca gcc-4.4.5

update it from 4.4.3 to 4.5.0
author ryoma <e075725@ie.u-ryukyu.ac.jp>
date Fri, 12 Feb 2010 23:39:51 +0900
parents a06113de4d67
children f6334be47118
comparison
equal deleted inserted replaced
52:c156f1bd5cd9 55:77e2b8dfacca
44 @end itemize 44 @end itemize
45 45
46 Here are some examples of marking simple data structures and globals. 46 Here are some examples of marking simple data structures and globals.
47 47
48 @smallexample 48 @smallexample
49 struct @var{tag} GTY(()) 49 struct GTY(()) @var{tag}
50 @{ 50 @{
51 @var{fields}@dots{} 51 @var{fields}@dots{}
52 @}; 52 @};
53 53
54 typedef struct @var{tag} GTY(()) 54 typedef struct GTY(()) @var{tag}
55 @{ 55 @{
56 @var{fields}@dots{} 56 @var{fields}@dots{}
57 @} *@var{typename}; 57 @} *@var{typename};
58 58
59 static GTY(()) struct @var{tag} *@var{list}; /* @r{points to GC memory} */ 59 static GTY(()) struct @var{tag} *@var{list}; /* @r{points to GC memory} */
134 134
135 There are two places the type machinery will need to be explicitly told 135 There are two places the type machinery will need to be explicitly told
136 the length of an array. The first case is when a structure ends in a 136 the length of an array. The first case is when a structure ends in a
137 variable-length array, like this: 137 variable-length array, like this:
138 @smallexample 138 @smallexample
139 struct rtvec_def GTY(()) @{ 139 struct GTY(()) rtvec_def @{
140 int num_elem; /* @r{number of elements} */ 140 int num_elem; /* @r{number of elements} */
141 rtx GTY ((length ("%h.num_elem"))) elem[1]; 141 rtx GTY ((length ("%h.num_elem"))) elem[1];
142 @}; 142 @};
143 @end smallexample 143 @end smallexample
144 144
192 There are no escapes available to the @code{tag} option, since it is a 192 There are no escapes available to the @code{tag} option, since it is a
193 constant. 193 constant.
194 194
195 For example, 195 For example,
196 @smallexample 196 @smallexample
197 struct tree_binding GTY(()) 197 struct GTY(()) tree_binding
198 @{ 198 @{
199 struct tree_common common; 199 struct tree_common common;
200 union tree_binding_u @{ 200 union tree_binding_u @{
201 tree GTY ((tag ("0"))) scope; 201 tree GTY ((tag ("0"))) scope;
202 struct cp_binding_level * GTY ((tag ("1"))) level; 202 struct cp_binding_level * GTY ((tag ("1"))) level;
447 @end enumerate 447 @end enumerate
448 448
449 For language frontends, there is another file that needs to be included 449 For language frontends, there is another file that needs to be included
450 somewhere. It will be called @file{gtype-@var{lang}.h}, where 450 somewhere. It will be called @file{gtype-@var{lang}.h}, where
451 @var{lang} is the name of the subdirectory the language is contained in. 451 @var{lang} is the name of the subdirectory the language is contained in.
452
453 Plugins can add additional root tables. Run the @code{gengtype}
454 utility in plugin mode as @code{gengtype -P pluginout.h @var{source-dir}
455 @var{file-list} @var{plugin*.c}} with your plugin files
456 @var{plugin*.c} using @code{GTY} to generate the @var{pluginout.h} file.
457 The GCC build tree is needed to be present in that mode.
458
452 459
453 @node Invoking the garbage collector 460 @node Invoking the garbage collector
454 @section How to invoke the garbage collector 461 @section How to invoke the garbage collector
455 @cindex garbage collector, invocation 462 @cindex garbage collector, invocation
456 @findex ggc_collect 463 @findex ggc_collect