diff options
author | Nathan Sidwell <nathan@codesourcery.com> | 2001-07-31 16:12:04 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2001-07-31 16:12:04 +0000 |
commit | befe7c61462d147b408df88fe8a6f8e14e3ad877 (patch) | |
tree | 3547b7352d8bd1e1b80a28e48e5f9c9608a18e8e /gcc/cp/rtti.c | |
parent | dc56ceb766a005fadcd9287e7e72be947936f01a (diff) | |
download | gcc-befe7c61462d147b408df88fe8a6f8e14e3ad877.zip gcc-befe7c61462d147b408df88fe8a6f8e14e3ad877.tar.gz gcc-befe7c61462d147b408df88fe8a6f8e14e3ad877.tar.bz2 |
The 3.0 ABI no longer has vbase pointer fields.
cp:
The 3.0 ABI no longer has vbase pointer fields.
* cp-tree.h (VBASE_NAME, VBASE_NAME_FORMAT, VBASE_NAME_P,
FORMAT_VBASE_NAME): Remove.
* method.c (do_build_copy_constructor): Adjust.
(do_build_assign_ref): Adjust.
* search.c (lookup_field_r): Adjust.
* typeck.c (build_component_ref): Adjust.
The 3.0 ABI always has a vtable pointer at the start of every
polymorphic class.
* rtti.c (build_headof_sub): Remove.
(build_headof): Adjust.
(get_tinfo_decl_dynamic): No need to check flag_rtti
here. Adjust.
(create_real_tinfo_var): Explain why we need a hidden name.
From-SVN: r44515
Diffstat (limited to 'gcc/cp/rtti.c')
-rw-r--r-- | gcc/cp/rtti.c | 38 |
1 files changed, 4 insertions, 34 deletions
diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c index 20e238f..da1484c 100644 --- a/gcc/cp/rtti.c +++ b/gcc/cp/rtti.c @@ -41,7 +41,6 @@ Boston, MA 02111-1307, USA. */ extern struct obstack permanent_obstack; -static tree build_headof_sub PARAMS((tree)); static tree build_headof PARAMS((tree)); static tree ifnonnull PARAMS((tree, tree)); static tree tinfo_name PARAMS((tree)); @@ -82,23 +81,6 @@ init_rtti_processing () build_qualified_type (type_info_type_node, TYPE_QUAL_CONST); } -/* Given a pointer to an object with at least one virtual table - pointer somewhere, return a pointer to a possible sub-object that - has a virtual table pointer in it that is the vtable parent for - that sub-object. */ - -static tree -build_headof_sub (exp) - tree exp; -{ - tree type = TREE_TYPE (TREE_TYPE (exp)); - tree basetype = CLASSTYPE_RTTI (type); - tree binfo = get_binfo (basetype, type, 0); - - exp = convert_pointer_to_real (binfo, exp); - return exp; -} - /* Given the expression EXP of type `class *', return the head of the object pointed to by EXP with type cv void*, if the class has any virtual functions (TYPE_POLYMORPHIC_P), else just return the @@ -118,10 +100,6 @@ build_headof (exp) if (!TYPE_POLYMORPHIC_P (type)) return exp; - /* If we don't have rtti stuff, get to a sub-object that does. */ - if (!CLASSTYPE_VFIELDS (TREE_TYPE (TREE_TYPE (exp)))) - exp = build_headof_sub (exp); - /* We use this a couple of times below, protect it. */ exp = save_expr (exp); @@ -204,17 +182,6 @@ get_tinfo_decl_dynamic (exp) tree t; tree index; - if (! flag_rtti) - error ("taking dynamic typeid of object with -fno-rtti"); - - /* If we don't have rtti stuff, get to a sub-object that does. */ - if (! CLASSTYPE_VFIELDS (type)) - { - exp = build_unary_op (ADDR_EXPR, exp, 0); - exp = build_headof_sub (exp); - exp = build_indirect_ref (exp, NULL); - } - /* The RTTI information is at index -1. */ index = integer_minus_one_node; t = build_vfn_ref (exp, index); @@ -1146,7 +1113,10 @@ create_real_tinfo_var (target_type, name, type, init, non_public) tree decl; tree hidden_name; char hidden[30]; - + + /* We cannot give this the name NAME, as that already is globally + bound to the tinfo_decl we originally created for this type in + get_tinfo_decl. */ sprintf (hidden, "__ti_%d", count++); hidden_name = get_identifier (hidden); |