OSDN Git Service

* doc/tm.texi (STATIC_CHAIN, STATIC_CHAIN_INCOMING): Remove.
[pf3gnuchains/gcc-fork.git] / gcc / doc / c-tree.texi
index 46af3ab..3549858 100644 (file)
@@ -1,5 +1,5 @@
-@c Copyright (c) 1999, 2000, 2001, 2002, 2003, 2004, 2005
-@c Free Software Foundation, Inc.
+@c Copyright (c) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
+@c 2009  Free Software Foundation, Inc.
 @c This is part of the GCC manual.
 @c For copying conditions, see the file gcc.texi.
 
@@ -271,6 +271,7 @@ The elements are indexed from zero.
 @tindex TYPE_MIN_VALUE
 @tindex TYPE_MAX_VALUE
 @tindex REAL_TYPE
+@tindex FIXED_POINT_TYPE
 @tindex COMPLEX_TYPE
 @tindex ENUMERAL_TYPE
 @tindex BOOLEAN_TYPE
@@ -311,7 +312,7 @@ The elements are indexed from zero.
 
 All types have corresponding tree nodes.  However, you should not assume
 that there is exactly one tree node corresponding to each type.  There
-are often several nodes each of which correspond to the same type.
+are often multiple nodes corresponding to the same type.
 
 For the most part, different kinds of types have different tree codes.
 (For example, pointer types use a @code{POINTER_TYPE} code while arrays
@@ -372,7 +373,7 @@ The alignment of the type, in bits, represented as an @code{int}.
 
 @item TYPE_NAME
 This macro returns a declaration (in the form of a @code{TYPE_DECL}) for
-the type.  (Note this macro does @emph{not} return a
+the type.  (Note this macro does @emph{not} return an
 @code{IDENTIFIER_NODE}, as you might expect, given its name!)  You can
 look at the @code{DECL_NAME} of the @code{TYPE_DECL} to obtain the
 actual name of the type.  The @code{TYPE_NAME} will be @code{NULL_TREE}
@@ -498,6 +499,19 @@ Used to represent the @code{float}, @code{double}, and @code{long
 double} types.  The number of bits in the floating-point representation
 is given by @code{TYPE_PRECISION}, as in the @code{INTEGER_TYPE} case.
 
+@item FIXED_POINT_TYPE
+Used to represent the @code{short _Fract}, @code{_Fract}, @code{long
+_Fract}, @code{long long _Fract}, @code{short _Accum}, @code{_Accum},
+@code{long _Accum}, and @code{long long _Accum} types.  The number of bits
+in the fixed-point representation is given by @code{TYPE_PRECISION},
+as in the @code{INTEGER_TYPE} case.  There may be padding bits, fractional
+bits and integral bits.  The number of fractional bits is given by
+@code{TYPE_FBIT}, and the number of integral bits is given by @code{TYPE_IBIT}.
+The fixed-point type is unsigned if @code{TYPE_UNSIGNED} holds; otherwise,
+it is signed.
+The fixed-point type is saturating if @code{TYPE_SATURATING} holds; otherwise,
+it is not saturating.
+
 @item COMPLEX_TYPE
 Used to represent GCC built-in @code{__complex__} data types.  The
 @code{TREE_TYPE} is the type of the real and imaginary parts.
@@ -1242,7 +1256,7 @@ structures, something like the following should be used
 @findex OVL_NEXT
 
 A function is represented by a @code{FUNCTION_DECL} node.  A set of
-overloaded functions is sometimes represented by a @code{OVERLOAD} node.
+overloaded functions is sometimes represented by an @code{OVERLOAD} node.
 
 An @code{OVERLOAD} node is not a declaration, so none of the
 @samp{DECL_} macros should be used on an @code{OVERLOAD}.  An
@@ -1284,7 +1298,7 @@ tree structure; back ends must look at the @code{DECL_CONTEXT} for the
 referenced @code{VAR_DECL}.  If the @code{DECL_CONTEXT} for the
 referenced @code{VAR_DECL} is not the same as the function currently
 being processed, and neither @code{DECL_EXTERNAL} nor
-@code{DECL_STATIC} hold, then the reference is to a local variable in
+@code{TREE_STATIC} hold, then the reference is to a local variable in
 a containing function, and the back end must take appropriate action.
 
 @menu
@@ -1316,6 +1330,8 @@ a containing function, and the back end must take appropriate action.
 @findex DECL_GLOBAL_CTOR_P
 @findex DECL_GLOBAL_DTOR_P
 @findex GLOBAL_INIT_PRIORITY
+@findex DECL_FUNCTION_SPECIFIC_TARGET
+@findex DECL_FUNCTION_SPECIFIC_OPTIMIZATION
 
 The following macros and functions can be used on a @code{FUNCTION_DECL}:
 @ftable @code
@@ -1494,12 +1510,23 @@ whose @code{TREE_VALUE} represents a type.
 
 @item TYPE_NOTHROW_P
 This predicate holds when the exception-specification of its arguments
-if of the form `@code{()}'.
+is of the form `@code{()}'.
 
 @item DECL_ARRAY_DELETE_OPERATOR_P
 This predicate holds if the function an overloaded
 @code{operator delete[]}.
 
+@item DECL_FUNCTION_SPECIFIC_TARGET
+This macro returns a tree node that holds the target options that are
+to be used to compile this particular function or @code{NULL_TREE} if
+the function is to be compiled with the target options specified on
+the command line.
+
+@item DECL_FUNCTION_SPECIFIC_OPTIMIZATION
+This macro returns a tree node that holds the optimization options
+that are to be used to compile this particular function or
+@code{NULL_TREE} if the function is to be compiled with the
+optimization options specified on the command line.
 @end ftable
 
 @c ---------------------------------------------------------------------
@@ -1879,6 +1906,7 @@ This macro returns the attributes on the type @var{type}.
 @findex tree_int_cst_lt
 @findex tree_int_cst_equal
 @tindex REAL_CST
+@tindex FIXED_CST
 @tindex COMPLEX_CST
 @tindex VECTOR_CST
 @tindex STRING_CST
@@ -1907,6 +1935,7 @@ This macro returns the attributes on the type @var{type}.
 @tindex NON_LVALUE_EXPR
 @tindex NOP_EXPR
 @tindex CONVERT_EXPR
+@tindex FIXED_CONVERT_EXPR
 @tindex THROW_EXPR
 @tindex LSHIFT_EXPR
 @tindex RSHIFT_EXPR
@@ -1918,6 +1947,7 @@ This macro returns the attributes on the type @var{type}.
 @tindex TRUTH_AND_EXPR
 @tindex TRUTH_OR_EXPR
 @tindex TRUTH_XOR_EXPR
+@tindex POINTER_PLUS_EXPR
 @tindex PLUS_EXPR
 @tindex MINUS_EXPR
 @tindex MULT_EXPR
@@ -1983,8 +2013,11 @@ This macro returns the attributes on the type @var{type}.
 @tindex VEC_WIDEN_MULT_LO_EXPR
 @tindex VEC_UNPACK_HI_EXPR
 @tindex VEC_UNPACK_LO_EXPR
-@tindex VEC_PACK_MOD_EXPR
+@tindex VEC_UNPACK_FLOAT_HI_EXPR
+@tindex VEC_UNPACK_FLOAT_LO_EXPR
+@tindex VEC_PACK_TRUNC_EXPR
 @tindex VEC_PACK_SAT_EXPR
+@tindex VEC_PACK_FIX_TRUNC_EXPR
 @tindex VEC_EXTRACT_EVEN_EXPR 
 @tindex VEC_EXTRACT_ODD_EXPR
 @tindex VEC_INTERLEAVE_HIGH_EXPR
@@ -1996,7 +2029,7 @@ mind.  In particular, the expression ``tree'' is actually a directed
 acyclic graph.  (For example there may be many references to the integer
 constant zero throughout the source program; many of these will be
 represented by the same expression node.)  You should not rely on
-certain kinds of node being shared, nor should rely on certain kinds of
+certain kinds of node being shared, nor should you rely on certain kinds of
 nodes being unshared.
 
 The following macros can be used with all expression nodes:
@@ -2075,6 +2108,15 @@ its bit-pattern.
 FIXME: Talk about how to obtain representations of this constant, do
 comparisons, and so forth.
 
+@item FIXED_CST
+
+These nodes represent fixed-point constants.  The type of these constants
+is obtained with @code{TREE_TYPE}.  @code{TREE_FIXED_CST_PTR} points to
+a @code{struct fixed_value};  @code{TREE_FIXED_CST} returns the structure
+itself.  @code{struct fixed_value} contains @code{data} with the size of two
+@code{HOST_BITS_PER_WIDE_INT} and @code{mode} as the associated fixed-point
+machine mode for @code{data}.
+
 @item COMPLEX_CST
 These nodes are used to represent complex number constants, that is a
 @code{__complex__} whose parts are constant nodes.  The
@@ -2241,6 +2283,13 @@ cases are always indicated explicitly.  Similarly, a user-defined
 conversion is never represented by a @code{CONVERT_EXPR}; instead, the
 function calls are made explicit.
 
+@item FIXED_CONVERT_EXPR
+These nodes are used to represent conversions that involve fixed-point
+values.  For example, from a fixed-point value to another fixed-point value,
+from an integer to a fixed-point value, from a fixed-point value to an
+integer, from a floating-point value to a fixed-point value, or from
+a fixed-point value to a floating-point value.
+
 @item THROW_EXPR
 These nodes represent @code{throw} expressions.  The single operand is
 an expression for the code that should be executed to throw the
@@ -2288,6 +2337,12 @@ generate these expressions anyhow, if it can tell that strictness does
 not matter.  The type of the operands and that of the result are
 always of @code{BOOLEAN_TYPE} or @code{INTEGER_TYPE}.
 
+@itemx POINTER_PLUS_EXPR
+This node represents pointer arithmetic.  The first operand is always
+a pointer/reference type.  The second operand is always an unsigned
+integer type compatible with sizetype.  This is the only binary
+arithmetic operand that can operate on pointer types.
+
 @itemx PLUS_EXPR
 @itemx MINUS_EXPR
 @itemx MULT_EXPR
@@ -2474,26 +2529,46 @@ argument does cause side-effects.
 
 @item CALL_EXPR
 These nodes are used to represent calls to functions, including
-non-static member functions.  The first operand is a pointer to the
+non-static member functions.  @code{CALL_EXPR}s are implemented as
+expression nodes with a variable number of operands.  Rather than using
+@code{TREE_OPERAND} to extract them, it is preferable to use the
+specialized accessor macros and functions that operate specifically on
+@code{CALL_EXPR} nodes.
+
+@code{CALL_EXPR_FN} returns a pointer to the
 function to call; it is always an expression whose type is a
-@code{POINTER_TYPE}.  The second argument is a @code{TREE_LIST}.  The
-arguments to the call appear left-to-right in the list.  The
-@code{TREE_VALUE} of each list node contains the expression
-corresponding to that argument.  (The value of @code{TREE_PURPOSE} for
-these nodes is unspecified, and should be ignored.)  For non-static
+@code{POINTER_TYPE}.
+
+The number of arguments to the call is returned by @code{call_expr_nargs},
+while the arguments themselves can be accessed with the @code{CALL_EXPR_ARG} 
+macro.  The arguments are zero-indexed and numbered left-to-right.  
+You can iterate over the arguments using @code{FOR_EACH_CALL_EXPR_ARG}, as in:
+
+@smallexample
+tree call, arg;
+call_expr_arg_iterator iter;
+FOR_EACH_CALL_EXPR_ARG (arg, iter, call)
+  /* arg is bound to successive arguments of call.  */
+  @dots{};
+@end smallexample
+
+For non-static
 member functions, there will be an operand corresponding to the
 @code{this} pointer.  There will always be expressions corresponding to
 all of the arguments, even if the function is declared with default
 arguments and some arguments are not explicitly provided at the call
 sites.
 
+@code{CALL_EXPR}s also have a @code{CALL_EXPR_STATIC_CHAIN} operand that
+is used to implement nested functions.  This operand is otherwise null.
+
 @item STMT_EXPR
 These nodes are used to represent GCC's statement-expression extension.
 The statement-expression extension allows code like this:
 @smallexample
 int f() @{ return (@{ int j; j = 3; j + 7; @}); @}
 @end smallexample
-In other words, an sequence of statements may occur where a single
+In other words, a sequence of statements may occur where a single
 expression would normally appear.  The @code{STMT_EXPR} node represents
 such an expression.  The @code{STMT_EXPR_STMT} gives the statement
 contained in the expression.  The value of the expression is the value
@@ -2560,10 +2635,10 @@ declaration order.  You should not assume that all fields will be
 represented.  Unrepresented fields will be set to zero.
 
 @item COMPOUND_LITERAL_EXPR
-@findex COMPOUND_LITERAL_EXPR_DECL_STMT
+@findex COMPOUND_LITERAL_EXPR_DECL_EXPR
 @findex COMPOUND_LITERAL_EXPR_DECL
 These nodes represent ISO C99 compound literals.  The
-@code{COMPOUND_LITERAL_EXPR_DECL_STMT} is a @code{DECL_STMT}
+@code{COMPOUND_LITERAL_EXPR_DECL_EXPR} is a @code{DECL_EXPR}
 containing an anonymous @code{VAR_DECL} for
 the unnamed object represented by the compound literal; the
 @code{DECL_INITIAL} of that @code{VAR_DECL} is a @code{CONSTRUCTOR}
@@ -2613,15 +2688,14 @@ cleanups.
 An @code{AGGR_INIT_EXPR} represents the initialization as the return
 value of a function call, or as the result of a constructor.  An
 @code{AGGR_INIT_EXPR} will only appear as a full-expression, or as the
-second operand of a @code{TARGET_EXPR}.  The first operand to the
-@code{AGGR_INIT_EXPR} is the address of a function to call, just as in
-a @code{CALL_EXPR}.  The second operand are the arguments to pass that
-function, as a @code{TREE_LIST}, again in a manner similar to that of
-a @code{CALL_EXPR}.
+second operand of a @code{TARGET_EXPR}.  @code{AGGR_INIT_EXPR}s have
+a representation similar to that of @code{CALL_EXPR}s.  You can use
+the @code{AGGR_INIT_EXPR_FN} and @code{AGGR_INIT_EXPR_ARG} macros to access
+the function to call and the arguments to pass.
 
 If @code{AGGR_INIT_VIA_CTOR_P} holds of the @code{AGGR_INIT_EXPR}, then
-the initialization is via a constructor call.  The address of the third
-operand of the @code{AGGR_INIT_EXPR}, which is always a @code{VAR_DECL},
+the initialization is via a constructor call.  The address of the
+@code{AGGR_INIT_EXPR_SLOT} operand, which is always a @code{VAR_DECL},
 is taken, and this value replaces the first argument in the argument
 list.
 
@@ -2635,7 +2709,7 @@ its sole argument yields the representation for @code{ap}.
 
 @item OMP_PARALLEL
 
-Represents @code{#pragma omp parallel [clause1 ... clauseN]}. It
+Represents @code{#pragma omp parallel [clause1 @dots{} clauseN]}. It
 has four operands:
 
 Operand @code{OMP_PARALLEL_BODY} is valid while in GENERIC and
@@ -2660,7 +2734,7 @@ variables.
 
 @item OMP_FOR
 
-Represents @code{#pragma omp for [clause1 ... clauseN]}.  It
+Represents @code{#pragma omp for [clause1 @dots{} clauseN]}.  It
 has 5 operands:
 
 Operand @code{OMP_FOR_BODY} contains the loop body.
@@ -2693,7 +2767,7 @@ unspecified by the standard.
 
 @item OMP_SECTIONS
 
-Represents @code{#pragma omp sections [clause1 ... clauseN]}.
+Represents @code{#pragma omp sections [clause1 @dots{} clauseN]}.
 
 Operand @code{OMP_SECTIONS_BODY} contains the sections body,
 which in turn contains a set of @code{OMP_SECTION} nodes for
@@ -2744,7 +2818,7 @@ label the critical section.
 @item OMP_RETURN
 
 This does not represent any OpenMP directive, it is an artificial
-marker to indicate the end of the body of an OpenMP. It is used
+marker to indicate the end of the body of an OpenMP@. It is used
 by the flow graph (@code{tree-cfg.c}) and OpenMP region
 building code (@code{omp-low.c}).
 
@@ -2818,23 +2892,50 @@ vector of @code{N/2} products.
 
 @item VEC_UNPACK_HI_EXPR
 @item VEC_UNPACK_LO_EXPR
-These nodes represent unpacking of the high and low parts of the input vector, 
+These nodes represent unpacking of the high and low parts of the input vector,
 respectively.  The single operand is a vector that contains @code{N} elements 
-of the same integral type.  The result is a vector that contains half as many 
-elements, of an integral type whose size is twice as wide.  In the case of 
-@code{VEC_UNPACK_HI_EXPR} the high @code{N/2} elements of the vector are 
-extracted and widened (promoted).  In the case of @code{VEC_UNPACK_LO_EXPR} the 
-low @code{N/2} elements of the vector are extracted and widened (promoted).
+of the same integral or floating point type.  The result is a vector
+that contains half as many elements, of an integral or floating point type
+whose size is twice as wide.  In the case of @code{VEC_UNPACK_HI_EXPR} the
+high @code{N/2} elements of the vector are extracted and widened (promoted).
+In the case of @code{VEC_UNPACK_LO_EXPR} the low @code{N/2} elements of the
+vector are extracted and widened (promoted).
+
+@item VEC_UNPACK_FLOAT_HI_EXPR
+@item VEC_UNPACK_FLOAT_LO_EXPR
+These nodes represent unpacking of the high and low parts of the input vector,
+where the values are converted from fixed point to floating point.  The
+single operand is a vector that contains @code{N} elements of the same
+integral type.  The result is a vector that contains half as many elements
+of a floating point type whose size is twice as wide.  In the case of
+@code{VEC_UNPACK_HI_EXPR} the high @code{N/2} elements of the vector are
+extracted, converted and widened.  In the case of @code{VEC_UNPACK_LO_EXPR}
+the low @code{N/2} elements of the vector are extracted, converted and widened.
+
+@item VEC_PACK_TRUNC_EXPR
+This node represents packing of truncated elements of the two input vectors
+into the output vector.  Input operands are vectors that contain the same
+number of elements of the same integral or floating point type.  The result
+is a vector that contains twice as many elements of an integral or floating
+point type whose size is half as wide. The elements of the two vectors are
+demoted and merged (concatenated) to form the output vector.
 
-@item VEC_PACK_MOD_EXPR
 @item VEC_PACK_SAT_EXPR
-These nodes represent packing of elements of the two input vectors into the
-output vector, using modulo or saturating arithmetic, respectively.
-Their operands are vectors that contain the same number of elements 
-of the same integral type.  The result is a vector that contains twice as many 
-elements, of an integral type whose size is half as wide.  In both cases
-the elements of the two vectors are demoted and merged (concatenated) to form
-the output vector.
+This node represents packing of elements of the two input vectors into the
+output vector using saturation.  Input operands are vectors that contain
+the same number of elements of the same integral type.  The result is a
+vector that contains twice as many elements of an integral type whose size
+is half as wide.  The elements of the two vectors are demoted and merged
+(concatenated) to form the output vector.
+
+@item VEC_PACK_FIX_TRUNC_EXPR
+This node represents packing of elements of the two input vectors into the
+output vector, where the values are converted from floating point
+to fixed point.  Input operands are vectors that contain the same number
+of elements of a floating point type.  The result is a vector that contains
+twice as many elements of an integral type whose size is half as wide.  The
+elements of the two vectors are merged (concatenated) to form the output
+vector.
 
 @item VEC_EXTRACT_EVEN_EXPR
 @item VEC_EXTRACT_ODD_EXPR