This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[Patch] Change parsing of simple statements
- To: gcc-patches at gcc dot gnu dot org
- Subject: [Patch] Change parsing of simple statements
- From: Benjamin Chelf <chelf at codesourcery dot com>
- Date: Mon, 10 Jul 2000 04:03:06 -0700 (PDT)
- Organization: CodeSourcery, LLC
- Reply-To: chelf at codesourcery dot com
This patch starts the process of having the C front end build up a
complete tree for the function, then generate RTL. It changes the simplest
of statements -- breaks, returns, continues, and cases, to build the tree,
then immediately generate RTL through the genrtl functions. It has been
tested on i686-linux and approved by Mark Mitchell.
-Benjamin Chelf
chelf@codesourcery.com
CodeSourcery, LLC
2000-07-10 Benjamin Chelf <chelf@codesourcery.com>
* c-common.h (build_stmt): Declare.
(build_continue_stmt): Likewise.
(build_break_stmt): Likewise.
(build_return_stmt): Likewise.
* c-decl.c (do_case): Rewrite to do what previously done in
c-parse.in.
* c-semantics.c (build_stmt): Define.
(build_return_stmt): Likewise.
(build_break_stmt): Likewise.
(build_continue_stmt): Likewise.
(build_case_label): Likewise.
* c-parse.in (BREAK): Change to build tree, then generate RTL.
(CONTINUE): Likewise.
(RETURN): Likewise.
(CASE): Likewise.
(DEFAULT): Likewise.
* c-parse.y: Regenerate.
* c-pasre.c: Likewise.
* cp/semantics.c (finish_for_stmt): Remove call to emit_line_note.
(finish_continue_stmt): Likewise.
(begin_for_stmt): Remove call to note_level_for_for.
(finish_goto_stmt): Change call from build_min_nt
to build_stmt.
(finish_expr_stmt): Likewise.
(begin_if_stmt): Likewise.
(begin_while_stmt): Likewise.
(finish_while_stmt): Likewise.
(finish_return_stmt): Likewise.
(begin_for_stmt): Likewise.
(finish_for_stmt): Likewise.
(finish_break_stmt): Likewise.
(begin_switch_stmt): Likewise.
(finish_case_label): Likewise.
(genrtl_try_block): Likewise.
(begin_try_block): Likewise.
(begin_handler): Likewise.
(begin_compound_stmt): Likewise.
(finish_asm_stmt): Likewise.
(finish_label_stmt): Likewise.
(add_decl_stmt): Likewise.
(finish_subobject): Likewise.
(finish_decl_cleanup): Likewise.
(finish_named_return_value): Likewise.
(setup_vtbl_ptr): Likewise.
(add_scope_stmt): Likewise.
* cp/decl.c (finish_constructor_body): Likewise.
(finish_destructor_body): Likewise.
* cp/optimize.c (copy_body_r): Likewise.
(initialize_inlined_parameters): Likewise.
(declare_return_variable): Likewise.
(expand_call_inline): Likewise.
Index: c-common.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/c-common.h,v
retrieving revision 1.22
diff -c -p -r1.22 c-common.h
*** c-common.h 2000/07/03 03:55:22 1.22
--- c-common.h 2000/07/10 10:46:49
*************** extern tree lang_expand_stmt
*** 457,463 ****
--- 457,467 ----
extern void c_expand_return PARAMS ((tree));
extern tree c_expand_start_case PARAMS ((tree));
extern void do_case PARAMS ((tree, tree));
+ extern tree build_stmt PARAMS ((enum tree_code, ...));
extern tree build_case_label PARAMS ((tree, tree));
+ extern tree build_continue_stmt PARAMS ((void));
+ extern tree build_break_stmt PARAMS ((void));
+ extern tree build_return_stmt PARAMS ((tree));
#define COMPOUND_STMT_NO_SCOPE(NODE) TREE_LANG_FLAG_0 (NODE)
Index: c-decl.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/c-decl.c,v
retrieving revision 1.127
diff -c -p -r1.127 c-decl.c
*** c-decl.c 2000/07/10 07:18:06 1.127
--- c-decl.c 2000/07/10 10:46:49
*************** do_case (low_value, high_value)
*** 6841,6847 ****
tree low_value;
tree high_value;
{
! abort ();
}
/* Language specific handler of tree nodes used when generating RTL
--- 6841,6902 ----
tree low_value;
tree high_value;
{
! tree value1 = NULL_TREE, value2 = NULL_TREE, label;
!
! if (low_value != NULL_TREE)
! value1 = check_case_value (low_value);
! if (high_value != NULL_TREE)
! value2 = check_case_value (high_value);
!
! label = build_decl (LABEL_DECL, NULL_TREE, NULL_TREE);
!
! if (pedantic && (high_value != NULL_TREE))
! pedwarn ("ANSI C forbids case ranges");
!
! if (value1 != error_mark_node && value2 != error_mark_node)
! {
! tree duplicate;
! int success;
!
! if (high_value == NULL_TREE && value1 != NULL_TREE &&
! pedantic && ! INTEGRAL_TYPE_P (TREE_TYPE (value1)))
! pedwarn ("label must have integral type in ANSI C");
!
! if (low_value == NULL_TREE)
! success = pushcase (NULL_TREE, 0, label, &duplicate);
! else if (high_value == NULL_TREE)
! success = pushcase (value1, convert_and_check, label,
! &duplicate);
! else
! success = pushcase_range (value1, value2, convert_and_check,
! label, &duplicate);
!
! if (success == 1)
! {
! if (low_value == NULL_TREE)
! error ("default label not within a switch statement");
! else
! error ("case label not within a switch statement");
! }
! else if (success == 2) {
! if (low_value == NULL_TREE)
! {
! error ("multiple default labels in one switch");
! error_with_decl (duplicate, "this is the first default label");
! }
! else
! error ("dupicate case value");
! if (high_value != NULL_TREE)
! error_with_decl (duplicate, "this is the first entry for that value");
! }
! else if (low_value != NULL_TREE)
! {
! if (success == 3)
! warning ("case value out of range");
! else if (success == 5)
! error ("case label within scope of cleanup or variable array");
! }
! }
}
/* Language specific handler of tree nodes used when generating RTL
*************** set_current_function_name_declared (i)
*** 6863,6865 ****
--- 6918,6921 ----
{
abort ();
}
+
Index: c-parse.in
===================================================================
RCS file: /cvs/gcc/egcs/gcc/c-parse.in,v
retrieving revision 1.41
diff -c -p -r1.41 c-parse.in
*** c-parse.in 2000/06/19 22:28:27 1.41
--- c-parse.in 2000/07/10 10:46:50
*************** stmt:
*** 1843,1865 ****
lineno_labeled_stmt
{ expand_end_case ($3); }
| BREAK ';'
! { stmt_count++;
! emit_line_note ($<filename>-1, $<lineno>0);
! if ( ! expand_exit_something ())
! error ("break statement not within loop or switch"); }
| CONTINUE ';'
! { stmt_count++;
! emit_line_note ($<filename>-1, $<lineno>0);
! if (! expand_continue_loop (NULL_PTR))
! error ("continue statement not within a loop"); }
| RETURN ';'
! { stmt_count++;
! emit_line_note ($<filename>-1, $<lineno>0);
! c_expand_return (NULL_TREE); }
| RETURN expr ';'
! { stmt_count++;
! emit_line_note ($<filename>-1, $<lineno>0);
! c_expand_return ($2); }
| ASM_KEYWORD maybe_type_qual '(' expr ')' ';'
{ stmt_count++;
emit_line_note ($<filename>-1, $<lineno>0);
--- 1843,1863 ----
lineno_labeled_stmt
{ expand_end_case ($3); }
| BREAK ';'
! { tree break_stmt = build_break_stmt ();
! stmt_count++;
! genrtl_break_stmt (); }
| CONTINUE ';'
! { tree continue_stmt = build_continue_stmt ();
! stmt_count++;
! genrtl_continue_stmt (); }
| RETURN ';'
! { tree return_stmt = build_return_stmt (NULL_TREE);
! stmt_count++;
! genrtl_return_stmt (RETURN_EXPR(return_stmt)); }
| RETURN expr ';'
! { tree return_stmt = build_return_stmt ($2);
! stmt_count++;
! genrtl_return_stmt (RETURN_EXPR(return_stmt)); }
| ASM_KEYWORD maybe_type_qual '(' expr ')' ';'
{ stmt_count++;
emit_line_note ($<filename>-1, $<lineno>0);
*************** all_iter_stmt_with_decl:
*** 1971,2052 ****
also at the end of a compound statement. */
label: CASE expr_no_commas ':'
! { register tree value = check_case_value ($2);
! register tree label
! = build_decl (LABEL_DECL, NULL_TREE, NULL_TREE);
!
stmt_count++;
!
! if (value != error_mark_node)
! {
! tree duplicate;
! int success;
!
! if (pedantic && ! INTEGRAL_TYPE_P (TREE_TYPE (value)))
! pedwarn ("label must have integral type in ANSI C");
!
! success = pushcase (value, convert_and_check,
! label, &duplicate);
!
! if (success == 1)
! error ("case label not within a switch statement");
! else if (success == 2)
! {
! error ("duplicate case value");
! error_with_decl (duplicate, "this is the first entry for that value");
! }
! else if (success == 3)
! warning ("case value out of range");
! else if (success == 5)
! error ("case label within scope of cleanup or variable array");
! }
! position_after_white_space (); }
| CASE expr_no_commas ELLIPSIS expr_no_commas ':'
! { register tree value1 = check_case_value ($2);
! register tree value2 = check_case_value ($4);
! register tree label
! = build_decl (LABEL_DECL, NULL_TREE, NULL_TREE);
!
! if (pedantic)
! pedwarn ("ANSI C forbids case ranges");
stmt_count++;
!
! if (value1 != error_mark_node && value2 != error_mark_node)
! {
! tree duplicate;
! int success = pushcase_range (value1, value2,
! convert_and_check, label,
! &duplicate);
! if (success == 1)
! error ("case label not within a switch statement");
! else if (success == 2)
! {
! error ("duplicate case value");
! error_with_decl (duplicate, "this is the first entry for that value");
! }
! else if (success == 3)
! warning ("case value out of range");
! else if (success == 4)
! warning ("empty case range");
! else if (success == 5)
! error ("case label within scope of cleanup or variable array");
! }
! position_after_white_space (); }
| DEFAULT ':'
! {
! tree duplicate;
! register tree label
! = build_decl (LABEL_DECL, NULL_TREE, NULL_TREE);
! int success = pushcase (NULL_TREE, 0, label, &duplicate);
! stmt_count++;
! if (success == 1)
! error ("default label not within a switch statement");
! else if (success == 2)
! {
! error ("multiple default labels in one switch");
! error_with_decl (duplicate, "this is the first default label");
! }
! position_after_white_space (); }
| identifier ':' maybe_attribute
{ tree label = define_label (input_filename, lineno, $1);
stmt_count++;
--- 1969,1991 ----
also at the end of a compound statement. */
label: CASE expr_no_commas ':'
! { tree case_label_tree = build_case_label ($2, NULL_TREE);
stmt_count++;
! genrtl_case_label(CASE_LOW(case_label_tree), CASE_HIGH(case_label_tree));
! position_after_white_space ();
! }
| CASE expr_no_commas ELLIPSIS expr_no_commas ':'
! { tree case_label_tree = build_case_label ($2, $4);
stmt_count++;
! genrtl_case_label(CASE_LOW(case_label_tree), CASE_HIGH(case_label_tree));
! position_after_white_space ();
! }
| DEFAULT ':'
! { tree case_label_tree = build_case_label (NULL_TREE, NULL_TREE);
! stmt_count++;
! genrtl_case_label(CASE_LOW(case_label_tree), CASE_HIGH(case_label_tree));
! position_after_white_space ();
! }
| identifier ':' maybe_attribute
{ tree label = define_label (input_filename, lineno, $1);
stmt_count++;
Index: c-semantics.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/c-semantics.c,v
retrieving revision 1.2
diff -c -p -r1.2 c-semantics.c
*** c-semantics.c 2000/07/03 03:55:22 1.2
--- c-semantics.c 2000/07/10 10:46:50
*************** Boston, MA 02111-1307, USA. */
*** 36,41 ****
--- 36,73 ----
#include "output.h"
#include "timevar.h"
+ /* Build a generic statement based on the given type of node and
+ arguments. Similar to `build_nt', except that we set
+ TREE_COMPLEXITY to be the current line number. */
+
+ tree
+ build_stmt 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);
+ TREE_COMPLEXITY (t) = lineno;
+
+ for (i = 0; i < length; i++)
+ TREE_OPERAND (t, i) = va_arg (p, tree);
+
+ va_end (p);
+ return t;
+ }
+
/* Some statements, like for-statements or if-statements, require a
condition. This condition can be a declaration. If T is such a
declaration it is processed, and an expression appropriate to use
*************** genrtl_do_stmt (t)
*** 276,281 ****
--- 308,322 ----
expand_end_loop ();
}
+ /* Build the node for a return statement and return it. */
+
+ tree
+ build_return_stmt (expr)
+ tree expr;
+ {
+ return (build_stmt (RETURN_STMT, expr));
+ }
+
/* Generate the RTL for EXPR, which is a RETURN_STMT. */
void
*************** genrtl_for_stmt (t)
*** 319,324 ****
--- 360,373 ----
expand_end_loop ();
}
+ /* Build a break statement node and return it. */
+
+ tree
+ build_break_stmt ()
+ {
+ return (build_stmt (BREAK_STMT));
+ }
+
/* Generate the RTL for a BREAK_STMT. */
void
*************** genrtl_break_stmt ()
*** 329,334 ****
--- 378,391 ----
error ("break statement not within loop or switch");
}
+ /* Build a continue statement node and return it. */
+
+ tree
+ build_continue_stmt ()
+ {
+ return (build_stmt (CONTINUE_STMT));
+ }
+
/* Generate the RTL for a CONTINUE_STMT. */
void
*************** genrtl_switch_stmt (t)
*** 387,392 ****
--- 444,460 ----
expand_end_case (cond);
}
+
+ /* Create a CASE_LABEL tree node and return it. */
+
+ tree
+ build_case_label (low_value, high_value)
+ tree low_value;
+ tree high_value;
+ {
+ return build_stmt (CASE_LABEL, low_value, high_value);
+ }
+
/* Generate the RTL for a CASE_LABEL. */
Index: cp/decl.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/decl.c,v
retrieving revision 1.654
diff -c -p -r1.654 decl.c
*** decl.c 2000/07/10 07:16:17 1.654
--- decl.c 2000/07/10 10:46:51
*************** finish_constructor_body ()
*** 14097,14103 ****
{
/* Any return from a constructor will end up here. */
if (ctor_label)
! add_tree (build_min_nt (LABEL_STMT, ctor_label));
/* Clear CTOR_LABEL so that finish_return_stmt knows to really
generate the return, rather than a goto to CTOR_LABEL. */
--- 14097,14103 ----
{
/* Any return from a constructor will end up here. */
if (ctor_label)
! add_tree (build_stmt (LABEL_STMT, ctor_label));
/* Clear CTOR_LABEL so that finish_return_stmt knows to really
generate the return, rather than a goto to CTOR_LABEL. */
*************** finish_constructor_body ()
*** 14106,14112 ****
constructor to a return of `this'. */
finish_return_stmt (NULL_TREE);
/* Mark the end of the constructor. */
! add_tree (build_min_nt (CTOR_STMT));
}
/* At the end of every destructor we generate code to restore virtual
--- 14106,14112 ----
constructor to a return of `this'. */
finish_return_stmt (NULL_TREE);
/* Mark the end of the constructor. */
! add_tree (build_stmt (CTOR_STMT));
}
/* At the end of every destructor we generate code to restore virtual
*************** finish_destructor_body ()
*** 14125,14131 ****
compound_stmt = begin_compound_stmt (/*has_no_scope=*/0);
/* Any return from a destructor will end up here. */
! add_tree (build_min_nt (LABEL_STMT, dtor_label));
/* Generate the code to call destructor on base class. If this
destructor belongs to a class with virtual functions, then set
--- 14125,14131 ----
compound_stmt = begin_compound_stmt (/*has_no_scope=*/0);
/* Any return from a destructor will end up here. */
! add_tree (build_stmt (LABEL_STMT, dtor_label));
/* Generate the code to call destructor on base class. If this
destructor belongs to a class with virtual functions, then set
Index: cp/optimize.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/optimize.c,v
retrieving revision 1.40
diff -c -p -r1.40 optimize.c
*** optimize.c 2000/07/02 05:23:00 1.40
--- optimize.c 2000/07/10 10:46:51
*************** copy_body_r (tp, walk_subtrees, data)
*** 279,285 ****
tree goto_stmt;
/* Build the GOTO_STMT. */
! goto_stmt = build_min_nt (GOTO_STMT, id->ret_label);
TREE_CHAIN (goto_stmt) = TREE_CHAIN (return_stmt);
/* If we're returning something, just turn that into an
--- 279,285 ----
tree goto_stmt;
/* Build the GOTO_STMT. */
! goto_stmt = build_stmt (GOTO_STMT, id->ret_label);
TREE_CHAIN (goto_stmt) = TREE_CHAIN (return_stmt);
/* If we're returning something, just turn that into an
*************** copy_body_r (tp, walk_subtrees, data)
*** 287,294 ****
RESULT_DECL. */
if (RETURN_EXPR (return_stmt))
{
! *tp = build_min_nt (EXPR_STMT,
! RETURN_EXPR (return_stmt));
/* And then jump to the end of the function. */
TREE_CHAIN (*tp) = goto_stmt;
}
--- 287,294 ----
RESULT_DECL. */
if (RETURN_EXPR (return_stmt))
{
! *tp = build_stmt (EXPR_STMT,
! RETURN_EXPR (return_stmt));
/* And then jump to the end of the function. */
TREE_CHAIN (*tp) = goto_stmt;
}
*************** initialize_inlined_parameters (id, args,
*** 431,437 ****
(splay_tree_value) var);
/* Declare this new variable. */
! init_stmt = build_min_nt (DECL_STMT, var);
TREE_CHAIN (init_stmt) = init_stmts;
init_stmts = init_stmt;
--- 431,437 ----
(splay_tree_value) var);
/* Declare this new variable. */
! init_stmt = build_stmt (DECL_STMT, var);
TREE_CHAIN (init_stmt) = init_stmts;
init_stmts = init_stmt;
*************** initialize_inlined_parameters (id, args,
*** 444,452 ****
DECL_INITIAL (var) = value;
else
{
! init_stmt = build_min_nt (EXPR_STMT,
! build (INIT_EXPR, TREE_TYPE (p),
! var, value));
/* Add this initialization to the list. Note that we want the
declaration *after* the initialization because we are going
to reverse all the initialization statements below. */
--- 444,452 ----
DECL_INITIAL (var) = value;
else
{
! init_stmt = build_stmt (EXPR_STMT,
! build (INIT_EXPR, TREE_TYPE (p),
! var, value));
/* Add this initialization to the list. Note that we want the
declaration *after* the initialization because we are going
to reverse all the initialization statements below. */
*************** declare_return_variable (id, use_stmt)
*** 515,526 ****
(splay_tree_value) var);
/* Build the USE_STMT. */
! *use_stmt = build_min_nt (EXPR_STMT, var);
/* Build the declaration statement if FN does not return an
aggregate. */
if (!aggregate_return_p)
! return build_min_nt (DECL_STMT, var);
/* If FN does return an aggregate, there's no need to declare the
return variable; we're using a variable in our caller's frame. */
else
--- 515,526 ----
(splay_tree_value) var);
/* Build the USE_STMT. */
! *use_stmt = build_stmt (EXPR_STMT, var);
/* Build the declaration statement if FN does not return an
aggregate. */
if (!aggregate_return_p)
! return build_stmt (DECL_STMT, var);
/* If FN does return an aggregate, there's no need to declare the
return variable; we're using a variable in our caller's frame. */
else
*************** expand_call_inline (tp, walk_subtrees, d
*** 704,710 ****
/* Create a block to put the parameters in. We have to do this
after the parameters have been remapped because remapping
parameters is different from remapping ordinary variables. */
! scope_stmt = build_min_nt (SCOPE_STMT, DECL_INITIAL (fn));
SCOPE_BEGIN_P (scope_stmt) = 1;
SCOPE_NO_CLEANUPS_P (scope_stmt) = 1;
remap_block (scope_stmt, DECL_ARGUMENTS (fn), id);
--- 704,710 ----
/* Create a block to put the parameters in. We have to do this
after the parameters have been remapped because remapping
parameters is different from remapping ordinary variables. */
! scope_stmt = build_stmt (SCOPE_STMT, DECL_INITIAL (fn));
SCOPE_BEGIN_P (scope_stmt) = 1;
SCOPE_NO_CLEANUPS_P (scope_stmt) = 1;
remap_block (scope_stmt, DECL_ARGUMENTS (fn), id);
*************** expand_call_inline (tp, walk_subtrees, d
*** 729,735 ****
*inlined_body = copy_body (id);
/* Close the block for the parameters. */
! scope_stmt = build_min_nt (SCOPE_STMT, DECL_INITIAL (fn));
SCOPE_NO_CLEANUPS_P (scope_stmt) = 1;
my_friendly_assert (DECL_INITIAL (fn)
&& TREE_CODE (DECL_INITIAL (fn)) == BLOCK,
--- 729,735 ----
*inlined_body = copy_body (id);
/* Close the block for the parameters. */
! scope_stmt = build_stmt (SCOPE_STMT, DECL_INITIAL (fn));
SCOPE_NO_CLEANUPS_P (scope_stmt) = 1;
my_friendly_assert (DECL_INITIAL (fn)
&& TREE_CODE (DECL_INITIAL (fn)) == BLOCK,
*************** expand_call_inline (tp, walk_subtrees, d
*** 743,749 ****
may cause RTL to be generated. */
STMT_EXPR_STMT (expr)
= chainon (STMT_EXPR_STMT (expr),
! build_min_nt (LABEL_STMT, id->ret_label));
/* Finally, mention the returned value so that the value of the
statement-expression is the returned value of the function. */
--- 743,749 ----
may cause RTL to be generated. */
STMT_EXPR_STMT (expr)
= chainon (STMT_EXPR_STMT (expr),
! build_stmt (LABEL_STMT, id->ret_label));
/* Finally, mention the returned value so that the value of the
statement-expression is the returned value of the function. */
Index: cp/semantics.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/semantics.c,v
retrieving revision 1.160
diff -c -p -r1.160 semantics.c
*** semantics.c 2000/07/10 07:54:40 1.160
--- semantics.c 2000/07/10 10:46:51
*************** finish_goto_stmt (destination)
*** 206,212 ****
check_goto (destination);
! add_tree (build_min_nt (GOTO_STMT, destination));
}
/* COND is the condition-expression for an if, while, etc.,
--- 206,212 ----
check_goto (destination);
! add_tree (build_stmt (GOTO_STMT, destination));
}
/* COND is the condition-expression for an if, while, etc.,
*************** finish_expr_stmt (expr)
*** 250,256 ****
if (!processing_template_decl)
expr = break_out_cleanups (expr);
! add_tree (build_min_nt (EXPR_STMT, expr));
}
finish_stmt ();
--- 250,256 ----
if (!processing_template_decl)
expr = break_out_cleanups (expr);
! add_tree (build_stmt (EXPR_STMT, expr));
}
finish_stmt ();
*************** begin_if_stmt ()
*** 269,275 ****
{
tree r;
do_pushlevel ();
! r = build_min_nt (IF_STMT, NULL_TREE, NULL_TREE, NULL_TREE);
add_tree (r);
return r;
}
--- 269,275 ----
{
tree r;
do_pushlevel ();
! r = build_stmt (IF_STMT, NULL_TREE, NULL_TREE, NULL_TREE);
add_tree (r);
return r;
}
*************** tree
*** 344,350 ****
begin_while_stmt ()
{
tree r;
! r = build_min_nt (WHILE_STMT, NULL_TREE, NULL_TREE);
add_tree (r);
do_pushlevel ();
return r;
--- 344,350 ----
begin_while_stmt ()
{
tree r;
! r = build_stmt (WHILE_STMT, NULL_TREE, NULL_TREE);
add_tree (r);
do_pushlevel ();
return r;
*************** finish_while_stmt (while_stmt)
*** 380,386 ****
tree
begin_do_stmt ()
{
! tree r = build_min_nt (DO_STMT, NULL_TREE, NULL_TREE);
add_tree (r);
return r;
}
--- 380,386 ----
tree
begin_do_stmt ()
{
! tree r = build_stmt (DO_STMT, NULL_TREE, NULL_TREE);
add_tree (r);
return r;
}
*************** finish_return_stmt (expr)
*** 439,445 ****
return;
}
}
! add_tree (build_min_nt (RETURN_STMT, expr));
finish_stmt ();
}
--- 439,445 ----
return;
}
}
! add_tree (build_stmt (RETURN_STMT, expr));
finish_stmt ();
}
*************** begin_for_stmt ()
*** 450,457 ****
{
tree r;
! r = build_min_nt (FOR_STMT, NULL_TREE, NULL_TREE,
! NULL_TREE, NULL_TREE);
NEW_FOR_SCOPE_P (r) = flag_new_for_scope > 0;
add_tree (r);
if (NEW_FOR_SCOPE_P (r))
--- 450,457 ----
{
tree r;
! r = build_stmt (FOR_STMT, NULL_TREE, NULL_TREE,
! NULL_TREE, NULL_TREE);
NEW_FOR_SCOPE_P (r) = flag_new_for_scope > 0;
add_tree (r);
if (NEW_FOR_SCOPE_P (r))
*************** finish_for_stmt (for_stmt)
*** 520,527 ****
void
finish_break_stmt ()
{
! emit_line_note (input_filename, lineno);
! add_tree (build_min_nt (BREAK_STMT));
}
/* Finish a continue-statement. */
--- 520,526 ----
void
finish_break_stmt ()
{
! add_tree (build_stmt (BREAK_STMT));
}
/* Finish a continue-statement. */
*************** finish_break_stmt ()
*** 529,536 ****
void
finish_continue_stmt ()
{
! emit_line_note (input_filename, lineno);
! add_tree (build_min_nt (CONTINUE_STMT));
}
/* Begin a switch-statement. Returns a new SWITCH_STMT if
--- 528,534 ----
void
finish_continue_stmt ()
{
! add_tree (build_stmt (CONTINUE_STMT));
}
/* Begin a switch-statement. Returns a new SWITCH_STMT if
*************** tree
*** 540,546 ****
begin_switch_stmt ()
{
tree r;
! r = build_min_nt (SWITCH_STMT, NULL_TREE, NULL_TREE);
add_tree (r);
do_pushlevel ();
return r;
--- 538,544 ----
begin_switch_stmt ()
{
tree r;
! r = build_stmt (SWITCH_STMT, NULL_TREE, NULL_TREE);
add_tree (r);
do_pushlevel ();
return r;
*************** finish_case_label (low_value, high_value
*** 594,600 ****
{
/* Add a representation for the case label to the statement
tree. */
! add_tree (build_min_nt (CASE_LABEL, low_value, high_value));
/* And warn about crossing initializations, etc. */
if (!processing_template_decl)
define_case_label ();
--- 592,598 ----
{
/* Add a representation for the case label to the statement
tree. */
! add_tree (build_stmt (CASE_LABEL, low_value, high_value));
/* And warn about crossing initializations, etc. */
if (!processing_template_decl)
define_case_label ();
*************** void genrtl_try_block (t)
*** 649,655 ****
tree
begin_try_block ()
{
! tree r = build_min_nt (TRY_BLOCK, NULL_TREE, NULL_TREE);
add_tree (r);
return r;
}
--- 647,653 ----
tree
begin_try_block ()
{
! tree r = build_stmt (TRY_BLOCK, NULL_TREE, NULL_TREE);
add_tree (r);
return r;
}
*************** begin_try_block ()
*** 659,665 ****
tree
begin_function_try_block ()
{
! tree r = build_min_nt (TRY_BLOCK, NULL_TREE, NULL_TREE);
FN_TRY_BLOCK_P (r) = 1;
add_tree (r);
return r;
--- 657,663 ----
tree
begin_function_try_block ()
{
! tree r = build_stmt (TRY_BLOCK, NULL_TREE, NULL_TREE);
FN_TRY_BLOCK_P (r) = 1;
add_tree (r);
return r;
*************** tree
*** 761,767 ****
begin_handler ()
{
tree r;
! r = build_min_nt (HANDLER, NULL_TREE, NULL_TREE);
add_tree (r);
do_pushlevel ();
return r;
--- 759,765 ----
begin_handler ()
{
tree r;
! r = build_stmt (HANDLER, NULL_TREE, NULL_TREE);
add_tree (r);
do_pushlevel ();
return r;
*************** begin_compound_stmt (has_no_scope)
*** 857,863 ****
tree r;
int is_try = 0;
! r = build_min_nt (COMPOUND_STMT, NULL_TREE);
if (last_tree && TREE_CODE (last_tree) == TRY_BLOCK)
is_try = 1;
--- 855,861 ----
tree r;
int is_try = 0;
! r = build_stmt (COMPOUND_STMT, NULL_TREE);
if (last_tree && TREE_CODE (last_tree) == TRY_BLOCK)
is_try = 1;
*************** begin_compound_stmt (has_no_scope)
*** 872,878 ****
{
do_pushlevel ();
if (is_try)
! note_level_for_eh ();
}
else
/* Normally, we try hard to keep the BLOCK for a
--- 870,876 ----
{
do_pushlevel ();
if (is_try)
! note_level_for_eh ();
}
else
/* Normally, we try hard to keep the BLOCK for a
*************** finish_asm_stmt (cv_qualifier, string, o
*** 955,963 ****
for (t = input_operands; t; t = TREE_CHAIN (t))
TREE_VALUE (t) = decay_conversion (TREE_VALUE (t));
! r = build_min_nt (ASM_STMT, cv_qualifier, string,
! output_operands, input_operands,
! clobbers);
add_tree (r);
}
--- 953,961 ----
for (t = input_operands; t; t = TREE_CHAIN (t))
TREE_VALUE (t) = decay_conversion (TREE_VALUE (t));
! r = build_stmt (ASM_STMT, cv_qualifier, string,
! output_operands, input_operands,
! clobbers);
add_tree (r);
}
*************** finish_label_stmt (name)
*** 968,974 ****
tree name;
{
tree decl = define_label (input_filename, lineno, name);
! add_tree (build_min_nt (LABEL_STMT, decl));
}
/* Finish a series of declarations for local labels. G++ allows users
--- 966,972 ----
tree name;
{
tree decl = define_label (input_filename, lineno, name);
! add_tree (build_stmt (LABEL_STMT, decl));
}
/* Finish a series of declarations for local labels. G++ allows users
*************** add_decl_stmt (decl)
*** 993,999 ****
tree decl_stmt;
/* We need the type to last until instantiation time. */
! decl_stmt = build_min_nt (DECL_STMT, decl);
add_tree (decl_stmt);
}
--- 991,997 ----
tree decl_stmt;
/* We need the type to last until instantiation time. */
! decl_stmt = build_stmt (DECL_STMT, decl);
add_tree (decl_stmt);
}
*************** void
*** 1014,1020 ****
finish_subobject (cleanup)
tree cleanup;
{
! tree r = build_min_nt (SUBOBJECT, cleanup);
add_tree (r);
}
--- 1012,1018 ----
finish_subobject (cleanup)
tree cleanup;
{
! tree r = build_stmt (SUBOBJECT, cleanup);
add_tree (r);
}
*************** finish_decl_cleanup (decl, cleanup)
*** 1025,1031 ****
tree decl;
tree cleanup;
{
! add_tree (build_min_nt (CLEANUP_STMT, decl, cleanup));
}
/* Generate the RTL for a RETURN_INIT. */
--- 1023,1029 ----
tree decl;
tree cleanup;
{
! add_tree (build_stmt (CLEANUP_STMT, decl, cleanup));
}
/* Generate the RTL for a RETURN_INIT. */
*************** finish_named_return_value (return_id, in
*** 1125,1131 ****
DECL_INITIAL (decl) = init;
if (doing_semantic_analysis_p ())
pushdecl (decl);
! add_tree (build_min_nt (RETURN_INIT, return_id, init));
}
/* Don't use tree-inlining for functions with named return values.
--- 1123,1129 ----
DECL_INITIAL (decl) = init;
if (doing_semantic_analysis_p ())
pushdecl (decl);
! add_tree (build_stmt (RETURN_INIT, return_id, init));
}
/* Don't use tree-inlining for functions with named return values.
*************** setup_vtbl_ptr (member_init_list, base_i
*** 1219,1225 ****
tree ctor_stmt;
/* Mark the beginning of the constructor. */
! ctor_stmt = build_min_nt (CTOR_STMT);
CTOR_BEGIN_P (ctor_stmt) = 1;
add_tree (ctor_stmt);
--- 1217,1223 ----
tree ctor_stmt;
/* Mark the beginning of the constructor. */
! ctor_stmt = build_stmt (CTOR_STMT);
CTOR_BEGIN_P (ctor_stmt) = 1;
add_tree (ctor_stmt);
*************** add_scope_stmt (begin_p, partial_p)
*** 1299,1305 ****
tree top;
/* Build the statement. */
! ss = build_min_nt (SCOPE_STMT, NULL_TREE);
SCOPE_BEGIN_P (ss) = begin_p;
SCOPE_PARTIAL_P (ss) = partial_p;
--- 1297,1303 ----
tree top;
/* Build the statement. */
! ss = build_stmt (SCOPE_STMT, NULL_TREE);
SCOPE_BEGIN_P (ss) = begin_p;
SCOPE_PARTIAL_P (ss) = partial_p;