* cp-tree.h (CALL_DECLARATOR_PARMS): New macro.
(CALL_DECLARATOR_QUALS): Likewise.
(CALL_DECARATOR_EXCEPTION_SPEC): Likewise.
* decl.c (grokdeclarator): Adjust to use them.
* decl2.c (grokfield): Likewise.
(reparse_absdcl_as_casts): Likewise.
* lex.c (make_call_declarator): Likewise.
(set_quals_and_spec): Likewise.
* pt.c (tsubst): Likewise.
* tree.c (mapcar): Remove special hack to handle third operand of
a CALL_EXPR.
From-SVN: r28733
+1999-08-17 Mark Mitchell <mark@codesourcery.com>
+
+ * cp-tree.h (CALL_DECLARATOR_PARMS): New macro.
+ (CALL_DECLARATOR_QUALS): Likewise.
+ (CALL_DECARATOR_EXCEPTION_SPEC): Likewise.
+ * decl.c (grokdeclarator): Adjust to use them.
+ * decl2.c (grokfield): Likewise.
+ (reparse_absdcl_as_casts): Likewise.
+ * lex.c (make_call_declarator): Likewise.
+ (set_quals_and_spec): Likewise.
+ * pt.c (tsubst): Likewise.
+ * tree.c (mapcar): Remove special hack to handle third operand of
+ a CALL_EXPR.
+
1999-08-16 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (CAN_HAVE_FULL_LANG_DECL_P): New macro.
#define STMT_LINENO(NODE) \
(TREE_COMPLEXITY ((NODE)))
+/* The parameters for a call-declarator. */
+#define CALL_DECLARATOR_PARMS(NODE) \
+ (TREE_PURPOSE (TREE_OPERAND ((NODE), 1)))
+
+/* The cv-qualifiers for a call-declarator. */
+#define CALL_DECLARATOR_QUALS(NODE) \
+ (TREE_VALUE (TREE_OPERAND ((NODE), 1)))
+
+/* The exception-specification for a call-declarator. */
+#define CALL_DECLARATOR_EXCEPTION_SPEC(NODE) \
+ (TREE_TYPE ((NODE)))
+
/* An enumeration of the kind of tags that C++ accepts. */
enum tag_types { record_type, class_type, union_type, enum_type };
break;
case CALL_EXPR:
- if (parmlist_is_exprlist (TREE_OPERAND (decl, 1)))
+ if (parmlist_is_exprlist (CALL_DECLARATOR_PARMS (decl)))
{
/* This is actually a variable declaration using
constructor syntax. We need to call start_decl and
tree attributes, prefix_attributes;
*next = TREE_OPERAND (decl, 0);
- init = TREE_OPERAND (decl, 1);
+ init = CALL_DECLARATOR_PARMS (decl);
if (attrlist)
{
{
tree arg_types;
int funcdecl_p;
- tree inner_parms = TREE_OPERAND (declarator, 1);
+ tree inner_parms = CALL_DECLARATOR_PARMS (declarator);
tree inner_decl = TREE_OPERAND (declarator, 0);
/* Declaring a function type.
inner_decl = dname;
/* Pick up type qualifiers which should be applied to `this'. */
- quals = TREE_OPERAND (declarator, 2);
+ quals = CALL_DECLARATOR_QUALS (declarator);
/* Pick up the exception specifications. */
- raises = TREE_TYPE (declarator);
+ raises = CALL_DECLARATOR_EXCEPTION_SPEC (declarator);
/* Say it's a definition only for the CALL_EXPR
closest to the identifier. */
&& TREE_OPERAND (declarator, 0)
&& (TREE_CODE (TREE_OPERAND (declarator, 0)) == IDENTIFIER_NODE
|| TREE_CODE (TREE_OPERAND (declarator, 0)) == SCOPE_REF)
- && parmlist_is_exprlist (TREE_OPERAND (declarator, 1)))
+ && parmlist_is_exprlist (CALL_DECLARATOR_PARMS (declarator)))
{
init = TREE_OPERAND (declarator, 1);
declarator = TREE_OPERAND (declarator, 0);
if (TREE_CODE (expr) == CONSTRUCTOR
&& TREE_TYPE (expr) == 0)
{
- type = groktypename (TREE_VALUE (TREE_OPERAND (decl, 1)));
+ type = groktypename (TREE_VALUE (CALL_DECLARATOR_PARMS (decl)));
decl = TREE_OPERAND (decl, 0);
expr = digest_init (type, expr, (tree *) 0);
while (decl)
{
- type = groktypename (TREE_VALUE (TREE_OPERAND (decl, 1)));
+ type = groktypename (TREE_VALUE (CALL_DECLARATOR_PARMS (decl)));
decl = TREE_OPERAND (decl, 0);
expr = build_c_cast (type, expr);
}
make_call_declarator (target, parms, cv_qualifiers, exception_specification)
tree target, parms, cv_qualifiers, exception_specification;
{
- target = build_parse_node (CALL_EXPR, target, parms, cv_qualifiers);
- TREE_TYPE (target) = exception_specification;
+ target = build_parse_node (CALL_EXPR, target,
+ /* Both build_parse_node and
+ decl_tree_cons build on the
+ temp_decl_obstack. */
+ decl_tree_cons (parms, cv_qualifiers, NULL_TREE),
+ /* The third operand is really RTL. We
+ shouldn't put anything there. */
+ NULL_TREE);
+ CALL_DECLARATOR_EXCEPTION_SPEC (target) = exception_specification;
return target;
}
set_quals_and_spec (call_declarator, cv_qualifiers, exception_specification)
tree call_declarator, cv_qualifiers, exception_specification;
{
- TREE_OPERAND (call_declarator, 2) = cv_qualifiers;
- TREE_TYPE (call_declarator) = exception_specification;
+ CALL_DECLARATOR_QUALS (call_declarator) = cv_qualifiers;
+ CALL_DECLARATOR_EXCEPTION_SPEC (call_declarator) = exception_specification;
}
\f
/* Build names and nodes for overloaded operators. */
{
tree e1 = tsubst (TREE_OPERAND (t, 0), args, complain,
in_decl);
- tree e2 = tsubst_call_declarator_parms (TREE_OPERAND (t, 1), args,
- complain, in_decl);
- tree e3 = tsubst (TREE_TYPE (t), args, complain, in_decl);
+ tree e2 = (tsubst_call_declarator_parms
+ (CALL_DECLARATOR_PARMS (t), args, complain, in_decl));
+ tree e3 = tsubst (CALL_DECLARATOR_EXCEPTION_SPEC (t), args,
+ complain, in_decl);
if (e1 == error_mark_node || e2 == error_mark_node
|| e3 == error_mark_node)
return error_mark_node;
- return make_call_declarator (e1, e2, TREE_OPERAND (t, 2), e3);
+ return make_call_declarator (e1, e2, CALL_DECLARATOR_QUALS (t), e3);
}
case SCOPE_REF:
TREE_TYPE (t) = mapcar (TREE_TYPE (t), func);
TREE_OPERAND (t, 0) = mapcar (TREE_OPERAND (t, 0), func);
TREE_OPERAND (t, 1) = mapcar (TREE_OPERAND (t, 1), func);
-
- /* tree.def says that operand two is RTL, but
- make_call_declarator puts trees in there. */
- if (TREE_OPERAND (t, 2)
- && TREE_CODE (TREE_OPERAND (t, 2)) == TREE_LIST)
- TREE_OPERAND (t, 2) = mapcar (TREE_OPERAND (t, 2), func);
- else
- TREE_OPERAND (t, 2) = NULL_TREE;
+ TREE_OPERAND (t, 2) = NULL_TREE;
return t;
case SAVE_EXPR: