* 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
+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
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
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));
/* 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))
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
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;
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;