diff options
author | Geoffrey Keating <geoffk@apple.com> | 2002-09-16 18:33:23 +0000 |
---|---|---|
committer | Geoffrey Keating <geoffk@gcc.gnu.org> | 2002-09-16 18:33:23 +0000 |
commit | 36a5eadd1a18a55b7b2b585bb5eb3736ab68ba48 (patch) | |
tree | c61dabe0ee2f12a433921e41d3b1799e3b26b2f5 /gcc/doc/gty.texi | |
parent | a7f6d760f368c9600bb96e142545303cc06d6abe (diff) | |
download | gcc-36a5eadd1a18a55b7b2b585bb5eb3736ab68ba48.zip gcc-36a5eadd1a18a55b7b2b585bb5eb3736ab68ba48.tar.gz gcc-36a5eadd1a18a55b7b2b585bb5eb3736ab68ba48.tar.bz2 |
Index: gcc/ChangeLog
2002-09-12 Geoffrey Keating <geoffk@apple.com>
* ggc-common.c (ggc_mark_rtx_children_1): Update for changed name
mangling.
The following changes are merged from pch-branch:
* doc/gty.texi (GTY Options): Document %a.
* gengtype.c (do_scalar_typedef): New function.
(process_gc_options): Handle `length' option.
(set_gc_used_type): A pointer to an array of structures doesn't
qualify as a pointer to a structure.
(output_escaped_param): Add `%a' escape.
(write_gc_structure_fields): Allow 'desc' on array of unions.
(main): Define `uint8', `jword' and `JCF_u2' as scalars; use
do_scalar_typedef.
* gengtype.c (enum rtx_code): Make global.
(rtx_format): Make global.
(rtx_next): New.
(gen_rtx_next): New.
(write_rtx_next): New.
(adjust_field_rtx_def): Skip fields marked by chain_next.
(open_base_files): Delete redundant prototype.
(write_enum_defn): New.
(output_mangled_typename): Correct abort call.
(write_gc_marker_routine_for_structure): Handle chain_next and
chain_prev options.
(finish_root_table): Don't output redundant \n.
(main): Call gen_rtx_next, write_rtx_next, write_enum_defn.
* c-tree.h (union lang_tree_node): Add chain_next option.
* gengtype.h (NUM_PARAM): New definition.
(struct type): For TYPE_PARAM_STRUCT, allow multiple parameters.
* gengtype.c (find_param_structure): New.
(adjust_field_type): Handle param<n>_is option.
(process_gc_options): Detect use_params option. Update callers.
(set_gc_used_type): Add 'param' parameter, update callers. Handle
'use_params' option.
(open_base_files): Add splay-tree.h to list of files included.
(output_mangled_typename): New.
(write_gc_structure_fields): Update 'param' parameter to support
multiple parameters. Change name mangling. Allow parameterized
fields to have an apparent scalar type. Handle param<n>_is options,
use_param option.
(write_gc_marker_routine_for_structure): Update for change to name
mangling. Better guess the output file for parameterized types.
(write_gc_types): Update for change to name mangling.
(write_gc_root): Update for change to name mangling. Handle (ignore)
param<n>_is options.
* doc/gty.texi (GTY Options): Add description of param<n>_is
options, use_params option.
* ggc.h (ggc_mark_rtx): Update for changed name mangling.
* gengtype-lex.l: Produce token for param<n>_is.
* gengtype-yacc.y: Parse param<n>_is.
* gengtype.c (adjust_field_tree_exp): Don't name a variable 'rindex'.
* rtl.c: Update comment describing rtx_format.
* rtl.h (union rtunion): Separate definition and typedef.
(struct rtx_def): Use gengtype to mark.
* Makefile.in (gengtype.o): Also depend on rtl.def.
* ggc.h (ggc_mark_rtx_children): Delete prototype.
(ggc_mark_rtx): Change to alias of gengtype-generated routine.
* ggc-common.c (ggc_mark_rtx_children): Delete.
(ggc_mark_rtx_children_1): Delete.
(gt_ggc_m_rtx_def): Delete.
* gengtype.c (adjust_field_rtx_def): New.
(adjust_field_type): Call adjust_field_rtx_def.
(write_gc_structure_fields): Add 'default' case to switch if none
is specified; remove unused code.
* tree.h (struct tree_exp): Update for change to meaning
of special.
* gengtype.c (adjust_field_tree_exp): New function.
(adjust_field_type): Handle `tree_exp' special here.
(write_gc_structure_fields): Don't handle `tree_exp' special here.
Handle new `dot' option.
* gengtype.h: Make `info' a pointer-to-const.
* gengtype-yacc.y (yacc_ids): Use xasprintf.
* gengtype.c (write_gc_structure_fields): Remove implementation
of `always' option, add `default' option.
* doc/gty.texi (GTY Options): Remove documentation of `always',
add `default'.
Index: gcc/cp/ChangeLog
2002-09-12 Geoffrey Keating <geoffk@apple.com>
* cp-tree.h (union lang_tree_node): Add chain_next option.
Index: gcc/f/ChangeLog
2002-09-12 Geoffrey Keating <geoffk@apple.com>
* com.c (union lang_tree_node): Add chain_next option.
Index: gcc/java/ChangeLog
2002-09-12 Geoffrey Keating <geoffk@apple.com>
* java-tree.h (union lang_tree_node): Add chain_next option.
From-SVN: r57206
Diffstat (limited to 'gcc/doc/gty.texi')
-rw-r--r-- | gcc/doc/gty.texi | 42 |
1 files changed, 36 insertions, 6 deletions
diff --git a/gcc/doc/gty.texi b/gcc/doc/gty.texi index cbd9caa..e0d9a33 100644 --- a/gcc/doc/gty.texi +++ b/gcc/doc/gty.texi @@ -72,6 +72,10 @@ immediately contains the current structure. @item %0 This expands to an expression that evaluates to the outermost structure that contains the current structure. +@item %a +This expands to the string of the form @code{[i1][i2]...} that indexes +the array item currently being marked. For instance, if the field +being marked is @code{foo}, then @code{%1.foo%a} is the same as @code{%h}. @end table The available options are: @@ -121,10 +125,10 @@ field really isn't ever used. @findex desc @findex tag -@findex always +@findex default @item desc @itemx tag -@itemx always +@itemx default The type machinery needs to be told which field of a @code{union} is currently active. This is done by giving each field a constant @code{tag} @@ -146,7 +150,9 @@ it discriminates. Use @code{%1} to mean the structure containing it. (There are no escapes available to the @code{tag} option, since it's supposed to be a constant.) -You can use @code{always} to mean that this field is always used. +Each @code{tag} should be different. If no @code{tag} is matched, +the field marked with @code{default} is used if there is one, otherwise +no field in the union will be marked. @findex param_is @findex use_param @@ -154,15 +160,39 @@ You can use @code{always} to mean that this field is always used. @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 specific types. -@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. +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 should write @verbatim htab_t GTY ((param_is (union tree_node))) ict; @end verbatim +@findex param@var{n}_is +@findex use_param@var{n} +@item param@var{n}_is +@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 parameterised, +there's no need to do anything special, the inner stucture inherits the +parameters of the outer one. When a structure contains a pointer to a +parameterised 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 deletable @item deletable |