Commit 3f1d071b by Bernd Schmidt Committed by Bernd Schmidt

Backport of GC branch patches part 2: kill stmt status saving.

From-SVN: r28374
parent 695f7f32
Sun Aug 1 12:55:31 1999 Bernd Schmidt <bernds@cygnus.co.uk>
* stmt.c (emit_filename, emit_lineno, expr_stmts_for_value,
last_expr_type, last_expr_value, block_start_count, block_stack,
stack_block_stack, cond_stack, loop_stack, case_stack, nesting_stack,
nesting_depth, goto_fixup_chain): Delete global vars; now allocated
dynamically in stmt elt of struct function for each function.
(struct nesting): Rename function_call_count elt to n_function_calls,
target_temp_slot_level to block_target_temp_slot_level. All users
changed.
(struct stmt_status): New structure definition.
Add many accessor macros for stmt_status elements which previously
were global variables.
(init_stmt_for_function): Allocate stmt elt for current_function.
Reflect that block_start_count was renamed to
current_block_start_count.
(save_stmt_status, restore_stmt_status): Delete functions.
(preserve_subexpressions_p): Don't access loop_stack when outside
a function.
(expand_start_bindings): Reflect that block_start_count was renamed to
current_block_start_count.
(expand_fixup): Likewise.
(expand_decl): Don't access block_stack when outside a function.
(expand_decl_cleanup): Likewise.
(expand_dcc_cleanup): Likewise.
(expand_dhc_cleanup): Likewise.
(expand_anon_union_decl): Likewise.
(set_file_and_line_for_stmt): New function.
(in_control_zone_p): New function.
* function.h (struct function): Add new elt stmt.
Delete elts block_stack, stack_block_stack, cond_stack, loop_stack,
case_stack, nesting_stack, nesting_depth, block_start_count,
last_expr_type, last_expr_value, expr_stmts_for_value, emit_filename,
emit_lineno, goto_fixup_chain.
(save_eh_status, restore_eh_status, save_stmt_status,
restore_stmt_status): Delete declarations.
* function.c (push_function_context_to): Don't call save_stmt_status.
(pop_function_context_to): Don't call restore_stmt_status.
* tree.h (in_control_zone_p): Declare.
* rtl.h (set_file_and_line_for_stmt): Declare.
* emit-rtl.c (emit_line_note): Don't set emit_filename/emit_lineno;
call set_file_and_line_for_stmt.
Thu Jul 31 12:34:45 1999 Joe Buck <jbuck@synopsys.com>
* gcc.texi: Use terms "GNU Compiler Collection" and "GCC".
......
1999-08-01 Bernd Schmidt <bernds@cygnus.co.uk>
* decl.c (finish_stmt): Don't declare and test cond_stack, loop_stack,
case_stack; use in_control_zone_p.
* typeck.c (c_expand_return): Likewise.
1999-07-31 Bernd Schmidt <bernds@cygnus.co.uk>
* except.c (catch_clauses): Delete declaration.
......
......@@ -14509,9 +14509,6 @@ cplus_expand_expr_stmt (exp)
void
finish_stmt ()
{
extern struct nesting *cond_stack, *loop_stack, *case_stack;
if (current_function_assigns_this
|| ! current_function_just_assigned_this)
return;
......@@ -14519,7 +14516,7 @@ finish_stmt ()
{
/* Constructors must wait until we are out of control
zones before calling base constructors. */
if (cond_stack || loop_stack || case_stack)
if (in_control_zone_p ())
return;
expand_expr_stmt (base_init_expr);
check_base_init (current_class_type);
......
......@@ -6735,7 +6735,6 @@ void
c_expand_return (retval)
tree retval;
{
extern struct nesting *cond_stack, *loop_stack, *case_stack;
extern tree dtor_label, ctor_label;
tree result = DECL_RESULT (current_function_decl);
tree valtype = TREE_TYPE (result);
......@@ -6925,7 +6924,7 @@ c_expand_return (retval)
if (retval != NULL_TREE
&& TREE_CODE_CLASS (TREE_CODE (retval)) == 'd'
&& cond_stack == 0 && loop_stack == 0 && case_stack == 0)
&& ! in_control_zone_p ())
current_function_return_value = retval;
if (ctor_label && TREE_CODE (ctor_label) != ERROR_MARK)
......
......@@ -3167,8 +3167,7 @@ emit_line_note (file, line)
char *file;
int line;
{
emit_filename = file;
emit_lineno = line;
set_file_and_line_for_stmt (file, line);
#if 0
if (no_line_numbers)
......
......@@ -626,7 +626,6 @@ push_function_context_to (context)
save_storage_status (p);
save_emit_status (p);
save_expr_status (p);
save_stmt_status (p);
save_varasm_status (p, context);
if (save_machine_status)
(*save_machine_status) (p);
......@@ -715,7 +714,6 @@ pop_function_context_from (context)
restore_storage_status (p);
restore_expr_status (p);
restore_emit_status (p);
restore_stmt_status (p);
restore_varasm_status (p);
if (restore_machine_status)
......
......@@ -68,6 +68,7 @@ struct function
struct function *next;
struct eh_status *eh;
struct stmt_status *stmt;
/* For function.c. */
char *name;
......@@ -124,22 +125,6 @@ struct function
struct var_refs_queue *fixup_var_refs_queue;
CUMULATIVE_ARGS args_info;
/* For stmt.c */
struct nesting *block_stack;
struct nesting *stack_block_stack;
struct nesting *cond_stack;
struct nesting *loop_stack;
struct nesting *case_stack;
struct nesting *nesting_stack;
int nesting_depth;
int block_start_count;
tree last_expr_type;
rtx last_expr_value;
int expr_stmts_for_value;
char *emit_filename;
int emit_lineno;
struct goto_fixup *goto_fixup_chain;
/* For expr.c. */
rtx pending_chain;
int pending_stack_adjust;
......@@ -278,10 +263,6 @@ extern void save_tree_status PROTO((struct function *, tree));
extern void restore_tree_status PROTO((struct function *, tree));
extern void save_varasm_status PROTO((struct function *, tree));
extern void restore_varasm_status PROTO((struct function *));
extern void save_eh_status PROTO((struct function *));
extern void restore_eh_status PROTO((struct function *));
extern void save_stmt_status PROTO((struct function *));
extern void restore_stmt_status PROTO((struct function *));
extern void save_expr_status PROTO((struct function *));
extern void restore_expr_status PROTO((struct function *));
extern void save_emit_status PROTO((struct function *));
......
......@@ -1464,6 +1464,7 @@ extern int operands_match_p PROTO ((rtx, rtx));
extern int safe_from_earlyclobber PROTO ((rtx, rtx));
/* In stmt.c */
extern void set_file_and_line_for_stmt PROTO ((char *, int));
extern void expand_null_return PROTO((void));
extern void emit_jump PROTO ((rtx));
extern int preserve_subexpressions_p PROTO ((void));
......
......@@ -1929,6 +1929,7 @@ extern int (*lang_get_alias_set) PROTO((tree));
/* In stmt.c */
extern int in_control_zone_p PROTO((void));
extern void expand_fixups PROTO((struct rtx_def *));
extern tree expand_start_stmt_expr PROTO((void));
extern tree expand_end_stmt_expr PROTO((tree));
......
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