Commit 9e51cf9d by Richard Henderson Committed by Richard Henderson

c-common.h (c_begin_if_stmt, [...]): Remove decls.

        * c-common.h (c_begin_if_stmt, c_begin_while_stmt,
        c_finish_while_stmt_cond): Remove decls.
        * c-parse.in (if_prefix): Don't save c_begin_if_stmt result.
        * c-typeck.c (c_begin_if_stmt): Return void.
        (c_begin_else): Tidy.  Save stmt_count.
        * c-tree.h (c_begin_if_stmt): Update decl.
        * objc/objc-act.c (objc_build_try_enter_fragment,
        objc_build_extract_fragment, objc_build_try_epilogue,
        objc_build_catch_stmt, objc_build_catch_epilogue,
        objc_build_finally_prologue, objc_build_finally_epilogue): Update
        for if builder function changes.

From-SVN: r83280
parent 902fd62c
2004-06-16 Richard Henderson <rth@redhat.com>
* c-common.h (c_begin_if_stmt, c_begin_while_stmt,
c_finish_while_stmt_cond): Remove decls.
* c-parse.in (if_prefix): Don't save c_begin_if_stmt result.
* c-typeck.c (c_begin_if_stmt): Return void.
(c_begin_else): Tidy. Save stmt_count.
* c-tree.h (c_begin_if_stmt): Update decl.
* objc/objc-act.c (objc_build_try_enter_fragment,
objc_build_extract_fragment, objc_build_try_epilogue,
objc_build_catch_stmt, objc_build_catch_epilogue,
objc_build_finally_prologue, objc_build_finally_epilogue): Update
for if builder function changes.
2004-06-16 Ulrich Weigand <uweigand@de.ibm.com> 2004-06-16 Ulrich Weigand <uweigand@de.ibm.com>
* config/s390/s390.c (struct machine_function): New member * config/s390/s390.c (struct machine_function): New member
......
...@@ -300,9 +300,6 @@ extern void push_cleanup (tree, tree, bool); ...@@ -300,9 +300,6 @@ extern void push_cleanup (tree, tree, bool);
extern tree walk_stmt_tree (tree *, walk_tree_fn, void *); extern tree walk_stmt_tree (tree *, walk_tree_fn, void *);
extern void prep_stmt (tree); extern void prep_stmt (tree);
extern tree c_begin_if_stmt (void);
extern tree c_begin_while_stmt (void);
extern void c_finish_while_stmt_cond (tree, tree);
extern int c_expand_decl (tree); extern int c_expand_decl (tree);
extern int field_decl_cmp (const void *, const void *); extern int field_decl_cmp (const void *, const void *);
......
...@@ -2069,7 +2069,7 @@ if_prefix: ...@@ -2069,7 +2069,7 @@ if_prefix:
line containing the "if", and not the line containing line containing the "if", and not the line containing
the close-parenthesis. */ the close-parenthesis. */
IF IF
{ $<ttype>$ = c_begin_if_stmt (); } { c_begin_if_stmt (); }
'(' expr ')' '(' expr ')'
{ c_finish_if_cond ($4, compstmt_count, ++stmt_count); } { c_finish_if_cond ($4, compstmt_count, ++stmt_count); }
; ;
......
...@@ -256,7 +256,7 @@ extern tree c_convert_parm_for_inlining (tree, tree, tree, int); ...@@ -256,7 +256,7 @@ extern tree c_convert_parm_for_inlining (tree, tree, tree, int);
extern int c_types_compatible_p (tree, tree); extern int c_types_compatible_p (tree, tree);
extern tree c_begin_compound_stmt (bool); extern tree c_begin_compound_stmt (bool);
extern tree c_end_compound_stmt (tree, bool); extern tree c_end_compound_stmt (tree, bool);
extern tree c_begin_if_stmt (void); extern void c_begin_if_stmt (void);
extern void c_finish_if_cond (tree, int, int); extern void c_finish_if_cond (tree, int, int);
extern void c_finish_then (tree); extern void c_finish_then (tree);
extern void c_begin_else (int); extern void c_begin_else (int);
......
...@@ -6486,7 +6486,7 @@ static int if_stack_pointer = 0; ...@@ -6486,7 +6486,7 @@ static int if_stack_pointer = 0;
/* Begin an if-statement. Returns a newly created IF_STMT if /* Begin an if-statement. Returns a newly created IF_STMT if
appropriate. */ appropriate. */
tree void
c_begin_if_stmt (void) c_begin_if_stmt (void)
{ {
tree r; tree r;
...@@ -6546,20 +6546,22 @@ c_finish_then (tree then_stmt) ...@@ -6546,20 +6546,22 @@ c_finish_then (tree then_stmt)
void void
c_begin_else (int stmt_count) c_begin_else (int stmt_count)
{ {
if_elt *elt = &if_stack[if_stack_pointer - 1];
/* An ambiguous else warning must be generated for the enclosing if /* An ambiguous else warning must be generated for the enclosing if
statement, unless we see an else branch for that one, too. */ statement, unless we see an else branch for that one, too. */
if (warn_parentheses if (warn_parentheses
&& if_stack_pointer > 1 && if_stack_pointer > 1
&& (if_stack[if_stack_pointer - 1].compstmt_count && (elt[0].compstmt_count == elt[-1].compstmt_count))
== if_stack[if_stack_pointer - 2].compstmt_count)) elt[-1].needs_warning = 1;
if_stack[if_stack_pointer - 2].needs_warning = 1;
/* Even if a nested if statement had an else branch, it can't be /* Even if a nested if statement had an else branch, it can't be
ambiguous if this one also has an else. So don't warn in that ambiguous if this one also has an else. So don't warn in that
case. Also don't warn for any if statements nested in this else. */ case. Also don't warn for any if statements nested in this else. */
if_stack[if_stack_pointer - 1].needs_warning = 0; elt->needs_warning = 0;
if_stack[if_stack_pointer - 1].compstmt_count--; elt->compstmt_count--;
if_stack[if_stack_pointer - 1].saw_else = 1; elt->saw_else = 1;
elt->stmt_count = stmt_count;
} }
/* Called after the else-clause for an if-statement is processed. */ /* Called after the else-clause for an if-statement is processed. */
......
...@@ -2780,7 +2780,7 @@ objc_build_try_enter_fragment (void) ...@@ -2780,7 +2780,7 @@ objc_build_try_enter_fragment (void)
/* objc_exception_try_enter(&_stackExceptionData); /* objc_exception_try_enter(&_stackExceptionData);
if (!_setjmp(&_stackExceptionData.buf)) { */ if (!_setjmp(&_stackExceptionData.buf)) { */
tree func_params, if_stmt, cond; tree func_params, cond;
func_params func_params
= tree_cons (NULL_TREE, = tree_cons (NULL_TREE,
...@@ -2802,7 +2802,7 @@ objc_build_try_enter_fragment (void) ...@@ -2802,7 +2802,7 @@ objc_build_try_enter_fragment (void)
#error #error
#endif #endif
if_stmt = c_begin_if_stmt (); c_begin_if_stmt ();
if_nesting_count++; if_nesting_count++;
/* If <setjmp.h> has been included, the _setjmp prototype has /* If <setjmp.h> has been included, the _setjmp prototype has
acquired a real, breathing type for its parameter. Cast our acquired a real, breathing type for its parameter. Cast our
...@@ -2821,7 +2821,7 @@ objc_build_try_enter_fragment (void) ...@@ -2821,7 +2821,7 @@ objc_build_try_enter_fragment (void)
cond = build_unary_op (TRUTH_NOT_EXPR, cond = build_unary_op (TRUTH_NOT_EXPR,
build_function_call (objc_setjmp_decl, func_params), build_function_call (objc_setjmp_decl, func_params),
0); 0);
c_expand_start_cond (lang_hooks.truthvalue_conversion (cond), 0, if_stmt); c_finish_if_cond (cond, 0, 0);
objc_enter_block (); objc_enter_block ();
} }
...@@ -2865,14 +2865,14 @@ objc_build_extract_fragment (void) ...@@ -2865,14 +2865,14 @@ objc_build_extract_fragment (void)
c_finish_then (objc_exit_block ()); c_finish_then (objc_exit_block ());
c_expand_start_else (); c_begin_else (0);
objc_enter_block (); objc_enter_block ();
c_expand_expr_stmt (build_modify_expr c_expand_expr_stmt (build_modify_expr
(TREE_VALUE (objc_rethrow_exception), (TREE_VALUE (objc_rethrow_exception),
NOP_EXPR, NOP_EXPR,
objc_build_extract_expr ())); objc_build_extract_expr ()));
c_finish_else (objc_exit_block ()); c_finish_else (objc_exit_block ());
c_expand_end_cond (); c_finish_if_stmt (1);
if_nesting_count--; if_nesting_count--;
} }
...@@ -2928,11 +2928,9 @@ objc_build_try_epilogue (int also_catch_prologue) ...@@ -2928,11 +2928,9 @@ objc_build_try_epilogue (int also_catch_prologue)
if(!_setjmp(&_stackExceptionData.buf)) { if(!_setjmp(&_stackExceptionData.buf)) {
if (0) { */ if (0) { */
tree if_stmt;
c_finish_then (objc_exit_block ()); c_finish_then (objc_exit_block ());
c_expand_start_else (); c_begin_else (0);
objc_enter_block (); objc_enter_block ();
objc_caught_exception objc_caught_exception
= tree_cons (NULL_TREE, = tree_cons (NULL_TREE,
...@@ -2943,10 +2941,9 @@ objc_build_try_epilogue (int also_catch_prologue) ...@@ -2943,10 +2941,9 @@ objc_build_try_epilogue (int also_catch_prologue)
objc_caught_exception); objc_caught_exception);
objc_build_try_enter_fragment (); objc_build_try_enter_fragment ();
val_stack_push (&catch_count_stack, 1); val_stack_push (&catch_count_stack, 1);
if_stmt = c_begin_if_stmt (); c_begin_if_stmt ();
if_nesting_count++; if_nesting_count++;
c_expand_start_cond (lang_hooks.truthvalue_conversion (boolean_false_node), c_finish_if_cond (boolean_false_node, 0, 0);
0, if_stmt);
objc_enter_block (); objc_enter_block ();
/* Start a new chain of @catch statements for this @try. */ /* Start a new chain of @catch statements for this @try. */
...@@ -2970,7 +2967,7 @@ objc_build_catch_stmt (tree catch_expr) ...@@ -2970,7 +2967,7 @@ objc_build_catch_stmt (tree catch_expr)
/* } else if (objc_exception_match(objc_get_class("SomeClass"), _caughtException)) { /* } else if (objc_exception_match(objc_get_class("SomeClass"), _caughtException)) {
register SomeClass *e = _caughtException; */ register SomeClass *e = _caughtException; */
tree if_stmt, cond, func_params, prev_catch, var_name, var_type; tree cond, func_params, prev_catch, var_name, var_type;
int catch_id; int catch_id;
#ifndef OBJCPLUS #ifndef OBJCPLUS
...@@ -3014,9 +3011,9 @@ objc_build_catch_stmt (tree catch_expr) ...@@ -3014,9 +3011,9 @@ objc_build_catch_stmt (tree catch_expr)
c_finish_then (objc_exit_block ()); c_finish_then (objc_exit_block ());
c_expand_start_else (); c_begin_else (0);
catch_count_stack->val++; catch_count_stack->val++;
if_stmt = c_begin_if_stmt (); c_begin_if_stmt ();
if_nesting_count++; if_nesting_count++;
if (catch_id) if (catch_id)
...@@ -3034,7 +3031,7 @@ objc_build_catch_stmt (tree catch_expr) ...@@ -3034,7 +3031,7 @@ objc_build_catch_stmt (tree catch_expr)
cond = build_function_call (objc_exception_match_decl, func_params); cond = build_function_call (objc_exception_match_decl, func_params);
} }
c_expand_start_cond (lang_hooks.truthvalue_conversion (cond), 0, if_stmt); c_finish_if_cond (cond, 0, 0);
objc_enter_block (); objc_enter_block ();
objc_declare_variable (RID_REGISTER, var_name, objc_declare_variable (RID_REGISTER, var_name,
build_pointer_type (var_type), build_pointer_type (var_type),
...@@ -3057,7 +3054,7 @@ objc_build_catch_epilogue (void) ...@@ -3057,7 +3054,7 @@ objc_build_catch_epilogue (void)
c_finish_then (objc_exit_block ()); c_finish_then (objc_exit_block ());
c_expand_start_else (); c_begin_else (0);
objc_enter_block (); objc_enter_block ();
c_expand_expr_stmt c_expand_expr_stmt
(build_modify_expr (build_modify_expr
...@@ -3070,7 +3067,7 @@ objc_build_catch_epilogue (void) ...@@ -3070,7 +3067,7 @@ objc_build_catch_epilogue (void)
{ {
/* FIXME. Need to have the block of each else that was opened. */ /* FIXME. Need to have the block of each else that was opened. */
c_finish_else ((abort (), NULL)); /* close off all the nested ifs ! */ c_finish_else ((abort (), NULL)); /* close off all the nested ifs ! */
c_expand_end_cond (); c_finish_if_stmt (1);
if_nesting_count--; if_nesting_count--;
} }
val_stack_pop (&catch_count_stack); val_stack_pop (&catch_count_stack);
...@@ -3079,7 +3076,7 @@ objc_build_catch_epilogue (void) ...@@ -3079,7 +3076,7 @@ objc_build_catch_epilogue (void)
objc_build_extract_fragment (); objc_build_extract_fragment ();
c_finish_else (objc_exit_block ()); c_finish_else (objc_exit_block ());
c_expand_end_cond (); c_finish_if_stmt (1);
if_nesting_count--; if_nesting_count--;
objc_exit_block (); objc_exit_block ();
...@@ -3099,18 +3096,16 @@ objc_build_finally_prologue (void) ...@@ -3099,18 +3096,16 @@ objc_build_finally_prologue (void)
tree blk = objc_enter_block (); tree blk = objc_enter_block ();
tree if_stmt = c_begin_if_stmt (); c_begin_if_stmt ();
if_nesting_count++; if_nesting_count++;
c_expand_start_cond (lang_hooks.truthvalue_conversion c_finish_if_cond (build_unary_op (TRUTH_NOT_EXPR,
(build_unary_op (TRUTH_NOT_EXPR, TREE_VALUE (objc_rethrow_exception), 0),
TREE_VALUE (objc_rethrow_exception), 0, 0);
0)),
0, if_stmt);
objc_enter_block (); objc_enter_block ();
objc_build_try_exit_fragment (); objc_build_try_exit_fragment ();
c_finish_then (objc_exit_block ()); c_finish_then (objc_exit_block ());
c_expand_end_cond (); c_finish_if_stmt (1);
if_nesting_count--; if_nesting_count--;
return blk; return blk;
...@@ -3125,16 +3120,14 @@ objc_build_finally_epilogue (void) ...@@ -3125,16 +3120,14 @@ objc_build_finally_epilogue (void)
} // end FINALLY scope } // end FINALLY scope
} */ } */
tree if_stmt = c_begin_if_stmt (); c_begin_if_stmt ();
if_nesting_count++; if_nesting_count++;
c_expand_start_cond c_finish_if_cond (TREE_VALUE (objc_rethrow_exception), 0, 0);
(lang_hooks.truthvalue_conversion (TREE_VALUE (objc_rethrow_exception)),
0, if_stmt);
objc_enter_block (); objc_enter_block ();
objc_build_throw_stmt (TREE_VALUE (objc_rethrow_exception)); objc_build_throw_stmt (TREE_VALUE (objc_rethrow_exception));
c_finish_then (objc_exit_block ()); c_finish_then (objc_exit_block ());
c_expand_end_cond (); c_finish_if_stmt (1);
if_nesting_count--; if_nesting_count--;
objc_exit_block (); objc_exit_block ();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment