aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/rtti.c
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@codesourcery.com>2000-03-24 16:36:06 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2000-03-24 16:36:06 +0000
commit3424984446d90b366bddbce3dedb9235f8af280b (patch)
treeef6148410f44f484259b58e6e5a04a1f4d517e43 /gcc/cp/rtti.c
parent552cc5b57e4f67cf88c4a90a2191a04b9901339f (diff)
downloadgcc-3424984446d90b366bddbce3dedb9235f8af280b.zip
gcc-3424984446d90b366bddbce3dedb9235f8af280b.tar.gz
gcc-3424984446d90b366bddbce3dedb9235f8af280b.tar.bz2
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
Diffstat (limited to 'gcc/cp/rtti.c')
-rw-r--r--gcc/cp/rtti.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c
index 7a8baac..5ee1d11 100644
--- a/gcc/cp/rtti.c
+++ b/gcc/cp/rtti.c
@@ -413,6 +413,7 @@ get_tinfo_decl (type)
TREE_STATIC (d) = 1;
DECL_EXTERNAL (d) = 1;
TREE_PUBLIC (d) = 1;
+ comdat_linkage (d);
DECL_ASSEMBLER_NAME (d) = DECL_NAME (d);
cp_finish_decl (d, NULL_TREE, NULL_TREE, 0);
@@ -1919,6 +1920,11 @@ emit_tinfo_decl (decl_ptr, data)
if (!DECL_NEEDED_P (tinfo_decl))
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 ();
decl = synthesize_tinfo_var (tinfo_type, DECL_ASSEMBLER_NAME (tinfo_decl));