diff options
author | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-09-17 23:45:52 +0000 |
---|---|---|
committer | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-09-17 23:45:52 +0000 |
commit | 2d04109968ed378b98e32c683db814220e910fce (patch) | |
tree | 0a1203afda84ba76764e50565f92ce939814c1a7 /gcc | |
parent | 7f075a5e7214b6ba89e45605f2b895904a49b3d3 (diff) | |
download | gcc-2d04109968ed378b98e32c683db814220e910fce.tar.gz |
* cp-tree.h (language_function): Add x_eh_spec_try_block. Add
x_scope_stmt_stack. Add x_in_charge_parm.
(current_eh_spec_try_block): New macro.
(current_scope_stmt_stack): Likewise.
(current_in_charge_parm): Likewise.
* decl.c (start_function): Initialize current_in_charge_parm.
(finish_function): Use current_in_charge_parm rather than looking
up __in_chrg.
* search.c (expand_indirect_vtbls_init): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@29489 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 10 | ||||
-rw-r--r-- | gcc/cp/cp-tree.h | 17 | ||||
-rw-r--r-- | gcc/cp/decl.c | 13 | ||||
-rw-r--r-- | gcc/cp/search.c | 2 |
4 files changed, 37 insertions, 5 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 65e1b826680..3d218467fbf 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,15 @@ 1999-09-17 Mark Mitchell <mark@codesourcery.com> + * cp-tree.h (language_function): Add x_eh_spec_try_block. Add + x_scope_stmt_stack. Add x_in_charge_parm. + (current_eh_spec_try_block): New macro. + (current_scope_stmt_stack): Likewise. + (current_in_charge_parm): Likewise. + * decl.c (start_function): Initialize current_in_charge_parm. + (finish_function): Use current_in_charge_parm rather than looking + up __in_chrg. + * search.c (expand_indirect_vtbls_init): Likewise. + * cp-tree.def (CLEANUP_STMT): Fix spelling in dumps. (TRY_BLOCK): Likewise. (HANDLER): Likewise. diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index 57a7ad51622..8ef874a1fac 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -623,6 +623,9 @@ struct language_function tree x_current_class_ref; tree x_last_tree; tree x_last_expr_type; + tree x_eh_spec_try_block; + tree x_scope_stmt_stack; + tree x_in_charge_parm; struct rtx_def *x_last_dtor_insn; struct rtx_def *x_last_parm_cleanup_insn; @@ -695,6 +698,20 @@ struct language_function #define last_expr_type cp_function_chain->x_last_expr_type +/* The TRY_BLOCK for the exception-specifiers for the current + function, if any. */ + +#define current_eh_spec_try_block cp_function_chain->x_eh_spec_try_block + +/* The stack of SCOPE_STMTs for the current function. */ + +#define current_scope_stmt_stack cp_function_chain->x_scope_stmt_stack + +/* The `__in_chrg' parameter for the current function. Only used for + destructors. */ + +#define current_in_charge_parm cp_function_chain->x_in_charge_parm + /* Set to 0 at beginning of a function definition, set to 1 if a return statement that specifies a return value is seen. */ diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index b888eb074a8..c57aa0ad846 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -13001,6 +13001,9 @@ start_function (declspecs, declarator, attrs, flags) = build_indirect_ref (t, NULL_PTR); cp_function_chain->x_current_class_ptr = t; + if (DECL_DESTRUCTOR_P (decl1)) + current_in_charge_parm = TREE_CHAIN (t); + resume_momentary (i); if (! hack_decl_function_context (decl1)) end_temporary_allocation (); @@ -13374,7 +13377,6 @@ finish_function (lineno, flags) tree binfo = TYPE_BINFO (current_class_type); tree cond = integer_one_node; tree exprstmt; - tree in_charge_node = lookup_name (in_charge_identifier, 0); tree virtual_size; int ok_to_optimize_dtor = 0; int empty_dtor = get_last_insn () == last_dtor_insn; @@ -13424,7 +13426,9 @@ finish_function (lineno, flags) exprstmt = build_delete (current_class_type, current_class_ref, integer_zero_node, LOOKUP_NONVIRTUAL|LOOKUP_DESTRUCTOR|LOOKUP_NORMAL, 0); else - exprstmt = build_delete (current_class_type, current_class_ref, in_charge_node, + exprstmt = build_delete (current_class_type, + current_class_ref, + current_in_charge_parm, LOOKUP_NONVIRTUAL|LOOKUP_DESTRUCTOR|LOOKUP_NORMAL, 0); /* If we did not assign to this, then `this' is non-zero at @@ -13451,7 +13455,8 @@ finish_function (lineno, flags) { tree vbases = nreverse (copy_list (CLASSTYPE_VBASECLASSES (current_class_type))); expand_start_cond (build (BIT_AND_EXPR, integer_type_node, - in_charge_node, integer_two_node), 0); + current_in_charge_parm, + integer_two_node), 0); while (vbases) { if (TYPE_NEEDS_DESTRUCTOR (BINFO_TYPE (vbases))) @@ -13499,7 +13504,7 @@ finish_function (lineno, flags) if (exprstmt) { cond = build (BIT_AND_EXPR, integer_type_node, - in_charge_node, integer_one_node); + current_in_charge_parm, integer_one_node); expand_start_cond (cond, 0); expand_expr_stmt (exprstmt); expand_end_cond (); diff --git a/gcc/cp/search.c b/gcc/cp/search.c index 818ab144f45..6e81465e901 100644 --- a/gcc/cp/search.c +++ b/gcc/cp/search.c @@ -2784,7 +2784,7 @@ expand_indirect_vtbls_init (binfo, true_exp, decl_ptr) if (fixup_insns) { - tree in_charge_node = lookup_name (in_charge_identifier, 0); + tree in_charge_node = current_in_charge_parm; if (! in_charge_node) { warning ("recoverable internal compiler error, nobody's in charge!"); |