OSDN Git Service

2004-02-07 Paolo Bonzini <bonzini@gnu.org>
[pf3gnuchains/gcc-fork.git] / gcc / tree.def
index 056f5d0..7891974 100644 (file)
@@ -1,6 +1,6 @@
 /* This file contains the definitions and documentation for the
    tree codes used in GCC.
-   Copyright (C) 1987, 1988, 1993, 1995, 1997, 1998, 2000, 2001
+   Copyright (C) 1987, 1988, 1993, 1995, 1997, 1998, 2000, 2001, 2004
    Free Software Foundation, Inc.
 
 This file is part of GCC.
@@ -274,7 +274,7 @@ DEFTREECODE (COMPLEX_CST, "complex_cst", 'c', 0)
 /* Contents are in TREE_VECTOR_CST_ELTS field.  */
 DEFTREECODE (VECTOR_CST, "vector_cst", 'c', 0)     
 
-/* Contents are TREE_STRING_LENGTH and TREE_STRING_POINTER fields. */
+/* Contents are TREE_STRING_LENGTH and TREE_STRING_POINTER fields.  */
 DEFTREECODE (STRING_CST, "string_cst", 'c', 0)
 
 /* Declarations.  All references to names are represented as ..._DECL
@@ -509,7 +509,8 @@ DEFTREECODE (CLEANUP_POINT_EXPR, "cleanup_point_expr", 'e', 1)
    some field in an object of the type contains a value that is used in
    the computation of another field's offset or size and/or the size of
    the type.  The positions and/or sizes of fields can vary from object
-   to object of the same type.
+   to object of the same type or even for one and the same object within
+   its scope.
 
    Record types with discriminants in Ada or schema types in Pascal are
    examples of such types.  This mechanism is also used to create "fat
@@ -533,7 +534,16 @@ DEFTREECODE (CLEANUP_POINT_EXPR, "cleanup_point_expr", 'e', 1)
    For example, if your type FOO is a RECORD_TYPE with a field BAR,
    and you need the value of <variable>.BAR to calculate TYPE_SIZE
    (FOO), just substitute <variable> above with a PLACEHOLDER_EXPR
-   what contains both the expression we wish to
+   whose TREE_TYPE is FOO.  Then construct your COMPONENT_REF with
+   the PLACEHOLDER_EXPR as the first operand (which has the correct
+   type).  Later, when the size is needed in the program, the back-end
+   will find this PLACEHOLDER_EXPR and generate code to calculate the
+   actual size at run-time.  In the following, we describe how this
+   calculation is done.
+
+   When we wish to evaluate a size or offset, we check whether it
+   contains a PLACEHOLDER_EXPR.  If it does, we construct a
+   WITH_RECORD_EXPR that contains both the expression we wish to
    evaluate and an expression within which the object may be found.
    The latter expression is the object itself in the simple case of an
    Ada record with discriminant, but it can be the array in the case of
@@ -615,13 +625,6 @@ DEFTREECODE (MAX_EXPR, "max_expr", '2', 2)
    operand of the ABS_EXPR must have the same type.  */
 DEFTREECODE (ABS_EXPR, "abs_expr", '1', 1)
 
-/* Bit scanning and counting.  */
-DEFTREECODE (FFS_EXPR, "ffs_expr", '1', 1)
-DEFTREECODE (CLZ_EXPR, "clz_expr", '1', 1)
-DEFTREECODE (CTZ_EXPR, "ctz_expr", '1', 1)
-DEFTREECODE (POPCOUNT_EXPR, "popcount_expr", '1', 1)
-DEFTREECODE (PARITY_EXPR, "parity_expr", '1', 1)
-
 /* Shift operations for shift and rotate.
    Shift means logical shift if done on an
    unsigned type, arithmetic shift if done on a signed type.
@@ -638,7 +641,6 @@ DEFTREECODE (RROTATE_EXPR, "rrotate_expr", '2', 2)
 DEFTREECODE (BIT_IOR_EXPR, "bit_ior_expr", '2', 2)
 DEFTREECODE (BIT_XOR_EXPR, "bit_xor_expr", '2', 2)
 DEFTREECODE (BIT_AND_EXPR, "bit_and_expr", '2', 2)
-DEFTREECODE (BIT_ANDTC_EXPR, "bit_andtc_expr", '2', 2)
 DEFTREECODE (BIT_NOT_EXPR, "bit_not_expr", '1', 1)
 
 /* ANDIF and ORIF allow the second operand not to be computed if the
@@ -728,11 +730,15 @@ DEFTREECODE (UNSAVE_EXPR, "unsave_expr", 'e', 1)
 /* Represents something whose RTL has already been expanded as a
    sequence which should be emitted when this expression is expanded.
    The first operand is the RTL to emit.  It is the first of a chain
-   of insns.  The second is the RTL expression for the result.  Any
-   temporaries created during the building of the RTL_EXPR can be
-   reused once the RTL_EXPR has been expanded, with the exception of
-   the RTL_EXPR_RTL.  */
-DEFTREECODE (RTL_EXPR, "rtl_expr", 'e', 2)
+   of insns.  The second is the RTL expression for the result.  The
+   third operand is the "alternate RTL expression" for the result, if
+   any; if the second argument is the DECL_RTL for a VAR_DECL, but
+   with an invalid memory address replaced by a valid one, then the
+   third operand will be the original DECL_RTL.  Any temporaries
+   created during the building of the RTL_EXPR can be reused once the
+   RTL_EXPR has been expanded, with the exception of the
+   RTL_EXPR_RTL.  */
+DEFTREECODE (RTL_EXPR, "rtl_expr", 'e', 3)
 
 /* & in C.  Value is the address at which the operand's value resides.
    Operand may have any mode.  Result mode is Pmode.  */