* decl.c (duplicate_decls): Propagate DECL_DEFER_OUTPUT.
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 13 Nov 1999 09:39:11 +0000 (09:39 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 13 Nov 1999 09:39:11 +0000 (09:39 +0000)
* decl2.c (comdat_linkage): Set DECL_DEFER_OUTPUT.
* rtti.c (get_tinfo_fn_unused): Split out from get_tinfo_fn.
* class.c (set_rtti_entry): Use it.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@30523 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/class.c
gcc/cp/cp-tree.h
gcc/cp/decl.c
gcc/cp/decl2.c
gcc/cp/rtti.c

index 4273726..8bd88f3 100644 (file)
@@ -1,3 +1,10 @@
+1999-11-13  Jason Merrill  <jason@yorick.cygnus.com>
+
+       * decl.c (duplicate_decls): Propagate DECL_DEFER_OUTPUT.
+       * decl2.c (comdat_linkage): Set DECL_DEFER_OUTPUT.
+       * rtti.c (get_tinfo_fn_unused): Split out from get_tinfo_fn.
+       * class.c (set_rtti_entry): Use it.
+
 1999-11-12  Mark Mitchell  <mark@codesourcery.com>
 
        * decl.c (cplus_expand_expr_stmt): Don't call break_out_cleanups
index a1ac9cd..73a9dc9 100644 (file)
@@ -652,7 +652,7 @@ set_rtti_entry (virtuals, offset, type)
     return;
 
   if (flag_rtti)
-    fn = get_tinfo_fn (type);
+    fn = get_tinfo_fn_unused (type);
   else
     /* If someone tries to get RTTI information for a type compiled
        without RTTI, they're out of luck.  By calling __pure_virtual
index f4059a2..ac9d37a 100644 (file)
@@ -3792,6 +3792,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 fd4361a..f01d4de 100644 (file)
@@ -3408,6 +3408,7 @@ duplicate_decls (newdecl, olddecl)
   /* Merge the storage class information.  */
   DECL_WEAK (newdecl) |= DECL_WEAK (olddecl);
   DECL_ONE_ONLY (newdecl) |= DECL_ONE_ONLY (olddecl);
+  DECL_DEFER_OUTPUT (newdecl) |= DECL_DEFER_OUTPUT (olddecl);
   TREE_PUBLIC (newdecl) = TREE_PUBLIC (olddecl);
   TREE_STATIC (olddecl) = TREE_STATIC (newdecl) |= TREE_STATIC (olddecl);
   if (! DECL_EXTERNAL (olddecl))
index 5624767..2d57b78 100644 (file)
@@ -2355,6 +2355,9 @@ comdat_linkage (decl)
 
   if (DECL_LANG_SPECIFIC (decl))
     DECL_COMDAT (decl) = 1;
+
+  if (TREE_CODE (decl) == FUNCTION_DECL)
+    DECL_DEFER_OUTPUT (decl) = 1;
 }
 
 /* For win32 we also want to put explicit instantiations in
index 87d6df1..71a0000 100644 (file)
@@ -361,8 +361,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;
@@ -391,13 +402,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;