From: Jason Merrill Date: Thu, 20 Apr 2000 05:13:25 +0000 (-0400) Subject: exception.cc (__cp_pop_exception): Cleanup the original object. X-Git-Tag: prereleases/gcc-2.95.3-test1~71 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ed3394979ba2c88340cdaed966df6407b5f80efe;p=thirdparty%2Fgcc.git exception.cc (__cp_pop_exception): Cleanup the original object. * exception.cc (__cp_pop_exception): Cleanup the original object. * rtti.c (get_tinfo_fn_unused): Split out from get_tinfo_fn. * class.c (set_rtti_entry): Use it. From-SVN: r33271 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index dd6053295401..3f005333b881 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,12 @@ +2000-03-08 Nathan Sidwell + + * exception.cc (__cp_pop_exception): Cleanup the original object. + +1999-11-13 Jason Merrill + + * rtti.c (get_tinfo_fn_unused): Split out from get_tinfo_fn. + * class.c (set_rtti_entry): Use it. + Wed Apr 12 00:45:49 2000 Jeffrey A Law (law@cygnus.com) 2000-02-03 diff --git a/gcc/cp/class.c b/gcc/cp/class.c index 8d5ed0bab212..74808c56f355 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -680,7 +680,7 @@ set_rtti_entry (virtuals, offset, type) return; if (flag_rtti) - vfn = build1 (ADDR_EXPR, vfunc_ptr_type_node, get_tinfo_fn (type)); + vfn = build1 (ADDR_EXPR, vfunc_ptr_type_node, get_tinfo_fn_unused (type)); else vfn = build1 (NOP_EXPR, vfunc_ptr_type_node, size_zero_node); TREE_CONSTANT (vfn) = 1; diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index 826803aeaf15..8c1e7dfd7c1e 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -3249,6 +3249,7 @@ extern tree get_tinfo_fn_dynamic PROTO((tree)); extern tree build_typeid PROTO((tree)); extern tree build_x_typeid PROTO((tree)); extern tree get_tinfo_fn PROTO((tree)); +extern tree get_tinfo_fn_unused PROTO((tree)); extern tree get_typeid PROTO((tree)); extern tree get_typeid_1 PROTO((tree)); extern tree build_dynamic_cast PROTO((tree, tree)); diff --git a/gcc/cp/exception.cc b/gcc/cp/exception.cc index 8e8f35f50dbe..59342c6423ee 100644 --- a/gcc/cp/exception.cc +++ b/gcc/cp/exception.cc @@ -247,10 +247,10 @@ __cp_pop_exception (cp_eh_info *p) if (p->cleanup) /* 2 is a magic value for destructors; see build_delete(). */ - p->cleanup (p->value, 2); + p->cleanup (p->original_value, 2); // value may have been adjusted. if (! __is_pointer (p->type)) - __eh_free (p->original_value); // value may have been co-erced. + __eh_free (p->original_value); // value may have been adjusted. __eh_free (p); } diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c index e0ce5cd86666..c8c1ba95255d 100644 --- a/gcc/cp/rtti.c +++ b/gcc/cp/rtti.c @@ -363,8 +363,19 @@ get_tinfo_var (type) return tdecl; } +/* Returns the decl for a function which will return a type_info node for + TYPE. This version does not mark the function used, for use in + set_rtti_entry; for the vtable case, we'll get marked in + finish_vtable_vardecl, when we know that we want to be emitted. + + We do this to avoid emitting the tinfo node itself, since we don't + currently support DECL_DEFER_OUTPUT for variables. Also, we don't + associate constant pools with their functions properly, so we would + emit string constants and such even though we don't emit the actual + function. When those bugs are fixed, this function should go away. */ + tree -get_tinfo_fn (type) +get_tinfo_fn_unused (type) tree type; { tree name; @@ -393,13 +404,23 @@ get_tinfo_fn (type) pushdecl_top_level (d); make_function_rtl (d); - mark_used (d); mark_inline_for_output (d); pop_obstacks (); return d; } +/* Likewise, but also mark it used. Called by various EH and RTTI code. */ + +tree +get_tinfo_fn (type) + tree type; +{ + tree d = get_tinfo_fn_unused (type); + mark_used (d); + return d; +} + tree get_typeid_1 (type) tree type;