c-common.h (build_stmt): Declare.
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. From-SVN: r34943
This commit is contained in:
parent
f12eef5818
commit
0dfdeca6e0
9 changed files with 256 additions and 130 deletions
|
@ -1,3 +1,28 @@
|
|||
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.
|
||||
|
||||
2000-07-09 Jason Merrill <jason@redhat.com>
|
||||
|
||||
* expr.c (expand_expr): Bail earlier if we get an error_mark_node.
|
||||
|
|
|
@ -457,7 +457,11 @@ extern tree lang_expand_stmt PARAMS ((tree));
|
|||
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)
|
||||
|
||||
|
|
58
gcc/c-decl.c
58
gcc/c-decl.c
|
@ -6841,7 +6841,62 @@ do_case (low_value, high_value)
|
|||
tree low_value;
|
||||
tree high_value;
|
||||
{
|
||||
abort ();
|
||||
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
|
||||
|
@ -6863,3 +6918,4 @@ set_current_function_name_declared (i)
|
|||
{
|
||||
abort ();
|
||||
}
|
||||
|
||||
|
|
109
gcc/c-parse.in
109
gcc/c-parse.in
|
@ -1843,23 +1843,21 @@ stmt:
|
|||
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"); }
|
||||
{ tree break_stmt = build_break_stmt ();
|
||||
stmt_count++;
|
||||
genrtl_break_stmt (); }
|
||||
| CONTINUE ';'
|
||||
{ stmt_count++;
|
||||
emit_line_note ($<filename>-1, $<lineno>0);
|
||||
if (! expand_continue_loop (NULL_PTR))
|
||||
error ("continue statement not within a loop"); }
|
||||
{ tree continue_stmt = build_continue_stmt ();
|
||||
stmt_count++;
|
||||
genrtl_continue_stmt (); }
|
||||
| RETURN ';'
|
||||
{ stmt_count++;
|
||||
emit_line_note ($<filename>-1, $<lineno>0);
|
||||
c_expand_return (NULL_TREE); }
|
||||
{ tree return_stmt = build_return_stmt (NULL_TREE);
|
||||
stmt_count++;
|
||||
genrtl_return_stmt (RETURN_EXPR(return_stmt)); }
|
||||
| RETURN expr ';'
|
||||
{ stmt_count++;
|
||||
emit_line_note ($<filename>-1, $<lineno>0);
|
||||
c_expand_return ($2); }
|
||||
{ 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);
|
||||
|
@ -1971,82 +1969,23 @@ all_iter_stmt_with_decl:
|
|||
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);
|
||||
|
||||
{ tree case_label_tree = build_case_label ($2, 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 (); }
|
||||
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 ':'
|
||||
{ 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");
|
||||
{ tree case_label_tree = build_case_label ($2, $4);
|
||||
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 (); }
|
||||
genrtl_case_label(CASE_LOW(case_label_tree), CASE_HIGH(case_label_tree));
|
||||
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);
|
||||
{ tree case_label_tree = build_case_label (NULL_TREE, NULL_TREE);
|
||||
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 (); }
|
||||
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++;
|
||||
|
|
|
@ -36,6 +36,38 @@ Boston, MA 02111-1307, USA. */
|
|||
#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
|
||||
|
@ -276,6 +308,15 @@ genrtl_do_stmt (t)
|
|||
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
|
||||
|
@ -319,6 +360,14 @@ genrtl_for_stmt (t)
|
|||
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
|
||||
|
@ -329,6 +378,14 @@ genrtl_break_stmt ()
|
|||
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
|
||||
|
@ -388,6 +445,17 @@ genrtl_switch_stmt (t)
|
|||
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. */
|
||||
|
||||
void
|
||||
|
|
|
@ -1,3 +1,39 @@
|
|||
2000-07-10 Benjamin Chelf <chelf@codesourcery.com>
|
||||
|
||||
* 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.
|
||||
* decl.c (finish_constructor_body): Likewise.
|
||||
(finish_destructor_body): Likewise.
|
||||
* optimize.c (copy_body_r): Likewise.
|
||||
(initialize_inlined_parameters): Likewise.
|
||||
(declare_return_variable): Likewise.
|
||||
(expand_call_inline): Likewise.
|
||||
|
||||
2000-07-10 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
* semantics.c (expand_body): Sync interface information
|
||||
|
|
|
@ -14097,7 +14097,7 @@ finish_constructor_body ()
|
|||
{
|
||||
/* Any return from a constructor will end up here. */
|
||||
if (ctor_label)
|
||||
add_tree (build_min_nt (LABEL_STMT, 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. */
|
||||
|
@ -14106,7 +14106,7 @@ finish_constructor_body ()
|
|||
constructor to a return of `this'. */
|
||||
finish_return_stmt (NULL_TREE);
|
||||
/* Mark the end of the constructor. */
|
||||
add_tree (build_min_nt (CTOR_STMT));
|
||||
add_tree (build_stmt (CTOR_STMT));
|
||||
}
|
||||
|
||||
/* At the end of every destructor we generate code to restore virtual
|
||||
|
@ -14125,7 +14125,7 @@ finish_destructor_body ()
|
|||
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));
|
||||
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
|
||||
|
|
|
@ -279,7 +279,7 @@ copy_body_r (tp, walk_subtrees, data)
|
|||
tree goto_stmt;
|
||||
|
||||
/* Build the GOTO_STMT. */
|
||||
goto_stmt = build_min_nt (GOTO_STMT, id->ret_label);
|
||||
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
|
||||
|
@ -287,8 +287,8 @@ copy_body_r (tp, walk_subtrees, data)
|
|||
RESULT_DECL. */
|
||||
if (RETURN_EXPR (return_stmt))
|
||||
{
|
||||
*tp = build_min_nt (EXPR_STMT,
|
||||
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;
|
||||
}
|
||||
|
@ -431,7 +431,7 @@ initialize_inlined_parameters (id, args, fn)
|
|||
(splay_tree_value) var);
|
||||
|
||||
/* Declare this new variable. */
|
||||
init_stmt = build_min_nt (DECL_STMT, var);
|
||||
init_stmt = build_stmt (DECL_STMT, var);
|
||||
TREE_CHAIN (init_stmt) = init_stmts;
|
||||
init_stmts = init_stmt;
|
||||
|
||||
|
@ -444,9 +444,9 @@ initialize_inlined_parameters (id, args, fn)
|
|||
DECL_INITIAL (var) = value;
|
||||
else
|
||||
{
|
||||
init_stmt = build_min_nt (EXPR_STMT,
|
||||
build (INIT_EXPR, TREE_TYPE (p),
|
||||
var, value));
|
||||
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. */
|
||||
|
@ -515,12 +515,12 @@ declare_return_variable (id, use_stmt)
|
|||
(splay_tree_value) var);
|
||||
|
||||
/* Build the USE_STMT. */
|
||||
*use_stmt = build_min_nt (EXPR_STMT, var);
|
||||
*use_stmt = build_stmt (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);
|
||||
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
|
||||
|
@ -704,7 +704,7 @@ expand_call_inline (tp, walk_subtrees, data)
|
|||
/* 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_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);
|
||||
|
@ -729,7 +729,7 @@ expand_call_inline (tp, walk_subtrees, data)
|
|||
*inlined_body = copy_body (id);
|
||||
|
||||
/* Close the block for the parameters. */
|
||||
scope_stmt = build_min_nt (SCOPE_STMT, DECL_INITIAL (fn));
|
||||
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,
|
||||
|
@ -743,7 +743,7 @@ expand_call_inline (tp, walk_subtrees, data)
|
|||
may cause RTL to be generated. */
|
||||
STMT_EXPR_STMT (expr)
|
||||
= chainon (STMT_EXPR_STMT (expr),
|
||||
build_min_nt (LABEL_STMT, id->ret_label));
|
||||
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. */
|
||||
|
|
|
@ -206,7 +206,7 @@ finish_goto_stmt (destination)
|
|||
|
||||
check_goto (destination);
|
||||
|
||||
add_tree (build_min_nt (GOTO_STMT, destination));
|
||||
add_tree (build_stmt (GOTO_STMT, destination));
|
||||
}
|
||||
|
||||
/* COND is the condition-expression for an if, while, etc.,
|
||||
|
@ -250,7 +250,7 @@ finish_expr_stmt (expr)
|
|||
if (!processing_template_decl)
|
||||
expr = break_out_cleanups (expr);
|
||||
|
||||
add_tree (build_min_nt (EXPR_STMT, expr));
|
||||
add_tree (build_stmt (EXPR_STMT, expr));
|
||||
}
|
||||
|
||||
finish_stmt ();
|
||||
|
@ -269,7 +269,7 @@ begin_if_stmt ()
|
|||
{
|
||||
tree r;
|
||||
do_pushlevel ();
|
||||
r = build_min_nt (IF_STMT, NULL_TREE, NULL_TREE, NULL_TREE);
|
||||
r = build_stmt (IF_STMT, NULL_TREE, NULL_TREE, NULL_TREE);
|
||||
add_tree (r);
|
||||
return r;
|
||||
}
|
||||
|
@ -344,7 +344,7 @@ tree
|
|||
begin_while_stmt ()
|
||||
{
|
||||
tree r;
|
||||
r = build_min_nt (WHILE_STMT, NULL_TREE, NULL_TREE);
|
||||
r = build_stmt (WHILE_STMT, NULL_TREE, NULL_TREE);
|
||||
add_tree (r);
|
||||
do_pushlevel ();
|
||||
return r;
|
||||
|
@ -380,7 +380,7 @@ finish_while_stmt (while_stmt)
|
|||
tree
|
||||
begin_do_stmt ()
|
||||
{
|
||||
tree r = build_min_nt (DO_STMT, NULL_TREE, NULL_TREE);
|
||||
tree r = build_stmt (DO_STMT, NULL_TREE, NULL_TREE);
|
||||
add_tree (r);
|
||||
return r;
|
||||
}
|
||||
|
@ -439,7 +439,7 @@ finish_return_stmt (expr)
|
|||
return;
|
||||
}
|
||||
}
|
||||
add_tree (build_min_nt (RETURN_STMT, expr));
|
||||
add_tree (build_stmt (RETURN_STMT, expr));
|
||||
finish_stmt ();
|
||||
}
|
||||
|
||||
|
@ -450,8 +450,8 @@ begin_for_stmt ()
|
|||
{
|
||||
tree r;
|
||||
|
||||
r = build_min_nt (FOR_STMT, NULL_TREE, NULL_TREE,
|
||||
NULL_TREE, NULL_TREE);
|
||||
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))
|
||||
|
@ -520,8 +520,7 @@ finish_for_stmt (for_stmt)
|
|||
void
|
||||
finish_break_stmt ()
|
||||
{
|
||||
emit_line_note (input_filename, lineno);
|
||||
add_tree (build_min_nt (BREAK_STMT));
|
||||
add_tree (build_stmt (BREAK_STMT));
|
||||
}
|
||||
|
||||
/* Finish a continue-statement. */
|
||||
|
@ -529,8 +528,7 @@ finish_break_stmt ()
|
|||
void
|
||||
finish_continue_stmt ()
|
||||
{
|
||||
emit_line_note (input_filename, lineno);
|
||||
add_tree (build_min_nt (CONTINUE_STMT));
|
||||
add_tree (build_stmt (CONTINUE_STMT));
|
||||
}
|
||||
|
||||
/* Begin a switch-statement. Returns a new SWITCH_STMT if
|
||||
|
@ -540,7 +538,7 @@ tree
|
|||
begin_switch_stmt ()
|
||||
{
|
||||
tree r;
|
||||
r = build_min_nt (SWITCH_STMT, NULL_TREE, NULL_TREE);
|
||||
r = build_stmt (SWITCH_STMT, NULL_TREE, NULL_TREE);
|
||||
add_tree (r);
|
||||
do_pushlevel ();
|
||||
return r;
|
||||
|
@ -594,7 +592,7 @@ finish_case_label (low_value, high_value)
|
|||
{
|
||||
/* Add a representation for the case label to the statement
|
||||
tree. */
|
||||
add_tree (build_min_nt (CASE_LABEL, low_value, high_value));
|
||||
add_tree (build_stmt (CASE_LABEL, low_value, high_value));
|
||||
/* And warn about crossing initializations, etc. */
|
||||
if (!processing_template_decl)
|
||||
define_case_label ();
|
||||
|
@ -649,7 +647,7 @@ void genrtl_try_block (t)
|
|||
tree
|
||||
begin_try_block ()
|
||||
{
|
||||
tree r = build_min_nt (TRY_BLOCK, NULL_TREE, NULL_TREE);
|
||||
tree r = build_stmt (TRY_BLOCK, NULL_TREE, NULL_TREE);
|
||||
add_tree (r);
|
||||
return r;
|
||||
}
|
||||
|
@ -659,7 +657,7 @@ begin_try_block ()
|
|||
tree
|
||||
begin_function_try_block ()
|
||||
{
|
||||
tree r = build_min_nt (TRY_BLOCK, NULL_TREE, NULL_TREE);
|
||||
tree r = build_stmt (TRY_BLOCK, NULL_TREE, NULL_TREE);
|
||||
FN_TRY_BLOCK_P (r) = 1;
|
||||
add_tree (r);
|
||||
return r;
|
||||
|
@ -761,7 +759,7 @@ tree
|
|||
begin_handler ()
|
||||
{
|
||||
tree r;
|
||||
r = build_min_nt (HANDLER, NULL_TREE, NULL_TREE);
|
||||
r = build_stmt (HANDLER, NULL_TREE, NULL_TREE);
|
||||
add_tree (r);
|
||||
do_pushlevel ();
|
||||
return r;
|
||||
|
@ -857,7 +855,7 @@ begin_compound_stmt (has_no_scope)
|
|||
tree r;
|
||||
int is_try = 0;
|
||||
|
||||
r = build_min_nt (COMPOUND_STMT, NULL_TREE);
|
||||
r = build_stmt (COMPOUND_STMT, NULL_TREE);
|
||||
|
||||
if (last_tree && TREE_CODE (last_tree) == TRY_BLOCK)
|
||||
is_try = 1;
|
||||
|
@ -872,7 +870,7 @@ begin_compound_stmt (has_no_scope)
|
|||
{
|
||||
do_pushlevel ();
|
||||
if (is_try)
|
||||
note_level_for_eh ();
|
||||
note_level_for_eh ();
|
||||
}
|
||||
else
|
||||
/* Normally, we try hard to keep the BLOCK for a
|
||||
|
@ -955,9 +953,9 @@ finish_asm_stmt (cv_qualifier, string, output_operands,
|
|||
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);
|
||||
r = build_stmt (ASM_STMT, cv_qualifier, string,
|
||||
output_operands, input_operands,
|
||||
clobbers);
|
||||
add_tree (r);
|
||||
}
|
||||
|
||||
|
@ -968,7 +966,7 @@ finish_label_stmt (name)
|
|||
tree name;
|
||||
{
|
||||
tree decl = define_label (input_filename, lineno, name);
|
||||
add_tree (build_min_nt (LABEL_STMT, decl));
|
||||
add_tree (build_stmt (LABEL_STMT, decl));
|
||||
}
|
||||
|
||||
/* Finish a series of declarations for local labels. G++ allows users
|
||||
|
@ -993,7 +991,7 @@ add_decl_stmt (decl)
|
|||
tree decl_stmt;
|
||||
|
||||
/* We need the type to last until instantiation time. */
|
||||
decl_stmt = build_min_nt (DECL_STMT, decl);
|
||||
decl_stmt = build_stmt (DECL_STMT, decl);
|
||||
add_tree (decl_stmt);
|
||||
}
|
||||
|
||||
|
@ -1014,7 +1012,7 @@ void
|
|||
finish_subobject (cleanup)
|
||||
tree cleanup;
|
||||
{
|
||||
tree r = build_min_nt (SUBOBJECT, cleanup);
|
||||
tree r = build_stmt (SUBOBJECT, cleanup);
|
||||
add_tree (r);
|
||||
}
|
||||
|
||||
|
@ -1025,7 +1023,7 @@ finish_decl_cleanup (decl, cleanup)
|
|||
tree decl;
|
||||
tree cleanup;
|
||||
{
|
||||
add_tree (build_min_nt (CLEANUP_STMT, decl, cleanup));
|
||||
add_tree (build_stmt (CLEANUP_STMT, decl, cleanup));
|
||||
}
|
||||
|
||||
/* Generate the RTL for a RETURN_INIT. */
|
||||
|
@ -1125,7 +1123,7 @@ finish_named_return_value (return_id, init)
|
|||
DECL_INITIAL (decl) = init;
|
||||
if (doing_semantic_analysis_p ())
|
||||
pushdecl (decl);
|
||||
add_tree (build_min_nt (RETURN_INIT, return_id, init));
|
||||
add_tree (build_stmt (RETURN_INIT, return_id, init));
|
||||
}
|
||||
|
||||
/* Don't use tree-inlining for functions with named return values.
|
||||
|
@ -1219,7 +1217,7 @@ setup_vtbl_ptr (member_init_list, base_init_list)
|
|||
tree ctor_stmt;
|
||||
|
||||
/* Mark the beginning of the constructor. */
|
||||
ctor_stmt = build_min_nt (CTOR_STMT);
|
||||
ctor_stmt = build_stmt (CTOR_STMT);
|
||||
CTOR_BEGIN_P (ctor_stmt) = 1;
|
||||
add_tree (ctor_stmt);
|
||||
|
||||
|
@ -1299,7 +1297,7 @@ add_scope_stmt (begin_p, partial_p)
|
|||
tree top;
|
||||
|
||||
/* Build the statement. */
|
||||
ss = build_min_nt (SCOPE_STMT, NULL_TREE);
|
||||
ss = build_stmt (SCOPE_STMT, NULL_TREE);
|
||||
SCOPE_BEGIN_P (ss) = begin_p;
|
||||
SCOPE_PARTIAL_P (ss) = partial_p;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue