]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
exception.cc (__cp_pop_exception): Cleanup the original object.
authorJason Merrill <jason@gcc.gnu.org>
Thu, 20 Apr 2000 05:13:25 +0000 (01:13 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Thu, 20 Apr 2000 05:13:25 +0000 (01:13 -0400)
        * 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

gcc/cp/ChangeLog
gcc/cp/class.c
gcc/cp/cp-tree.h
gcc/cp/exception.cc
gcc/cp/rtti.c

index dd6053295401a431430ae3d1c4d26e4126d590d0..3f005333b881ccdf54ccf51072372391c53e12a0 100644 (file)
@@ -1,3 +1,12 @@
+2000-03-08  Nathan Sidwell  <nathan@codesourcery.com>
+
+       * exception.cc (__cp_pop_exception): Cleanup the original object.
+
+1999-11-13  Jason Merrill  <jason@yorick.cygnus.com>
+
+       * 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    <loewis@informatik.hu-berlin.de>
index 8d5ed0bab212fa1a376eb9c8417eae9ffcc89d05..74808c56f355d3748fd2e9032741bdd00f2d257d 100644 (file)
@@ -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;
index 826803aeaf15fcd8558d8b014138b88d86ee5b1f..8c1e7dfd7c1e020459a656f1b83d62de1254ad01 100644 (file)
@@ -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));
index 8e8f35f50dbecb459ac82d408f1252696ff804b2..59342c6423ee72ece34231935ef2abde99bbdde5 100644 (file)
@@ -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);
 }
index e0ce5cd8666661d75b2b60e402322ee8aee3c627..c8c1ba95255d1932852d1919ad1a7aa2a82f9710 100644 (file)
@@ -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;