Commit cb39191d by Mark Mitchell Committed by Mark Mitchell

semantics.c (RECHAIN_STMTS): Remove `last' parameter.

	* semantics.c (RECHAIN_STMTS): Remove `last' parameter.
	(RECHAIN_STMTS_FROM_LAST): Remove.  Replace all uses with
	RECHAIN_STMTS.
	(RECHAIN_STMST_FROM_CHAIN): Likewise.

From-SVN: r29256
parent f4e5c65b
1999-09-09 Mark Mitchell <mark@codesourcery.com> 1999-09-09 Mark Mitchell <mark@codesourcery.com>
* semantics.c (RECHAIN_STMTS): Remove `last' parameter.
(RECHAIN_STMTS_FROM_LAST): Remove. Replace all uses with
RECHAIN_STMTS.
(RECHAIN_STMST_FROM_CHAIN): Likewise.
* parse.y (simple_stmt): Fix typo in last change. * parse.y (simple_stmt): Fix typo in last change.
* cp-tree.h (EXPR_STMT_ASSIGNS_THIS): New macro. * cp-tree.h (EXPR_STMT_ASSIGNS_THIS): New macro.
......
...@@ -53,25 +53,19 @@ static tree expand_cond PROTO((tree)); ...@@ -53,25 +53,19 @@ static tree expand_cond PROTO((tree));
bottom-up. This macro makes LAST_TREE the indicated SUBSTMT of bottom-up. This macro makes LAST_TREE the indicated SUBSTMT of
STMT. */ STMT. */
#define RECHAIN_STMTS(stmt, substmt, last) \ #define RECHAIN_STMTS(stmt, substmt) \
do { \ do { \
substmt = last; \ substmt = TREE_CHAIN (stmt); \
TREE_CHAIN (stmt) = NULL_TREE; \ TREE_CHAIN (stmt) = NULL_TREE; \
last_tree = stmt; \ last_tree = stmt; \
} while (0) } while (0)
#define RECHAIN_STMTS_FROM_LAST(stmt, substmt) \
RECHAIN_STMTS (stmt, substmt, last_tree)
#define RECHAIN_STMTS_FROM_CHAIN(stmt, substmt) \
RECHAIN_STMTS (stmt, substmt, TREE_CHAIN (stmt))
/* Finish processing the COND, the SUBSTMT condition for STMT. */ /* Finish processing the COND, the SUBSTMT condition for STMT. */
#define FINISH_COND(cond, stmt, substmt) \ #define FINISH_COND(cond, stmt, substmt) \
do { \ do { \
if (last_tree != stmt) \ if (last_tree != stmt) \
RECHAIN_STMTS_FROM_LAST (stmt, substmt); \ RECHAIN_STMTS (stmt, substmt); \
else \ else \
substmt = cond; \ substmt = cond; \
} while (0) } while (0)
...@@ -196,8 +190,7 @@ finish_then_clause (if_stmt) ...@@ -196,8 +190,7 @@ finish_then_clause (if_stmt)
{ {
if (building_stmt_tree ()) if (building_stmt_tree ())
{ {
RECHAIN_STMTS_FROM_CHAIN (if_stmt, RECHAIN_STMTS (if_stmt, THEN_CLAUSE (if_stmt));
THEN_CLAUSE (if_stmt));
last_tree = if_stmt; last_tree = if_stmt;
return if_stmt; return if_stmt;
} }
...@@ -222,7 +215,7 @@ finish_else_clause (if_stmt) ...@@ -222,7 +215,7 @@ finish_else_clause (if_stmt)
tree if_stmt; tree if_stmt;
{ {
if (building_stmt_tree ()) if (building_stmt_tree ())
RECHAIN_STMTS_FROM_CHAIN (if_stmt, ELSE_CLAUSE (if_stmt)); RECHAIN_STMTS (if_stmt, ELSE_CLAUSE (if_stmt));
} }
/* Finsh an if-statement. */ /* Finsh an if-statement. */
...@@ -298,7 +291,7 @@ finish_while_stmt (while_stmt) ...@@ -298,7 +291,7 @@ finish_while_stmt (while_stmt)
do_poplevel (); do_poplevel ();
if (building_stmt_tree ()) if (building_stmt_tree ())
RECHAIN_STMTS_FROM_CHAIN (while_stmt, WHILE_BODY (while_stmt)); RECHAIN_STMTS (while_stmt, WHILE_BODY (while_stmt));
else else
expand_end_loop (); expand_end_loop ();
finish_stmt (); finish_stmt ();
...@@ -332,7 +325,7 @@ finish_do_body (do_stmt) ...@@ -332,7 +325,7 @@ finish_do_body (do_stmt)
tree do_stmt; tree do_stmt;
{ {
if (building_stmt_tree ()) if (building_stmt_tree ())
RECHAIN_STMTS_FROM_CHAIN (do_stmt, DO_BODY (do_stmt)); RECHAIN_STMTS (do_stmt, DO_BODY (do_stmt));
else else
expand_loop_continue_here (); expand_loop_continue_here ();
} }
...@@ -411,7 +404,7 @@ finish_for_init_stmt (for_stmt) ...@@ -411,7 +404,7 @@ finish_for_init_stmt (for_stmt)
if (building_stmt_tree ()) if (building_stmt_tree ())
{ {
if (last_tree != for_stmt) if (last_tree != for_stmt)
RECHAIN_STMTS_FROM_CHAIN (for_stmt, FOR_INIT_STMT (for_stmt)); RECHAIN_STMTS (for_stmt, FOR_INIT_STMT (for_stmt));
} }
else else
{ {
...@@ -479,7 +472,7 @@ finish_for_stmt (expr, for_stmt) ...@@ -479,7 +472,7 @@ finish_for_stmt (expr, for_stmt)
do_poplevel (); do_poplevel ();
if (building_stmt_tree ()) if (building_stmt_tree ())
RECHAIN_STMTS_FROM_CHAIN (for_stmt, FOR_BODY (for_stmt)); RECHAIN_STMTS (for_stmt, FOR_BODY (for_stmt));
else else
{ {
emit_line_note (input_filename, lineno); emit_line_note (input_filename, lineno);
...@@ -577,7 +570,7 @@ finish_switch_stmt (cond, switch_stmt) ...@@ -577,7 +570,7 @@ finish_switch_stmt (cond, switch_stmt)
tree switch_stmt; tree switch_stmt;
{ {
if (building_stmt_tree ()) if (building_stmt_tree ())
RECHAIN_STMTS_FROM_CHAIN (switch_stmt, SWITCH_BODY (switch_stmt)); RECHAIN_STMTS (switch_stmt, SWITCH_BODY (switch_stmt));
else else
expand_end_case (cond); expand_end_case (cond);
pop_momentary (); pop_momentary ();
...@@ -676,7 +669,7 @@ finish_try_block (try_block) ...@@ -676,7 +669,7 @@ finish_try_block (try_block)
tree try_block; tree try_block;
{ {
if (building_stmt_tree ()) if (building_stmt_tree ())
RECHAIN_STMTS_FROM_LAST (try_block, TRY_STMTS (try_block)); RECHAIN_STMTS (try_block, TRY_STMTS (try_block));
else else
expand_start_all_catch (); expand_start_all_catch ();
} }
...@@ -705,7 +698,7 @@ finish_function_try_block (try_block) ...@@ -705,7 +698,7 @@ finish_function_try_block (try_block)
tree try_block; tree try_block;
{ {
if (building_stmt_tree ()) if (building_stmt_tree ())
RECHAIN_STMTS_FROM_LAST (try_block, TRY_STMTS (try_block)); RECHAIN_STMTS (try_block, TRY_STMTS (try_block));
else else
{ {
end_protect_partials (); end_protect_partials ();
...@@ -722,7 +715,7 @@ finish_handler_sequence (try_block) ...@@ -722,7 +715,7 @@ finish_handler_sequence (try_block)
tree try_block; tree try_block;
{ {
if (building_stmt_tree ()) if (building_stmt_tree ())
RECHAIN_STMTS_FROM_CHAIN (try_block, TRY_HANDLERS (try_block)); RECHAIN_STMTS (try_block, TRY_HANDLERS (try_block));
else else
expand_end_all_catch (); expand_end_all_catch ();
} }
...@@ -734,7 +727,7 @@ finish_function_handler_sequence (try_block) ...@@ -734,7 +727,7 @@ finish_function_handler_sequence (try_block)
tree try_block; tree try_block;
{ {
if (building_stmt_tree ()) if (building_stmt_tree ())
RECHAIN_STMTS_FROM_CHAIN (try_block, TRY_HANDLERS (try_block)); RECHAIN_STMTS (try_block, TRY_HANDLERS (try_block));
else else
{ {
in_function_try_handler = 0; in_function_try_handler = 0;
...@@ -770,7 +763,7 @@ finish_handler_parms (handler) ...@@ -770,7 +763,7 @@ finish_handler_parms (handler)
tree handler; tree handler;
{ {
if (building_stmt_tree ()) if (building_stmt_tree ())
RECHAIN_STMTS_FROM_CHAIN (handler, HANDLER_PARMS (handler)); RECHAIN_STMTS (handler, HANDLER_PARMS (handler));
} }
/* Finish a handler, which may be given by HANDLER. */ /* Finish a handler, which may be given by HANDLER. */
...@@ -780,7 +773,7 @@ finish_handler (handler) ...@@ -780,7 +773,7 @@ finish_handler (handler)
tree handler; tree handler;
{ {
if (building_stmt_tree ()) if (building_stmt_tree ())
RECHAIN_STMTS_FROM_CHAIN (handler, HANDLER_BODY (handler)); RECHAIN_STMTS (handler, HANDLER_BODY (handler));
else else
expand_end_catch_block (); expand_end_catch_block ();
...@@ -840,10 +833,9 @@ finish_compound_stmt (has_no_scope, compound_stmt) ...@@ -840,10 +833,9 @@ finish_compound_stmt (has_no_scope, compound_stmt)
r = NULL_TREE; r = NULL_TREE;
if (building_stmt_tree ()) if (building_stmt_tree ())
RECHAIN_STMTS_FROM_CHAIN (compound_stmt, RECHAIN_STMTS (compound_stmt, COMPOUND_BODY (compound_stmt));
COMPOUND_BODY (compound_stmt));
/* When we call finish_stmt we will lost LAST_EXPR_TYPE. But, since /* When we call finish_stmt we will lose LAST_EXPR_TYPE. But, since
the precise purpose of that variable is store the type of the the precise purpose of that variable is store the type of the
last expression statement within the last compound statement, we last expression statement within the last compound statement, we
preserve the value. */ preserve the value. */
......
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