From 718b8ea51f0736646f9cf8a9d5eb4305a12e835e Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Mon, 29 Jan 2001 18:57:24 +0000 Subject: [PATCH] tree.c, tree.h (build_parse_node): Remove; was identical to build_nt. * tree.c, tree.h (build_parse_node): Remove; was identical to build_nt. * c-lang.c (start_cdtor), objc/objc-act.c (build_module_descriptor): Use build_nt instead of build_parse_node. cp: * decl2.c (build_expr_from_tree), lex.c (make_pointer_declarator, make_reference_declarator, make_call_declarator), method.c (implicitly_declare_fn), parse.y (namespace_using_decl, notype_unqualified_id, expr_or_declarator, new_type_id, after_type_declarator, direct_after_type_declarator, notype_declarator, complex_notype_declarator, complex_direct_notype_declarator, qualified_id, notype_qualified_id, overqualified_id, direct_new_declarator, absdcl, direct_abstract_declarator, conversion_declarator), pt.c (tsubst), semantics.c (begin_constructor_declarator): Use build_nt instead of build_parse_node. From-SVN: r39332 --- gcc/ChangeLog | 8 ++++++ gcc/c-lang.c | 7 +++-- gcc/cp/ChangeLog | 14 ++++++++++ gcc/cp/decl2.c | 4 +-- gcc/cp/lex.c | 14 +++++----- gcc/cp/method.c | 4 +-- gcc/cp/parse.y | 66 ++++++++++++++++++++++----------------------- gcc/cp/pt.c | 4 +-- gcc/cp/semantics.c | 2 +- gcc/objc/objc-act.c | 12 ++++----- gcc/tree.c | 30 --------------------- gcc/tree.h | 1 - 12 files changed, 78 insertions(+), 88 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3123cf60a8d..6fb73d9b489 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2001-01-29 Joseph S. Myers + + * tree.c, tree.h (build_parse_node): Remove; was identical to + build_nt. + * c-lang.c (start_cdtor), objc/objc-act.c + (build_module_descriptor): Use build_nt instead of + build_parse_node. + 2001-01-29 Jakub Jelinek * config/i386/i386.md (addqi_1_lea): Fix mode (QI instead of HI). diff --git a/gcc/c-lang.c b/gcc/c-lang.c index dfd772fdbf5..87c65fbacae 100644 --- a/gcc/c-lang.c +++ b/gcc/c-lang.c @@ -187,10 +187,9 @@ start_cdtor (method_type) tree body; start_function (void_list_node_1, - build_parse_node (CALL_EXPR, fnname, - tree_cons (NULL_TREE, NULL_TREE, - void_list_node_1), - NULL_TREE), + build_nt (CALL_EXPR, fnname, + tree_cons (NULL_TREE, NULL_TREE, void_list_node_1), + NULL_TREE), NULL_TREE, NULL_TREE); store_parm_decls (); diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 62da9875616..996adb3c3c0 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,17 @@ +2001-01-29 Joseph S. Myers + + * decl2.c (build_expr_from_tree), lex.c (make_pointer_declarator, + make_reference_declarator, make_call_declarator), method.c + (implicitly_declare_fn), parse.y (namespace_using_decl, + notype_unqualified_id, expr_or_declarator, new_type_id, + after_type_declarator, direct_after_type_declarator, + notype_declarator, complex_notype_declarator, + complex_direct_notype_declarator, qualified_id, + notype_qualified_id, overqualified_id, direct_new_declarator, + absdcl, direct_abstract_declarator, conversion_declarator), pt.c + (tsubst), semantics.c (begin_constructor_declarator): Use build_nt + instead of build_parse_node. + 2001-01-28 Kaveh R. Ghazi * cp-tree.h (cp_tree_index): Delete CPTI_MINUS_ONE. diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index 2cb9e44e70c..6088e1073e4 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -4032,8 +4032,8 @@ build_expr_from_tree (t) case ARRAY_REF: if (TREE_OPERAND (t, 0) == NULL_TREE) /* new-type-id */ - return build_parse_node (ARRAY_REF, NULL_TREE, - build_expr_from_tree (TREE_OPERAND (t, 1))); + return build_nt (ARRAY_REF, NULL_TREE, + build_expr_from_tree (TREE_OPERAND (t, 1))); return grok_array_decl (build_expr_from_tree (TREE_OPERAND (t, 0)), build_expr_from_tree (TREE_OPERAND (t, 1))); diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c index c19d784fa6d..58ab5d3aed4 100644 --- a/gcc/cp/lex.c +++ b/gcc/cp/lex.c @@ -149,7 +149,7 @@ make_pointer_declarator (cv_qualifiers, target) if (target && TREE_CODE (target) == IDENTIFIER_NODE && ANON_AGGRNAME_P (target)) error ("type name expected before `*'"); - target = build_parse_node (INDIRECT_REF, target); + target = build_nt (INDIRECT_REF, target); TREE_TYPE (target) = cv_qualifiers; return target; } @@ -181,7 +181,7 @@ make_reference_declarator (cv_qualifiers, target) if (TREE_CODE (target) == IDENTIFIER_NODE && ANON_AGGRNAME_P (target)) error ("type name expected before `&'"); } - target = build_parse_node (ADDR_EXPR, target); + target = build_nt (ADDR_EXPR, target); TREE_TYPE (target) = cv_qualifiers; return target; } @@ -190,11 +190,11 @@ tree make_call_declarator (target, parms, cv_qualifiers, exception_specification) tree target, parms, cv_qualifiers, exception_specification; { - target = build_parse_node (CALL_EXPR, target, - tree_cons (parms, cv_qualifiers, NULL_TREE), - /* The third operand is really RTL. We - shouldn't put anything there. */ - NULL_TREE); + target = build_nt (CALL_EXPR, target, + 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; } diff --git a/gcc/cp/method.c b/gcc/cp/method.c index 17016a4a972..51e0c5c3cb9 100644 --- a/gcc/cp/method.c +++ b/gcc/cp/method.c @@ -2786,7 +2786,7 @@ implicitly_declare_fn (kind, type, const_p) { case sfk_destructor: /* Destructor. */ - name = build_parse_node (BIT_NOT_EXPR, name); + name = build_nt (BIT_NOT_EXPR, name); args = void_list_node; raises = synthesize_exception_spec (type, &locate_dtor, 0); break; @@ -2844,7 +2844,7 @@ implicitly_declare_fn (kind, type, const_p) { tree declarator = make_call_declarator (name, args, NULL_TREE, raises); if (retref) - declarator = build_parse_node (ADDR_EXPR, declarator); + declarator = build_nt (ADDR_EXPR, declarator); fn = grokfield (declarator, declspecs, NULL_TREE, NULL_TREE, NULL_TREE); } diff --git a/gcc/cp/parse.y b/gcc/cp/parse.y index b827b984627..e84efb53a73 100644 --- a/gcc/cp/parse.y +++ b/gcc/cp/parse.y @@ -545,11 +545,11 @@ using_decl: namespace_using_decl: USING namespace_qualifier identifier - { $$ = build_parse_node (SCOPE_REF, $2, $3); } + { $$ = build_nt (SCOPE_REF, $2, $3); } | USING global_scope identifier - { $$ = build_parse_node (SCOPE_REF, global_namespace, $3); } + { $$ = build_nt (SCOPE_REF, global_namespace, $3); } | USING global_scope namespace_qualifier identifier - { $$ = build_parse_node (SCOPE_REF, $3, $4); } + { $$ = build_nt (SCOPE_REF, $3, $4); } ; using_directive: @@ -1442,9 +1442,9 @@ expr_no_comma_rangle: notype_unqualified_id: '~' see_typename identifier - { $$ = build_parse_node (BIT_NOT_EXPR, $3); } + { $$ = build_nt (BIT_NOT_EXPR, $3); } | '~' see_typename template_type - { $$ = build_parse_node (BIT_NOT_EXPR, $3); } + { $$ = build_nt (BIT_NOT_EXPR, $3); } | template_id | operator_name | IDENTIFIER @@ -1500,9 +1500,9 @@ expr_or_declarator_intern: expr_or_declarator: notype_unqualified_id | '*' expr_or_declarator_intern %prec UNARY - { $$ = build_parse_node (INDIRECT_REF, $2); } + { $$ = build_nt (INDIRECT_REF, $2); } | '&' expr_or_declarator_intern %prec UNARY - { $$ = build_parse_node (ADDR_EXPR, $2); } + { $$ = build_nt (ADDR_EXPR, $2); } | '(' expr_or_declarator_intern ')' { $$ = $2; } ; @@ -2769,7 +2769,7 @@ new_type_id: { if (pedantic) pedwarn ("ISO C++ forbids array dimensions with parenthesized type in new"); - $$.t = build_parse_node (ARRAY_REF, TREE_VALUE ($2.t), $5); + $$.t = build_nt (ARRAY_REF, TREE_VALUE ($2.t), $5); $$.t = build_tree_list (TREE_PURPOSE ($2.t), $$.t); $$.new_type_flag = $2.new_type_flag; } @@ -2830,7 +2830,7 @@ after_type_declarator: { $$ = make_reference_declarator (NULL_TREE, $2); } | ptr_to_mem cv_qualifiers after_type_declarator_intern { tree arg = make_pointer_declarator ($2, $3); - $$ = build_parse_node (SCOPE_REF, $1, arg); + $$ = build_nt (SCOPE_REF, $1, arg); } | direct_after_type_declarator ; @@ -2839,14 +2839,14 @@ direct_after_type_declarator: direct_after_type_declarator maybe_parmlist cv_qualifiers exception_specification_opt %prec '.' { $$ = make_call_declarator ($$, $2, $3, $4); } | direct_after_type_declarator '[' expr ']' - { $$ = build_parse_node (ARRAY_REF, $$, $3); } + { $$ = build_nt (ARRAY_REF, $$, $3); } | direct_after_type_declarator '[' ']' - { $$ = build_parse_node (ARRAY_REF, $$, NULL_TREE); } + { $$ = build_nt (ARRAY_REF, $$, NULL_TREE); } | '(' after_type_declarator_intern ')' { $$ = $2; } | nested_name_specifier type_name %prec EMPTY { push_nested_class ($1, 3); - $$ = build_parse_node (SCOPE_REF, $$, $2); + $$ = build_nt (SCOPE_REF, $$, $2); TREE_COMPLEXITY ($$) = current_class_depth; } | type_name %prec EMPTY ; @@ -2908,7 +2908,7 @@ notype_declarator: { $$ = make_reference_declarator (NULL_TREE, $2); } | ptr_to_mem cv_qualifiers notype_declarator_intern { tree arg = make_pointer_declarator ($2, $3); - $$ = build_parse_node (SCOPE_REF, $1, arg); + $$ = build_nt (SCOPE_REF, $1, arg); } | direct_notype_declarator ; @@ -2924,7 +2924,7 @@ complex_notype_declarator: { $$ = make_reference_declarator (NULL_TREE, $2); } | ptr_to_mem cv_qualifiers notype_declarator_intern { tree arg = make_pointer_declarator ($2, $3); - $$ = build_parse_node (SCOPE_REF, $1, arg); + $$ = build_nt (SCOPE_REF, $1, arg); } | complex_direct_notype_declarator ; @@ -2935,20 +2935,20 @@ complex_direct_notype_declarator: | '(' complex_notype_declarator ')' { $$ = $2; } | direct_notype_declarator '[' expr ']' - { $$ = build_parse_node (ARRAY_REF, $$, $3); } + { $$ = build_nt (ARRAY_REF, $$, $3); } | direct_notype_declarator '[' ']' - { $$ = build_parse_node (ARRAY_REF, $$, NULL_TREE); } + { $$ = build_nt (ARRAY_REF, $$, NULL_TREE); } | notype_qualified_id { enter_scope_of ($1); } | global_scope notype_qualified_id { enter_scope_of ($2); $$ = $2;} | global_scope notype_unqualified_id - { $$ = build_parse_node (SCOPE_REF, global_namespace, $2); + { $$ = build_nt (SCOPE_REF, global_namespace, $2); enter_scope_of ($$); } | nested_name_specifier notype_template_declarator { got_scope = NULL_TREE; - $$ = build_parse_node (SCOPE_REF, $1, $2); + $$ = build_nt (SCOPE_REF, $1, $2); enter_scope_of ($$); } ; @@ -2956,19 +2956,19 @@ complex_direct_notype_declarator: qualified_id: nested_name_specifier unqualified_id { got_scope = NULL_TREE; - $$ = build_parse_node (SCOPE_REF, $$, $2); } + $$ = build_nt (SCOPE_REF, $$, $2); } | nested_name_specifier object_template_id { got_scope = NULL_TREE; - $$ = build_parse_node (SCOPE_REF, $1, $2); } + $$ = build_nt (SCOPE_REF, $1, $2); } ; notype_qualified_id: nested_name_specifier notype_unqualified_id { got_scope = NULL_TREE; - $$ = build_parse_node (SCOPE_REF, $$, $2); } + $$ = build_nt (SCOPE_REF, $$, $2); } | nested_name_specifier object_template_id { got_scope = NULL_TREE; - $$ = build_parse_node (SCOPE_REF, $1, $2); } + $$ = build_nt (SCOPE_REF, $1, $2); } ; overqualified_id: @@ -3175,11 +3175,11 @@ new_declarator: { $$ = make_reference_declarator ($2, NULL_TREE); } | ptr_to_mem cv_qualifiers %prec EMPTY { tree arg = make_pointer_declarator ($2, NULL_TREE); - $$ = build_parse_node (SCOPE_REF, $1, arg); + $$ = build_nt (SCOPE_REF, $1, arg); } | ptr_to_mem cv_qualifiers new_declarator { tree arg = make_pointer_declarator ($2, $3); - $$ = build_parse_node (SCOPE_REF, $1, arg); + $$ = build_nt (SCOPE_REF, $1, arg); } | direct_new_declarator %prec EMPTY ; @@ -3187,9 +3187,9 @@ new_declarator: /* ISO direct-new-declarator (5.3.4) */ direct_new_declarator: '[' expr ']' - { $$ = build_parse_node (ARRAY_REF, NULL_TREE, $2); } + { $$ = build_nt (ARRAY_REF, NULL_TREE, $2); } | direct_new_declarator '[' expr ']' - { $$ = build_parse_node (ARRAY_REF, $$, $3); } + { $$ = build_nt (ARRAY_REF, $$, $3); } ; absdcl_intern: @@ -3222,11 +3222,11 @@ absdcl: { $$ = make_reference_declarator (NULL_TREE, NULL_TREE); } | ptr_to_mem cv_qualifiers %prec EMPTY { tree arg = make_pointer_declarator ($2, NULL_TREE); - $$ = build_parse_node (SCOPE_REF, $1, arg); + $$ = build_nt (SCOPE_REF, $1, arg); } | ptr_to_mem cv_qualifiers absdcl_intern { tree arg = make_pointer_declarator ($2, $3); - $$ = build_parse_node (SCOPE_REF, $1, arg); + $$ = build_nt (SCOPE_REF, $1, arg); } | direct_abstract_declarator %prec EMPTY ; @@ -3241,9 +3241,9 @@ direct_abstract_declarator: | direct_abstract_declarator LEFT_RIGHT cv_qualifiers exception_specification_opt %prec '.' { $$ = make_call_declarator ($$, empty_parms (), $3, $4); } | direct_abstract_declarator '[' expr ']' %prec '.' - { $$ = build_parse_node (ARRAY_REF, $$, $3); } + { $$ = build_nt (ARRAY_REF, $$, $3); } | direct_abstract_declarator '[' ']' %prec '.' - { $$ = build_parse_node (ARRAY_REF, $$, NULL_TREE); } + { $$ = build_nt (ARRAY_REF, $$, NULL_TREE); } | '(' complex_parmlist ')' cv_qualifiers exception_specification_opt %prec '.' { $$ = make_call_declarator (NULL_TREE, $2, $4, $5); } | regcast_or_absdcl cv_qualifiers exception_specification_opt %prec '.' @@ -3251,9 +3251,9 @@ direct_abstract_declarator: | fcast_or_absdcl cv_qualifiers exception_specification_opt %prec '.' { set_quals_and_spec ($$, $2, $3); } | '[' expr ']' %prec '.' - { $$ = build_parse_node (ARRAY_REF, NULL_TREE, $2); } + { $$ = build_nt (ARRAY_REF, NULL_TREE, $2); } | '[' ']' %prec '.' - { $$ = build_parse_node (ARRAY_REF, NULL_TREE, NULL_TREE); } + { $$ = build_nt (ARRAY_REF, NULL_TREE, NULL_TREE); } ; /* For C++, decls and stmts can be intermixed, so we don't need to @@ -3783,7 +3783,7 @@ conversion_declarator: { $$ = make_reference_declarator ($2, $3); } | ptr_to_mem cv_qualifiers conversion_declarator { tree arg = make_pointer_declarator ($2, $3); - $$ = build_parse_node (SCOPE_REF, $1, arg); + $$ = build_nt (SCOPE_REF, $1, arg); } ; diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index c66eaccc6be..a17343d7a96 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -6819,7 +6819,7 @@ tsubst (t, args, complain, in_decl) if (e1 == error_mark_node || e2 == error_mark_node) return error_mark_node; - return build_parse_node (ARRAY_REF, e1, e2, tsubst_expr); + return build_nt (ARRAY_REF, e1, e2, tsubst_expr); } case CALL_EXPR: @@ -6846,7 +6846,7 @@ tsubst (t, args, complain, in_decl) if (e1 == error_mark_node || e2 == error_mark_node) return error_mark_node; - return build_parse_node (TREE_CODE (t), e1, e2); + return build_nt (TREE_CODE (t), e1, e2); } case TYPEOF_TYPE: diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index e52138ba7ee..c5bbe1be604 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -1624,7 +1624,7 @@ begin_constructor_declarator (scope, name) tree scope; tree name; { - tree result = build_parse_node (SCOPE_REF, scope, name); + tree result = build_nt (SCOPE_REF, scope, name); enter_scope_of (result); return result; } diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c index 7c0941a06df..1cf0af9362e 100644 --- a/gcc/objc/objc-act.c +++ b/gcc/objc/objc-act.c @@ -1855,12 +1855,12 @@ build_module_descriptor () /* void _GLOBAL_$I$ () {objc_execClass (&L_OBJC_MODULES);} */ start_function (void_list_node_1, - build_parse_node (CALL_EXPR, init_function_name, - /* This has the format of the output - of get_parm_info. */ - tree_cons (NULL_TREE, NULL_TREE, - void_list_node_1), - NULL_TREE), + build_nt (CALL_EXPR, init_function_name, + /* This has the format of the output + of get_parm_info. */ + tree_cons (NULL_TREE, NULL_TREE, + void_list_node_1), + NULL_TREE), NULL_TREE, NULL_TREE); #if 0 /* This should be turned back on later for the systems where collect is not needed. */ diff --git a/gcc/tree.c b/gcc/tree.c index 9f7fae7a7ef..6e8a32e65be 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -2504,36 +2504,6 @@ build_nt VPARAMS ((enum tree_code code, ...)) return t; } -/* Similar to `build_nt', except we build - on the temp_decl_obstack, regardless. */ - -tree -build_parse_node VPARAMS ((enum tree_code code, ...)) -{ -#ifndef ANSI_PROTOTYPES - enum tree_code code; -#endif - va_list p; - register tree t; - register int length; - register int i; - - VA_START (p, code); - -#ifndef ANSI_PROTOTYPES - code = va_arg (p, enum tree_code); -#endif - - t = make_node (code); - length = TREE_CODE_LENGTH (code); - - for (i = 0; i < length; i++) - TREE_OPERAND (t, i) = va_arg (p, tree); - - va_end (p); - return t; -} - #if 0 /* Commented out because this wants to be done very differently. See cp-lex.c. */ diff --git a/gcc/tree.h b/gcc/tree.h index b5acb34f805..1ff74410a94 100644 --- a/gcc/tree.h +++ b/gcc/tree.h @@ -1915,7 +1915,6 @@ extern tree maybe_get_identifier PARAMS ((const char *)); extern tree build PARAMS ((enum tree_code, tree, ...)); extern tree build_nt PARAMS ((enum tree_code, ...)); -extern tree build_parse_node PARAMS ((enum tree_code, ...)); extern tree build_int_2_wide PARAMS ((unsigned HOST_WIDE_INT, HOST_WIDE_INT)); extern tree build_real PARAMS ((tree, REAL_VALUE_TYPE)); -- 2.30.2