Fix copyrights
[gcc.git] / gcc / cp / cp-tree.def
index 25c64bfe0b1b7e9b217c5762e055e1848f036540..4f826ab053c19dac2def8ce156575e4ec41f17c3 100644 (file)
@@ -1,7 +1,8 @@
 /* This file contains the definitions and documentation for the
    additional tree codes used in the GNU C++ compiler (see tree.def
    for the standard codes).
-   Copyright (C) 1987, 1988, 1990, 1993 Free Software Foundation, Inc.
+   Copyright (C) 1987, 1988, 1990, 1993, 1997, 1998,
+   1999, 2000 Free Software Foundation, Inc.
    Hacked by Michael Tiemann (tiemann@cygnus.com)
 
 This file is part of GNU CC.
@@ -29,6 +30,11 @@ Boston, MA 02111-1307, USA.  */
    just won't work for us.  */
 DEFTREECODE (OFFSET_REF, "offset_ref", 'r', 2)
 
+/* A pointer-to-member constant.  For a pointer-to-member constant
+   `X::Y' The PTRMEM_CST_CLASS is the RECORD_TYPE for `X' and the
+   PTRMEM_CST_MEMBER is the _DECL for `Y'.  */
+DEFTREECODE (PTRMEM_CST, "ptrmem_cst", 'c', 2)
+
 /* For NEW_EXPR, operand 0 is the placement list.
    Operand 1 is the new-declarator.
    Operand 2 is the initializer.  */
@@ -65,10 +71,9 @@ DEFTREECODE (AGGR_INIT_EXPR, "aggr_init_expr", 'e', 3)
    else it is NULL_TREE.  */
 DEFTREECODE (THROW_EXPR, "throw_expr", 'e', 1)
 
-/* Initialization of a vector, used in build_new.  Operand 0 is the target
-   of the initialization, operand 1 is the initializer, and operand 2 is
-   the number of elements.  */
-DEFTREECODE (VEC_INIT_EXPR, "vec_init_expr", 'e', 3)
+/* An empty class object.  The TREE_TYPE gives the class type.  We use
+   these to avoid actually creating instances of the empty classes.  */
+DEFTREECODE (EMPTY_CLASS_EXPR, "empty_class_expr", 'e', 0)
 
 /* Template definition.  The following fields have the specified uses,
    although there are other macros in cp-tree.h that should be used for
@@ -121,12 +126,15 @@ DEFTREECODE (TEMPLATE_DECL, "template_decl", 'd', 0)
    the types of things; the ORIG_LEVEL is the level when we are
    worrying about instantiating things.  */
 DEFTREECODE (TEMPLATE_PARM_INDEX, "template_parm_index", 'x', 
-            /* The addition of (sizeof(char*) - 1) in the next
-               expression is to ensure against the case where
-               sizeof(char*) does not evenly divide
-               sizeof(HOST_WIDE_INT).  */
-            2 + ((3 * sizeof (HOST_WIDE_INT) + sizeof(char*) - 1)
-                 / sizeof (char*)))
+            /* The addition of (sizeof(tree) - 1) in the next expression
+               is to handle the case when padding pushes us past an even
+               multiple of sizeof(tree).  */
+            /* We used to try to calculate this using
+               1+3*sizeof(HOST_WIDE_INT), but that fails if alignment
+               makes it bigger.  */
+            ((sizeof (template_parm_index) - sizeof (struct tree_common))
+             + sizeof (tree) - 1)
+            / sizeof (tree))
 
 /* Index into a template parameter list.  This parameter must be a type.
    The TYPE_FIELDS value will be a TEMPLATE_PARM_INDEX.  */
@@ -138,17 +146,36 @@ DEFTREECODE (TEMPLATE_TYPE_PARM, "template_type_parm", 't', 0)
    The TYPE_FIELDS value will be a TEMPLATE_PARM_INDEX.  */
 DEFTREECODE (TEMPLATE_TEMPLATE_PARM, "template_template_parm", 't', 0)
 
-/* A type designated by 'typename T::t'. */
+/* A type designated by `typename T::t'.  TYPE_CONTEXT is `T',
+   TYPE_NAME is an IDENTIFIER_NODE for `t'.  If the type was named via
+   template-id, TYPENAME_TYPE_FULLNAME will hold the TEMPLATE_ID_EXPR.
+   If TREE_TYPE is present, this type was generated by the implicit
+   typename extension, and the TREE_TYPE is a _TYPE from a baseclass
+   of `T'.  */
 DEFTREECODE (TYPENAME_TYPE, "typename_type", 't', 0)
 
+/* A type designated by `__typeof (expr)'.  TYPE_FIELDS is the
+   expression in question.  */
+DEFTREECODE (TYPEOF_TYPE, "typeof_type", 't', 0)
+
 /* A thunk is a stub function.
 
-   Thunks are used to implement multiple inheritance:
-   At run-time, such a thunk subtracts THUNK_DELTA (an int, not a tree)
-   from the this pointer, and then jumps to DECL_INITIAL
-   (which is an ADDR_EXPR whose operand is a FUNCTION_DECL).
+   A THUNK_DECL is an alternate entry point for an ordinary
+   FUNCTION_DECL.  It's job is to adjust the `this' poitner before
+   transferring control to the FUNCTION_DECL.
+
+   A thunk may perform either, or both, of the following operations:
 
-   Other kinds of thunks may be defined later. */
+   o Adjust the `this' pointer by a constant offset.
+   o Adjust the `this' pointer by looking up a vcall-offset
+     in the vtable.
+
+   If both operations are performed, then the constant adjument to
+   `this' is performed first.
+
+   The constant adjustment is given by THUNK_DELTA.  If the
+   vcall-offset is required, the index into the vtable is given by
+   THUNK_VCALL_OFFSET.  */
 DEFTREECODE (THUNK_DECL, "thunk_decl", 'd', 0)
 
 /* A using declaration.  DECL_INITIAL contains the specified scope.  
@@ -158,25 +185,40 @@ DEFTREECODE (USING_DECL, "using_decl", 'd', 0)
 /* An un-parsed default argument.  Looks like an IDENTIFIER_NODE.  */
 DEFTREECODE (DEFAULT_ARG, "default_arg", 'c', 2)
 
-/* A template-id, like foo<int>.  The first operand is the template.  
-   The second is the list of explicitly specified arguments.  The 
-   template will be a FUNCTION_DECL, TEMPLATE_DECL, or a list of
-   overloaded functions and templates if the template-id refers to
-   a global template.  If the template-id refers to a member template,
-   the template will will be an IDENTIFIER_NODE.  */
+/* A template-id, like foo<int>.  The first operand is the template.
+   The second is the TREE_LIST or TREE_VEC of explicitly specified
+   arguments.  The template will be a FUNCTION_DECL, TEMPLATE_DECL, or
+   an OVERLOAD.  If the template-id refers to a member template, the
+   template may be an IDENTIFIER_NODE.  */
 DEFTREECODE (TEMPLATE_ID_EXPR, "template_id_expr", 'e', 2)
 
-/* has two fields: scope and value */
-/* XXX: could recycle some of the common fields */
+/* An association between name and entity. Parameters are the scope
+   and the (non-type) value.  TREE_TYPE indicates the type bound to
+   the name. */
 DEFTREECODE (CPLUS_BINDING, "binding", 'x', 2)
 
+/* A list-like node for chaining overloading candidates. TREE_TYPE is 
+   the original name, and the parameter is the FUNCTION_DECL.  */
+DEFTREECODE (OVERLOAD, "overload", 'x', 1)
+
 /* A generic wrapper for something not tree that we want to include in
    tree structure.  */
 DEFTREECODE (WRAPPER, "wrapper", 'x', 1)
 
+/* A node to remember a source position.  */
+DEFTREECODE (SRCLOC, "srcloc", 'x', 2)
+
+/* Used to represent deferred name lookup for dependent names while
+   parsing a template declaration.  The first argument is an
+   IDENTIFIER_NODE for the name in question.  The TREE_TYPE is
+   unused.  */
+DEFTREECODE (LOOKUP_EXPR, "lookup_expr", 'e', 1)
+
+/* Used to represent __PRETTY_FUNCTION__ in template bodies.  */
+DEFTREECODE (FUNCTION_NAME, "function_name", 'e', 0)
+
 /* A whole bunch of tree codes for the initial, superficial parsing of
    templates.  */
-DEFTREECODE (LOOKUP_EXPR, "lookup_expr", 'e', 2)
 DEFTREECODE (MODOP_EXPR, "modop_expr", 'e', 3)
 DEFTREECODE (CAST_EXPR, "cast_expr", '1', 1)
 DEFTREECODE (REINTERPRET_CAST_EXPR, "reinterpret_cast_expr", '1', 1)
@@ -188,10 +230,11 @@ DEFTREECODE (ALIGNOF_EXPR, "alignof_expr", '1', 1)
 DEFTREECODE (ARROW_EXPR, "arrow_expr", 'e', 1)
 DEFTREECODE (DOTSTAR_EXPR, "dotstar_expr", 'e', 2)
 DEFTREECODE (TYPEID_EXPR, "typeid_expr", 'e', 1)
+DEFTREECODE (PSEUDO_DTOR_EXPR, "pseudo_dtor_expr", 'e', 3)
 
 DEFTREECODE (EXPR_STMT, "expr_stmt", 'e', 1)
 DEFTREECODE (COMPOUND_STMT, "compound_stmt", 'e', 1)
-DEFTREECODE (DECL_STMT, "decl_stmt", 'e', 3)
+DEFTREECODE (DECL_STMT, "decl_stmt", 'e', 1)
 DEFTREECODE (IF_STMT, "if_stmt", 'e', 3)
 DEFTREECODE (FOR_STMT, "for_stmt", 'e', 4)
 DEFTREECODE (WHILE_STMT, "while_stmt", 'e', 2)
@@ -201,13 +244,42 @@ DEFTREECODE (BREAK_STMT, "break_stmt", 'e', 0)
 DEFTREECODE (CONTINUE_STMT, "continue_stmt", 'e', 0)
 DEFTREECODE (SWITCH_STMT, "switch_stmt", 'e', 2)
 DEFTREECODE (GOTO_STMT, "goto_stmt", 'e', 1)
+DEFTREECODE (LABEL_STMT, "label_stmt", 'e', 1)
 DEFTREECODE (ASM_STMT, "asm_stmt", 'e', 5)
-
+/* A SUBOBJECT statement marks the point at which a sub-object is
+   fully constructed.  After this point, the SUBOBJECT_CLEANUP must be
+   run if an exception is thrown before the end of the enclosing
+   function.  */
+DEFTREECODE (SUBOBJECT, "subobject", 'e', 1)
+/* An CTOR_STMT marks the beginning (if CTOR_BEGIN_P holds) or end of
+   a contstructor (if CTOR_END_P) holds.  At the end of a constructor,
+   the cleanups associated with any SUBOBJECT_CLEANUPS need no longer
+   be run.  */
+DEFTREECODE (CTOR_STMT, "ctor_stmt", 'e', 0)
+/* A CLEANUP_STMT marks the point at which a declaration is fully
+   constructed.  If, after this point, the CLEANUP_DECL goes out of
+   scope, the CLEANUP_EXPR must be run.  */
+DEFTREECODE (CLEANUP_STMT, "cleanup_stmt", 'e', 2)
+/* A START_CATCH_STMT marks the beginning of a catch handler for the
+   the START_CATCH_TYPE.  If this is CATCH_ALL_TYPE, then the handler
+   catches all types.  */
+DEFTREECODE (START_CATCH_STMT, "start_catch_stmt", 'e', 0)
+/* A SCOPE_STMT marks the beginning or end of a scope.  If
+   SCOPE_BEGIN_P holds, then this is the start of a scope.  If
+   SCOPE_END_P holds, then this is the end of a scope.  If
+   SCOPE_NULLIFIED_P holds then there turned out to be no variables in
+   this scope.  The SCOPE_STMT_BLOCK is the BLOCK containing the
+   variables declared in this scope.  */
+DEFTREECODE (SCOPE_STMT, "scope_stmt", 'e', 1)
 DEFTREECODE (CTOR_INITIALIZER, "ctor_initializer", 'e', 2)
 DEFTREECODE (CASE_LABEL, "case_label", 'e', 2)
 DEFTREECODE (RETURN_INIT, "return_init", 'e', 2)
-DEFTREECODE (TRY_BLOCK, "try_stmt", 'e', 2)
-DEFTREECODE (HANDLER, "catch_stmt", 'e', 2)
+DEFTREECODE (TRY_BLOCK, "try_block", 'e', 2)
+DEFTREECODE (HANDLER, "handler", 'e', 2)
+
+/* A STMT_EXPR represents a statement-expression.  The
+   STMT_EXPR_STMT is the statement given by the expression.  */
+DEFTREECODE (STMT_EXPR, "stmt_expr", 'e', 1)
 
 DEFTREECODE (TAG_DEFN, "tag_defn", 'e', 0)