summaryrefslogtreecommitdiffstats
path: root/contrib/gcc/cp/cp-tree.def
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/gcc/cp/cp-tree.def')
-rw-r--r--contrib/gcc/cp/cp-tree.def85
1 files changed, 42 insertions, 43 deletions
diff --git a/contrib/gcc/cp/cp-tree.def b/contrib/gcc/cp/cp-tree.def
index cee19ab..36b7aaa 100644
--- a/contrib/gcc/cp/cp-tree.def
+++ b/contrib/gcc/cp/cp-tree.def
@@ -1,24 +1,24 @@
/* 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, 1997, 1998,
- 1999, 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1987, 1988, 1990, 1993, 1997, 1998, 2003,
+ 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
Hacked by Michael Tiemann (tiemann@cygnus.com)
-This file is part of GNU CC.
+This file is part of GCC.
-GNU CC is free software; you can redistribute it and/or modify
+GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
-GNU CC is distributed in the hope that it will be useful,
+GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
+along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
@@ -26,28 +26,28 @@ Boston, MA 02111-1307, USA. */
/* An OFFSET_REF is used in two situations:
1. An expression of the form `A::m' where `A' is a class and `m' is
- a non-static data member. In this case, operand 0 will be a
- TYPE (corresponding to `A') and operand 1 will be a FIELD_DECL
- (corresponding to `m'.
+ a non-static member. In this case, operand 0 will be a TYPE
+ (corresponding to `A') and operand 1 will be a FIELD_DECL,
+ BASELINK, or TEMPLATE_ID_EXPR (corresponding to `m').
The expression is a pointer-to-member if its address is taken,
but simply denotes a member of the object if its address isnot
taken. In the latter case, resolve_offset_ref is used to
convert it to a representation of the member referred to by the
OFFSET_REF.
+
+ This form is only used during the parsing phase; once semantic
+ analysis has taken place they are eliminated.
2. An expression of the form `x.*p'. In this case, operand 0 will
be an expression corresponding to `x' and operand 1 will be an
- expression with pointer-to-member type.
-
- OFFSET_REFs are only used during the parsing phase; once semantic
- analysis has taken place they are eliminated. */
+ expression with pointer-to-member type. */
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)
+DEFTREECODE (PTRMEM_CST, "ptrmem_cst", 'c', 0)
/* For NEW_EXPR, operand 0 is the placement list.
Operand 1 is the new-declarator.
@@ -62,8 +62,7 @@ DEFTREECODE (DELETE_EXPR, "dl_expr", 'e', 2)
DEFTREECODE (VEC_DELETE_EXPR, "vec_dl_expr", 'e', 2)
/* Value is reference to particular overloaded class method.
- Operand 0 is the class name (an IDENTIFIER_NODE);
- operand 1 is the field (also an IDENTIFIER_NODE).
+ Operand 0 is the class, operand 1 is the field
The COMPLEXITY field holds the class level (usually 0). */
DEFTREECODE (SCOPE_REF, "scope_ref", 'r', 2)
@@ -89,6 +88,10 @@ DEFTREECODE (THROW_EXPR, "throw_expr", 'e', 1)
these to avoid actually creating instances of the empty classes. */
DEFTREECODE (EMPTY_CLASS_EXPR, "empty_class_expr", 'e', 0)
+/* A DECL which is really just a placeholder for an expression. Used to
+ implement non-class scope anonymous unions. */
+DEFTREECODE (ALIAS_DECL, "alias_decl", 'd', 0)
+
/* A reference to a member function or member functions from a base
class. BASELINK_FUNCTIONS gives the FUNCTION_DECL,
TEMPLATE_DECL, OVERLOAD, or TEMPLATE_ID_EXPR corresponding to the
@@ -101,7 +104,7 @@ DEFTREECODE (EMPTY_CLASS_EXPR, "empty_class_expr", 'e', 0)
the type of the expression. This type is either a FUNCTION_TYPE,
METHOD_TYPE, or `unknown_type_node' indicating that the function is
overloaded. */
-DEFTREECODE (BASELINK, "baselink", 'e', 3)
+DEFTREECODE (BASELINK, "baselink", 'x', 0)
/* Template definition. The following fields have the specified uses,
although there are other macros in cp-tree.h that should be used for
@@ -153,16 +156,7 @@ DEFTREECODE (TEMPLATE_DECL, "template_decl", 'd', 0)
The LEVEL is the level of the parameter when we are worrying about
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(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))
+DEFTREECODE (TEMPLATE_PARM_INDEX, "template_parm_index", 'x', 0)
/* Index into a template parameter list. This parameter must be a type.
The TYPE_FIELDS value will be a TEMPLATE_PARM_INDEX. */
@@ -201,36 +195,31 @@ DEFTREECODE (UNBOUND_CLASS_TEMPLATE, "unbound_class_template", 't', 0)
DEFTREECODE (TYPEOF_TYPE, "typeof_type", 't', 0)
/* A using declaration. DECL_INITIAL contains the specified scope.
- This is not an alias, but is later expanded into multiple aliases. */
+ This is not an alias, but is later expanded into multiple aliases.
+ The decl will have a NULL_TYPE iff the scope is a dependent scope,
+ otherwise it will have a void type. */
DEFTREECODE (USING_DECL, "using_decl", 'd', 0)
/* A using directive. The operand is USING_STMT_NAMESPACE. */
DEFTREECODE (USING_STMT, "using_directive", 'e', 1)
/* An un-parsed default argument. Looks like an IDENTIFIER_NODE. */
-DEFTREECODE (DEFAULT_ARG, "default_arg", 'x', 2)
+DEFTREECODE (DEFAULT_ARG, "default_arg", 'x', 0)
/* 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. In an uninstantiated template,
- the template may be a LOOKUP_EXPR. */
+ The second is NULL if there are no explicit arguments, or a
+ TREE_VEC of 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)
/* 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)
+DEFTREECODE (OVERLOAD, "overload", 'x', 0)
/* A generic wrapper for something not tree that we want to include in
tree structure. */
-DEFTREECODE (WRAPPER, "wrapper", 'x', 1)
-
-/* 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)
+DEFTREECODE (WRAPPER, "wrapper", 'x', 0)
/* A whole bunch of tree codes for the initial, superficial parsing of
templates. */
@@ -244,10 +233,20 @@ DEFTREECODE (DOTSTAR_EXPR, "dotstar_expr", 'e', 2)
DEFTREECODE (TYPEID_EXPR, "typeid_expr", 'e', 1)
DEFTREECODE (PSEUDO_DTOR_EXPR, "pseudo_dtor_expr", 'e', 3)
+/* A placeholder for an expression that is not type-dependent, but
+ does occur in a template. When an expression that is not
+ type-dependent appears in a larger expression, we must compute the
+ type of that larger expression. That computation would normally
+ modify the original expression, which would change the mangling of
+ that expression if it appeared in a template argument list. In
+ that situation, we create a NON_DEPENDENT_EXPR to take the place of
+ the original expression. The expression is the only operand -- it
+ is only needed for diagnostics. */
+DEFTREECODE (NON_DEPENDENT_EXPR, "non_dependent_expr", 'e', 1)
+
/* CTOR_INITIALIZER is a placeholder in template code for a call to
setup_vtbl_pointer (and appears in all functions, not just ctors). */
DEFTREECODE (CTOR_INITIALIZER, "ctor_initializer", 'e', 1)
-DEFTREECODE (RETURN_INIT, "return_init", 'e', 2)
DEFTREECODE (TRY_BLOCK, "try_block", 'e', 2)
DEFTREECODE (EH_SPEC_BLOCK, "eh_spec_block", 'e', 2)
/* A HANDLER wraps a catch handler for the HANDLER_TYPE. If this is
OpenPOWER on IntegriCloud