OSDN Git Service

* doc/invoke.texi (SPARC options): Remove -mflat and
[pf3gnuchains/gcc-fork.git] / gcc / doc / gty.texi
index 6d4f839..2dc5b86 100644 (file)
@@ -1,4 +1,4 @@
-@c Copyright (C) 2002, 2003
+@c Copyright (C) 2002, 2003, 2004
 @c Free Software Foundation, Inc.
 @c This is part of the GCC manual.
 @c For copying conditions, see the file gcc.texi.
@@ -48,7 +48,7 @@ These markers can be placed:
 @item
 In a structure definition, before the open brace;
 @item
-In a global variable declaration, after the keyword @code{static} or 
+In a global variable declaration, after the keyword @code{static} or
 @code{extern}; and
 @item
 In a structure field definition, before the name of the field.
@@ -132,8 +132,19 @@ field really isn't ever used.
 @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}
-value, and then specifying a discriminator using @code{desc}.  For example,
+currently active.  This is done by giving each field a constant
+@code{tag} value, and then specifying a discriminator using @code{desc}.
+The value of the expression given by @code{desc} is compared against
+each @code{tag} value, each of which 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.
+
+In the @code{desc} option, the ``current structure'' is the union that
+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.)
+
+For example,
 @smallexample
 struct tree_binding GTY(())
 @{
@@ -141,19 +152,15 @@ struct tree_binding GTY(())
   union tree_binding_u @{
     tree GTY ((tag ("0"))) scope;
     struct cp_binding_level * GTY ((tag ("1"))) level;
-  @} GTY ((desc ("BINDING_HAS_LEVEL_P ((tree)&%0)"))) scope;
+  @} GTY ((desc ("BINDING_HAS_LEVEL_P ((tree)&%0)"))) xscope;
   tree value;
 @};
 @end smallexample
 
-In the @code{desc} option, the ``current structure'' is the union that
-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.)
-
-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.
+In this example, the value of BINDING_HAS_LEVEL_P when applied to a
+@code{struct tree_binding *} is presumed to be 0 or 1.  If 1, the type
+mechanism will treat the field @code{level} as being present and if 0,
+will treat the field @code{scope} as being present.
 
 @findex param_is
 @findex use_param
@@ -304,19 +311,19 @@ things you need to do:
 @enumerate
 @item
 You need to add the file to the list of source files the type
-machinery scans.  There are three cases: 
+machinery scans.  There are three cases:
 
 @enumerate a
 @item
 For a back-end file, this is usually done
 automatically; if not, you should add it to @code{target_gtfiles} in
-the appropriate port's entries in @file{config.gcc}. 
+the appropriate port's entries in @file{config.gcc}.
 
 @item
 For files shared by all front ends, this is done by adding the
 filename to the @code{GTFILES} variable in @file{Makefile.in}.
 
-@item 
+@item
 For any other file used by a front end, this is done by adding the
 filename to the @code{gtfiles} variable defined in
 @file{config-lang.in}.  For C, the file is @file{c-config-lang.in}.
@@ -335,7 +342,7 @@ header file, this should be done automatically.  For a front-end header
 file, it needs to be included by the same file that includes
 @file{gtype-@var{lang}.h}.  For other header files, it needs to be
 included in @file{gtype-desc.c}, which is a generated file, so add it to
-@code{ifiles} in @code{open_base_file} in @file{gengtype.c}.  
+@code{ifiles} in @code{open_base_file} in @file{gengtype.c}.
 
 For source files that aren't header files, the machinery will generate a
 header file that should be included in the source file you just changed.