tree.c, tree.h (build_parse_node): Remove; was identical to build_nt.
authorJoseph Myers <jsm28@cam.ac.uk>
Mon, 29 Jan 2001 18:57:24 +0000 (18:57 +0000)
committerJoseph Myers <jsm28@gcc.gnu.org>
Mon, 29 Jan 2001 18:57:24 +0000 (18:57 +0000)
* 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

12 files changed:
gcc/ChangeLog
gcc/c-lang.c
gcc/cp/ChangeLog
gcc/cp/decl2.c
gcc/cp/lex.c
gcc/cp/method.c
gcc/cp/parse.y
gcc/cp/pt.c
gcc/cp/semantics.c
gcc/objc/objc-act.c
gcc/tree.c
gcc/tree.h

index 3123cf60a8d70f171094f92bf87b0f2b1f897ea6..6fb73d9b4897176aff1713099791a11988ed7082 100644 (file)
@@ -1,3 +1,11 @@
+2001-01-29  Joseph S. Myers  <jsm28@cam.ac.uk>
+
+       * 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  <jakub@redhat.com>
 
        * config/i386/i386.md (addqi_1_lea): Fix mode (QI instead of HI).
index dfd772fdbf58aad4ee938b09aa6c7a5e45508c35..87c65fbacaee566bca9fd8eb02a59c87df76f522 100644 (file)
@@ -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 ();
 
index 62da98756165ca15874be4177b9212ebff64e1c2..996adb3c3c07f55464478ceca207396a6db14fa4 100644 (file)
@@ -1,3 +1,17 @@
+2001-01-29  Joseph S. Myers  <jsm28@cam.ac.uk>
+
+       * 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  <ghazi@caip.rutgers.edu>
 
        * cp-tree.h (cp_tree_index): Delete CPTI_MINUS_ONE.
index 2cb9e44e70c749ab6efd7cd38ed4e8d07e392ff9..6088e1073e419e82519aedd2de3779aef2d84ed1 100644 (file)
@@ -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)));
 
index c19d784fa6d00b73caf2254cb47d20468f424080..58ab5d3aed40fc46445c9fed527ae43f4ca29d3e 100644 (file)
@@ -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;
 }
index 17016a4a9729e879c89bfa04bb3fa3bac9dcd512..51e0c5c3cb963da517543fd456b41abdd0ff3290 100644 (file)
@@ -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);
   }
index b827b984627634a7df555349535f6adee958672a..e84efb53a73619864b5d4731d4db546352386047 100644 (file)
@@ -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);
                }
        ;
 
index c66eaccc6be28fa671232c93994ef660178ce3d7..a17343d7a96564bc0fbaeefe79bea12339064f42 100644 (file)
@@ -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:
index e52138ba7ee2bf2d2485f3b10ae7246fa322ffc8..c5bbe1be604ca27f20d019f39189f6823667d924 100644 (file)
@@ -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;
 }
index 7c0941a06dfa2e7eba14e834ffa7390f438001dc..1cf0af9362e3ee43d0db96ec9ec6cebb4305364a 100644 (file)
@@ -1855,12 +1855,12 @@ build_module_descriptor ()
     /* void _GLOBAL_$I$<gnyf> () {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.  */
index 9f7fae7a7efc43cf8e79826ed3ca7b5b6397f1ec..6e8a32e65be780ffb8eec86f48b4208b20cccf16 100644 (file)
@@ -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.  */
index b5acb34f805c1c412f6f32be0a53d167e50fcd60..1ff74410a94fa71ff315bbcc7b3faa5f5fed0f83 100644 (file)
@@ -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));