Commit 34249844 by Nathan Sidwell Committed by Nathan Sidwell

decl.c (vtype_decl_p): Use TYPE_POLYMORPHIC_P.

	* decl.c (vtype_decl_p): Use TYPE_POLYMORPHIC_P.

	* rtti.c (get_tinfo_decl): Set comdat linkage on new-abi
	tinfo object.
	(emit_tinfo_decl): Only emit polymorphic tinfo's when emitting
	vtable.

From-SVN: r32725
parent 552cc5b5
2000-03-24 Nathan Sidwell <nathan@codesourcery.com>
* decl.c (vtype_decl_p): Use TYPE_POLYMORPHIC_P.
* rtti.c (get_tinfo_decl): Set comdat linkage on new-abi
tinfo object.
(emit_tinfo_decl): Only emit polymorphic tinfo's when emitting
vtable.
2000-03-20 Theodore Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr> 2000-03-20 Theodore Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr>
* call.c (check_dtor_name,build_new_method_call): Likewise. * call.c (check_dtor_name,build_new_method_call): Likewise.
......
...@@ -1764,9 +1764,8 @@ vtype_decl_p (t, data) ...@@ -1764,9 +1764,8 @@ vtype_decl_p (t, data)
void *data ATTRIBUTE_UNUSED; void *data ATTRIBUTE_UNUSED;
{ {
return (TREE_CODE (t) == TYPE_DECL return (TREE_CODE (t) == TYPE_DECL
&& TREE_TYPE (t) != error_mark_node && TREE_CODE (TREE_TYPE (t)) == RECORD_TYPE
&& TYPE_LANG_SPECIFIC (TREE_TYPE (t)) && TYPE_POLYMORPHIC_P (TREE_TYPE (t)));
&& CLASSTYPE_VSIZE (TREE_TYPE (t)));
} }
/* Return the declarations that are members of the namespace NS. */ /* Return the declarations that are members of the namespace NS. */
......
...@@ -413,6 +413,7 @@ get_tinfo_decl (type) ...@@ -413,6 +413,7 @@ get_tinfo_decl (type)
TREE_STATIC (d) = 1; TREE_STATIC (d) = 1;
DECL_EXTERNAL (d) = 1; DECL_EXTERNAL (d) = 1;
TREE_PUBLIC (d) = 1; TREE_PUBLIC (d) = 1;
comdat_linkage (d);
DECL_ASSEMBLER_NAME (d) = DECL_NAME (d); DECL_ASSEMBLER_NAME (d) = DECL_NAME (d);
cp_finish_decl (d, NULL_TREE, NULL_TREE, 0); cp_finish_decl (d, NULL_TREE, NULL_TREE, 0);
...@@ -1919,6 +1920,11 @@ emit_tinfo_decl (decl_ptr, data) ...@@ -1919,6 +1920,11 @@ emit_tinfo_decl (decl_ptr, data)
if (!DECL_NEEDED_P (tinfo_decl)) if (!DECL_NEEDED_P (tinfo_decl))
return 0; return 0;
if (TREE_CODE (tinfo_type) == RECORD_TYPE && TYPE_POLYMORPHIC_P (tinfo_type)
&& !CLASSTYPE_VTABLE_NEEDS_WRITING (tinfo_type))
/* A polymorphic type only needs its type_info emitted when the vtable
is. */
return 0;
create_tinfo_types (); create_tinfo_types ();
decl = synthesize_tinfo_var (tinfo_type, DECL_ASSEMBLER_NAME (tinfo_decl)); decl = synthesize_tinfo_var (tinfo_type, DECL_ASSEMBLER_NAME (tinfo_decl));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment