diff options
author | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-08-17 07:20:23 +0000 |
---|---|---|
committer | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-08-17 07:20:23 +0000 |
commit | f27113ad7a3e8b2f459099232400cf6b89c73c0f (patch) | |
tree | 02a98d02c1fee04e97404727ee0a9ba29d3cdada | |
parent | 26d63a159d54af4ed2b66eff1adaf4b1443e356f (diff) | |
download | gcc-f27113ad7a3e8b2f459099232400cf6b89c73c0f.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@28733 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/cp/ChangeLog | 14 | ||||
-rw-r--r-- | gcc/cp/cp-tree.h | 12 | ||||
-rw-r--r-- | gcc/cp/decl.c | 10 | ||||
-rw-r--r-- | gcc/cp/decl2.c | 6 | ||||
-rw-r--r-- | gcc/cp/lex.c | 15 | ||||
-rw-r--r-- | gcc/cp/pt.c | 9 | ||||
-rw-r--r-- | gcc/cp/tree.c | 9 |
7 files changed, 51 insertions, 24 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index cf9a35799da..da75c334d44 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,17 @@ +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. diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index 1de0e310c62..91ce27299d2 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -2150,6 +2150,18 @@ extern int flag_new_for_scope; #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 }; diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index dee05d3cc18..d5fcbeae89d 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -9002,7 +9002,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist) 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 @@ -9012,7 +9012,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist) tree attributes, prefix_attributes; *next = TREE_OPERAND (decl, 0); - init = TREE_OPERAND (decl, 1); + init = CALL_DECLARATOR_PARMS (decl); if (attrlist) { @@ -10023,7 +10023,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, 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. @@ -10053,10 +10053,10 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist) 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. */ diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index e4d2d0e1120..7e0e23b6a64 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -1590,7 +1590,7 @@ grokfield (declarator, declspecs, init, asmspec_tree, attrlist) && 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); @@ -3733,7 +3733,7 @@ reparse_absdcl_as_casts (decl, expr) 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); @@ -3747,7 +3747,7 @@ reparse_absdcl_as_casts (decl, expr) 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); } diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c index f641dc60f90..acff58fed37 100644 --- a/gcc/cp/lex.c +++ b/gcc/cp/lex.c @@ -228,8 +228,15 @@ tree 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; } @@ -237,8 +244,8 @@ void 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; } /* Build names and nodes for overloaded operators. */ diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 674834b9ae0..cf2050ab20d 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -6800,15 +6800,16 @@ tsubst (t, args, complain, in_decl) { 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: diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index b9732b3a738..61ad108213b 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -1921,14 +1921,7 @@ mapcar (t, func) 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: |