Commit a2982c1b by Richard Kenner Committed by Richard Kenner

cp-tree.def (TEMPLATE_TYPE_PARM, [...]): Update comments.

	* cp-tree.def (TEMPLATE_TYPE_PARM, TYPEOF_TYPE): Update comments.
	* cp-tree.h (NEW_EXPR_USE_GLOBAL, DELETE_EXPR_USE_GLOBAL): Add check.
	(DELETE_EXPR_USE_VEC, COMPOUND_EXPR_OVERLOADED): Likewise.
	(KOENIG_LOOKUP_P, PTRMEM_OK_P, TEMPLATE_TYPE_PARM_INDEX): Likewise.
	(TYPENAME_TYPE_FULLNAME): Add check and use type.values.
	(TYPEOF_TYPE_EXPR): New macro.

From-SVN: r79645
parent d3b6a5fb
2004-03-18 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> 2004-03-18 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* cp-tree.def (TEMPLATE_TYPE_PARM, TYPEOF_TYPE): Update comments.
* cp-tree.h (NEW_EXPR_USE_GLOBAL, DELETE_EXPR_USE_GLOBAL): Add check.
(DELETE_EXPR_USE_VEC, COMPOUND_EXPR_OVERLOADED): Likewise.
(KOENIG_LOOKUP_P, PTRMEM_OK_P, TEMPLATE_TYPE_PARM_INDEX): Likewise.
(TYPENAME_TYPE_FULLNAME): Add check and use type.values.
(TYPEOF_TYPE_EXPR): New macro.
* class.c (finish_struct_bits): Use TYPE_VFIELD and TYPE_METHODS. * class.c (finish_struct_bits): Use TYPE_VFIELD and TYPE_METHODS.
* error.c (dump_type): Use TYPEOF_TYPE_EXPR. * error.c (dump_type): Use TYPEOF_TYPE_EXPR.
* pt.c (tsubst): Likewise. * pt.c (tsubst): Likewise.
......
...@@ -159,7 +159,7 @@ DEFTREECODE (TEMPLATE_DECL, "template_decl", 'd', 0) ...@@ -159,7 +159,7 @@ DEFTREECODE (TEMPLATE_DECL, "template_decl", 'd', 0)
DEFTREECODE (TEMPLATE_PARM_INDEX, "template_parm_index", 'x', 0) DEFTREECODE (TEMPLATE_PARM_INDEX, "template_parm_index", 'x', 0)
/* Index into a template parameter list. This parameter must be a type. /* Index into a template parameter list. This parameter must be a type.
The TYPE_FIELDS value will be a TEMPLATE_PARM_INDEX. */ The type.value field will be a TEMPLATE_PARM_INDEX. */
DEFTREECODE (TEMPLATE_TYPE_PARM, "template_type_parm", 't', 0) DEFTREECODE (TEMPLATE_TYPE_PARM, "template_type_parm", 't', 0)
/* Index into a template parameter list for template template parameters. /* Index into a template parameter list for template template parameters.
...@@ -190,7 +190,7 @@ DEFTREECODE (TYPENAME_TYPE, "typename_type", 't', 0) ...@@ -190,7 +190,7 @@ DEFTREECODE (TYPENAME_TYPE, "typename_type", 't', 0)
TYPE_NAME is an IDENTIFIER_NODE for `C', the member class template. */ TYPE_NAME is an IDENTIFIER_NODE for `C', the member class template. */
DEFTREECODE (UNBOUND_CLASS_TEMPLATE, "unbound_class_template", 't', 0) DEFTREECODE (UNBOUND_CLASS_TEMPLATE, "unbound_class_template", 't', 0)
/* A type designated by `__typeof (expr)'. TYPE_FIELDS is the /* A type designated by `__typeof (expr)'. TYPEOF_TYPE_EXPR is the
expression in question. */ expression in question. */
DEFTREECODE (TYPEOF_TYPE, "typeof_type", 't', 0) DEFTREECODE (TYPEOF_TYPE, "typeof_type", 't', 0)
......
...@@ -1462,7 +1462,7 @@ struct lang_type GTY(()) ...@@ -1462,7 +1462,7 @@ struct lang_type GTY(())
/* Nonzero if this binfo is for a dependent base - one that should not /* Nonzero if this binfo is for a dependent base - one that should not
be searched. */ be searched. */
#define BINFO_DEPENDENT_BASE_P(NODE) TREE_LANG_FLAG_1(NODE) #define BINFO_DEPENDENT_BASE_P(NODE) TREE_LANG_FLAG_1 (NODE)
/* Nonzero if this binfo has lost its primary base binfo (because that /* Nonzero if this binfo has lost its primary base binfo (because that
is a nearly-empty virtual base that has been taken by some other is a nearly-empty virtual base that has been taken by some other
...@@ -2256,17 +2256,21 @@ struct lang_decl GTY(()) ...@@ -2256,17 +2256,21 @@ struct lang_decl GTY(())
(DECL_LANG_SPECIFIC (FUNCTION_DECL_CHECK (NODE)) \ (DECL_LANG_SPECIFIC (FUNCTION_DECL_CHECK (NODE)) \
->u.f.u.saved_language_function) ->u.f.u.saved_language_function)
#define NEW_EXPR_USE_GLOBAL(NODE) TREE_LANG_FLAG_0 (NODE) #define NEW_EXPR_USE_GLOBAL(NODE) \
#define DELETE_EXPR_USE_GLOBAL(NODE) TREE_LANG_FLAG_0 (NODE) TREE_LANG_FLAG_0 (NEW_EXPR_CHECK (NODE))
#define DELETE_EXPR_USE_VEC(NODE) TREE_LANG_FLAG_1 (NODE) #define DELETE_EXPR_USE_GLOBAL(NODE) \
TREE_LANG_FLAG_0 (DELETE_EXPR_CHECK (NODE))
#define DELETE_EXPR_USE_VEC(NODE) \
TREE_LANG_FLAG_1 (DELETE_EXPR_CHECK (NODE))
/* Indicates that this is a non-dependent COMPOUND_EXPR which will /* Indicates that this is a non-dependent COMPOUND_EXPR which will
resolve to a function call. */ resolve to a function call. */
#define COMPOUND_EXPR_OVERLOADED(NODE) TREE_LANG_FLAG_0 (NODE) #define COMPOUND_EXPR_OVERLOADED(NODE) \
TREE_LANG_FLAG_0 (COMPOUND_EXPR_CHECK (NODE))
/* In a CALL_EXPR appearing in a template, true if Koenig lookup /* In a CALL_EXPR appearing in a template, true if Koenig lookup
should be performed at instantiation time. */ should be performed at instantiation time. */
#define KOENIG_LOOKUP_P(NODE) TREE_LANG_FLAG_0(NODE) #define KOENIG_LOOKUP_P(NODE) TREE_LANG_FLAG_0 (CALL_EXPR_CHECK (NODE))
/* Nonzero if this AGGR_INIT_EXPR provides for initialization via a /* Nonzero if this AGGR_INIT_EXPR provides for initialization via a
constructor call, rather than an ordinary function call. */ constructor call, rather than an ordinary function call. */
...@@ -2286,7 +2290,7 @@ struct lang_decl GTY(()) ...@@ -2286,7 +2290,7 @@ struct lang_decl GTY(())
this is an IDENTIFIER_NODE, and the same as the DECL_NAME on the this is an IDENTIFIER_NODE, and the same as the DECL_NAME on the
corresponding TYPE_DECL. However, this may also be a corresponding TYPE_DECL. However, this may also be a
TEMPLATE_ID_EXPR if we had something like `typename X::Y<T>'. */ TEMPLATE_ID_EXPR if we had something like `typename X::Y<T>'. */
#define TYPENAME_TYPE_FULLNAME(NODE) (TYPE_FIELDS (NODE)) #define TYPENAME_TYPE_FULLNAME(NODE) (TYPENAME_TYPE_CHECK (NODE))->type.values
/* Nonzero in INTEGER_CST means that this int is negative by dint of /* Nonzero in INTEGER_CST means that this int is negative by dint of
using a twos-complement negated operand. */ using a twos-complement negated operand. */
...@@ -2490,7 +2494,8 @@ struct lang_decl GTY(()) ...@@ -2490,7 +2494,8 @@ struct lang_decl GTY(())
/* Indicates when overload resolution may resolve to a pointer to /* Indicates when overload resolution may resolve to a pointer to
member function. [expr.unary.op]/3 */ member function. [expr.unary.op]/3 */
#define PTRMEM_OK_P(NODE) TREE_LANG_FLAG_0 (NODE) #define PTRMEM_OK_P(NODE) \
TREE_LANG_FLAG_0 (TREE_CHECK2 ((NODE), ADDR_EXPR, OFFSET_REF))
/* Get the POINTER_TYPE to the METHOD_TYPE associated with this /* Get the POINTER_TYPE to the METHOD_TYPE associated with this
pointer to member function. TYPE_PTRMEMFUNC_P _must_ be true, pointer to member function. TYPE_PTRMEMFUNC_P _must_ be true,
...@@ -2544,6 +2549,9 @@ struct lang_decl GTY(()) ...@@ -2544,6 +2549,9 @@ struct lang_decl GTY(())
`Y'. */ `Y'. */
#define PTRMEM_CST_MEMBER(NODE) (((ptrmem_cst_t)PTRMEM_CST_CHECK (NODE))->member) #define PTRMEM_CST_MEMBER(NODE) (((ptrmem_cst_t)PTRMEM_CST_CHECK (NODE))->member)
/* The expression in question for a TYPEOF_TYPE. */
#define TYPEOF_TYPE_EXPR(NODE) (TYPEOF_TYPE_CHECK (NODE))->type.values
/* Nonzero for VAR_DECL and FUNCTION_DECL node means that `extern' was /* Nonzero for VAR_DECL and FUNCTION_DECL node means that `extern' was
specified in its declaration. This can also be set for an specified in its declaration. This can also be set for an
erroneously declared PARM_DECL. */ erroneously declared PARM_DECL. */
...@@ -3401,7 +3409,9 @@ enum overload_flags { NO_SPECIAL = 0, DTOR_FLAG, OP_FLAG, TYPENAME_FLAG }; ...@@ -3401,7 +3409,9 @@ enum overload_flags { NO_SPECIAL = 0, DTOR_FLAG, OP_FLAG, TYPENAME_FLAG };
/* These macros are for accessing the fields of TEMPLATE_TYPE_PARM, /* These macros are for accessing the fields of TEMPLATE_TYPE_PARM,
TEMPLATE_TEMPLATE_PARM and BOUND_TEMPLATE_TEMPLATE_PARM nodes. */ TEMPLATE_TEMPLATE_PARM and BOUND_TEMPLATE_TEMPLATE_PARM nodes. */
#define TEMPLATE_TYPE_PARM_INDEX(NODE) (TYPE_FIELDS (NODE)) #define TEMPLATE_TYPE_PARM_INDEX(NODE) \
(TREE_CHECK3 ((NODE), TEMPLATE_TYPE_PARM, TEMPLATE_TEMPLATE_PARM, \
BOUND_TEMPLATE_TEMPLATE_PARM))->type.values
#define TEMPLATE_TYPE_IDX(NODE) \ #define TEMPLATE_TYPE_IDX(NODE) \
(TEMPLATE_PARM_IDX (TEMPLATE_TYPE_PARM_INDEX (NODE))) (TEMPLATE_PARM_IDX (TEMPLATE_TYPE_PARM_INDEX (NODE)))
#define TEMPLATE_TYPE_LEVEL(NODE) \ #define TEMPLATE_TYPE_LEVEL(NODE) \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment