diff options
author | Nathan Sidwell <nathan@codesourcery.com> | 2000-03-24 16:36:06 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2000-03-24 16:36:06 +0000 |
commit | 3424984446d90b366bddbce3dedb9235f8af280b (patch) | |
tree | ef6148410f44f484259b58e6e5a04a1f4d517e43 | |
parent | 552cc5b57e4f67cf88c4a90a2191a04b9901339f (diff) | |
download | gcc-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
-rw-r--r-- | gcc/cp/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/cp/decl.c | 5 | ||||
-rw-r--r-- | gcc/cp/rtti.c | 6 |
3 files changed, 17 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 433c629..619d88a 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,12 @@ +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> * call.c (check_dtor_name,build_new_method_call): Likewise. diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 491315a..ff2cf40 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -1764,9 +1764,8 @@ vtype_decl_p (t, data) void *data ATTRIBUTE_UNUSED; { return (TREE_CODE (t) == TYPE_DECL - && TREE_TYPE (t) != error_mark_node - && TYPE_LANG_SPECIFIC (TREE_TYPE (t)) - && CLASSTYPE_VSIZE (TREE_TYPE (t))); + && TREE_CODE (TREE_TYPE (t)) == RECORD_TYPE + && TYPE_POLYMORPHIC_P (TREE_TYPE (t))); } /* Return the declarations that are members of the namespace NS. */ 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)); |