Commit 3461fba7 by Nathan Sidwell Committed by Nathan Sidwell

Remove old-abi remnants.

	Remove old-abi remnants. Remove comments about old abi
	behaviour. Remove refences to 'new-abi' in comments.
	* cp-tree.h: Adjust comments.
	(vbase_offsets_in_vtable_p): Delete.
	(vcall_offsets_in_vtable_p): Delete.
	(vptrs_present_everywhere_p): Delete.
	(all_overridden_vfuns_in_vtables_p): Delete.
	(merge_primary_and_secondary_vtables_p): Delete.
	(TYPE_CONTAINS_VPTR_P): Adjust.
	(VTT_NAME_PREFIX): Remove.
	(CTOR_VTBL_NAME_PREFIX): Remove.
	(init_vbase_pointers): Remove.
	* class.c: Adjust coments.
	(build_vbase_pointer_fields): Delete.
	(build_vbase_pointer): Remove old-abi code.
	(build_secondary_vtable): Likewise.
	(modify_all_vtables): Likewise.
	(create_vtable_ptr): Likewise.
	(layout_class_type): Likewise.
	(finish_struct_1): Likewise.
	(finish_vtbls): Likewise.
	(dfs_finish_vtbls): Delete.
	(build_vbase_offset_vtbl_entries): Remove old-abi code.
	* cvt.c: Adjust comments.
	* decl.c: Adjust comments.
	* decl2.c: Adjust comments.
	* init.c: Adjust comments.
	(construct_virtual_bases): Remove old-abi code.
	* lang-specs.h: Remove -fno-new-abi.
	* mangle.c: Adjust comments.
	* rtti.c: Adjust comments.
	(get_base_offset): Remove old-abi-code.
	* search.c: Adjust comments.
	(dfs_init_vbase_pointers): Remove.
	(dfs_vtable_path_unmark): Remove.
	(init_vbase_pointers): Remove.
	* semantics.c: Adjust comments.
	(emit_associated_thunks): Remove old-abi code.
	* typeck.c: Adjust comments.

From-SVN: r44215
parent 50b996bf
2001-07-20 Nathan Sidwell <nathan@codesourcery.com>
Remove old-abi remnants. Remove comments about old abi
behaviour. Remove refences to 'new-abi' in comments.
* cp-tree.h: Adjust comments.
(vbase_offsets_in_vtable_p): Delete.
(vcall_offsets_in_vtable_p): Delete.
(vptrs_present_everywhere_p): Delete.
(all_overridden_vfuns_in_vtables_p): Delete.
(merge_primary_and_secondary_vtables_p): Delete.
(TYPE_CONTAINS_VPTR_P): Adjust.
(VTT_NAME_PREFIX): Remove.
(CTOR_VTBL_NAME_PREFIX): Remove.
(init_vbase_pointers): Remove.
* class.c: Adjust coments.
(build_vbase_pointer_fields): Delete.
(build_vbase_pointer): Remove old-abi code.
(build_secondary_vtable): Likewise.
(modify_all_vtables): Likewise.
(create_vtable_ptr): Likewise.
(layout_class_type): Likewise.
(finish_struct_1): Likewise.
(finish_vtbls): Likewise.
(dfs_finish_vtbls): Delete.
(build_vbase_offset_vtbl_entries): Remove old-abi code.
* cvt.c: Adjust comments.
* decl.c: Adjust comments.
* decl2.c: Adjust comments.
* init.c: Adjust comments.
(construct_virtual_bases): Remove old-abi code.
* lang-specs.h: Remove -fno-new-abi.
* mangle.c: Adjust comments.
* rtti.c: Adjust comments.
(get_base_offset): Remove old-abi-code.
* search.c: Adjust comments.
(dfs_init_vbase_pointers): Remove.
(dfs_vtable_path_unmark): Remove.
(init_vbase_pointers): Remove.
* semantics.c: Adjust comments.
(emit_associated_thunks): Remove old-abi code.
* typeck.c: Adjust comments.
2001-07-20 Daniel Berlin <dan@cgsoftware.com>
* Make-lang.in (cp/optimize.o): Depend on $(PARAMS_H), not
......
......@@ -133,11 +133,9 @@ Boston, MA 02111-1307, USA. */
The BV_FN is the declaration for the virtual function itself.
BINFO_VTABLE
Sometimes this is a VAR_DECL. Under the new ABI, it is instead
an expression with POINTER_TYPE pointing that gives the value
This is an expression with POINTER_TYPE that gives the value
to which the vptr should be initialized. Use get_vtbl_decl_for_binfo
to extract the VAR_DECL for the complete vtable; that macro works
in both ABIs.
to extract the VAR_DECL for the complete vtable.
DECL_ARGUMENTS
For a VAR_DECL this is DECL_ANON_UNION_ELEMS.
......@@ -224,40 +222,6 @@ extern int flag_rtti;
extern int flag_huge_objects;
/* Nonzero if virtual base class offsets are stored in the virtual
function table. Zero if, instead, a pointer to the virtual base is
stored in the object itself. */
#define vbase_offsets_in_vtable_p() (1)
/* Nonzero if displacements to the `this' pointer to use when calling
virtual functions in a virtual base class are present in the
vtable. */
#define vcall_offsets_in_vtable_p() (1)
/* Nonzero if a derived class that needs a vptr should always get one,
even if a non-primary base class already has one. For example,
given:
struct S { int i; virtual void f(); };
struct T : virtual public S {};
one could either reuse the vptr in `S' for `T', or create a new
vptr for `T'. If this flag is nonzero we choose the latter
alternative; otherwise, we choose the former. */
#define vptrs_present_everywhere_p() (1)
/* Nonzero if the vtable for a derived class should contain the
virtual functions from the primary base and all virtual functions
present in the class itself. Zero if, instead, it should contain
only those virtual functions from the primary base together with
the functions declared in the derived class (but not in any base
class). */
#define all_overridden_vfuns_in_vtables_p() (1)
/* Nonzero if primary and secondary vtables are combined into a single
vtable. */
#define merge_primary_and_secondary_vtables_p() (1)
/* Language-dependent contents of an identifier. */
......@@ -2431,8 +2395,7 @@ struct lang_decl
/* Nonzero if this class has a virtual function table pointer. */
#define TYPE_CONTAINS_VPTR_P(NODE) \
(TYPE_POLYMORPHIC_P (NODE) \
|| (vbase_offsets_in_vtable_p () \
&& TYPE_USES_VIRTUAL_BASECLASSES (NODE)))
|| TYPE_USES_VIRTUAL_BASECLASSES (NODE))
extern int flag_new_for_scope;
......@@ -2587,67 +2550,15 @@ extern int flag_new_for_scope;
/* A pointer-to-function member type looks like:
struct {
short __delta;
short __index;
union {
P __pfn;
short __delta2;
} __pfn_or_delta2;
};
where P is a POINTER_TYPE to a METHOD_TYPE appropriate for the
pointer to member. The fields are used as follows:
If __INDEX is -1, then the function to call is non-virtual, and
is located at the address given by __PFN.
If __INDEX is zero, then this a NULL pointer-to-member.
Otherwise, the function to call is virtual. Then, __DELTA2 gives
the offset from an instance of the object to the virtual function
table, and __INDEX - 1 is the index into the vtable to use to
find the function.
The value to use for the THIS parameter is the address of the
object plus __DELTA.
For example, given:
struct B1 {
int i;
};
struct B2 {
double d;
void f();
};
struct S : public B1, B2 {};
the pointer-to-member for `&S::f' looks like:
{ 4, -1, { &f__2B2 } };
The `4' means that given an `S*' you have to add 4 bytes to get to
the address of the `B2*'. Then, the -1 indicates that this is a
non-virtual function. Of course, `&f__2B2' is the name of that
function.
(Of course, the exact values may differ depending on the mangling
scheme, sizes of types, and such.).
Under the new ABI, we do:
struct {
__P __pfn;
ptrdiff_t __delta;
};
(We don't need DELTA2, because the vtable is always the first thing
in the object.) If the function is virtual, then PFN is one plus
twice the index into the vtable; otherwise, it is just a pointer to
the function.
(As the vtable is always the first thing in the object, we don't
need an offset to it.) If the function is virtual, then PFN is one
plus twice the index into the vtable; otherwise, it is just a
pointer to the function.
Unfortunately, using the lowest bit of PFN doesn't work in
architectures that don't impose alignment requirements on function
......@@ -3342,15 +3253,6 @@ extern varray_type local_classes;
#define EXCEPTION_CLEANUP_NAME "exception cleanup"
/* The name used as a prefix for VTTs. When the new ABI mangling
scheme is implemented, this should be removed. */
#define VTT_NAME_PREFIX "__vtt_"
/* The name used as a prefix for construction vtables. */
#define CTOR_VTBL_NAME_PREFIX "__ctorvt_"
#define THIS_NAME_P(ID_NODE) (strcmp(IDENTIFIER_POINTER (ID_NODE), "this") == 0)
#if !defined(NO_DOLLAR_IN_LABEL) || !defined(NO_DOT_IN_LABEL)
......@@ -4165,7 +4067,6 @@ extern tree lookup_fnfields PARAMS ((tree, tree, int));
extern tree lookup_member PARAMS ((tree, tree, int, int));
extern int look_for_overrides PARAMS ((tree, tree));
extern void get_pure_virtuals PARAMS ((tree));
extern tree init_vbase_pointers PARAMS ((tree, tree));
extern void get_vbase_types PARAMS ((tree));
extern void maybe_suppress_debug_info PARAMS ((tree));
extern void note_debug_info_needed PARAMS ((tree));
......
......@@ -259,8 +259,8 @@ cp_convert_to_pointer (type, expr, force)
return build_ptrmemfunc (TYPE_PTRMEMFUNC_FN_TYPE (type), expr, 0);
if (TYPE_PTRMEM_P (type))
/* Under the new ABI, a NULL pointer-to-member is represented
by -1, not by zero. */
/* A NULL pointer-to-member is represented by -1, not by
zero. */
expr = build_int_2 (-1, -1);
else
expr = build_int_2 (0, 0);
......
......@@ -48,8 +48,7 @@ Boston, MA 02111-1307, USA. */
extern int (*valid_lang_attribute) PARAMS ((tree, tree, tree, tree));
#ifndef BOOL_TYPE_SIZE
/* In the new ABI, `bool' has size and alignment `1', on all
platforms. */
/* `bool' has size and alignment `1', on all platforms. */
#define BOOL_TYPE_SIZE CHAR_TYPE_SIZE
#endif
......@@ -9475,7 +9474,6 @@ check_special_function_return_type (sfk, type, optype)
if (type)
cp_error ("return type specification for constructor invalid");
/* In the new ABI constructors do not return a value. */
type = void_type_node;
break;
......
......@@ -2291,12 +2291,12 @@ comdat_linkage (decl)
address, and this will not hold when we emit multiple copies of
the function. However, there's little else we can do.
Also, by default, the typeinfo implementation for the new ABI
assumes that there will be only one copy of the string used as
the name for each type. Therefore, if weak symbols are
unavailable, the run-time library should perform a more
conservative check; it should perform a string comparison,
rather than an address comparison. */
Also, by default, the typeinfo implementation assumes that
there will be only one copy of the string used as the name for
each type. Therefore, if weak symbols are unavailable, the
run-time library should perform a more conservative check; it
should perform a string comparison, rather than an address
comparison. */
TREE_PUBLIC (decl) = 0;
else
{
......@@ -2744,8 +2744,8 @@ get_guard (decl)
{
tree guard_type;
/* Under the new ABI, we use a type that is big enough to
contain a mutex as well as an integer counter. */
/* We use a type that is big enough to contain a mutex as well
as an integer counter. */
guard_type = long_long_integer_type_node;
guard = build_decl (VAR_DECL, sname, guard_type);
......@@ -2772,8 +2772,8 @@ static tree
get_guard_bits (guard)
tree guard;
{
/* Under the new ABI, we only set the first byte of the guard,
in order to leave room for a mutex in the high-order bits. */
/* We only set the first byte of the guard, in order to leave room
for a mutex in the high-order bits. */
guard = build1 (ADDR_EXPR,
build_pointer_type (TREE_TYPE (guard)),
guard);
......
......@@ -175,9 +175,9 @@ initialize_vtbl_ptrs (addr)
list = build_tree_list (type, addr);
/* Walk through the hierarchy, initializing the vptr in each base
class. We do these in pre-order because under the new ABI we
can't find the virtual bases for a class until we've initialized
the vtbl for that class. */
class. We do these in pre-order because can't find the virtual
bases for a class until we've initialized the vtbl for that
class. */
dfs_walk_real (TYPE_BINFO (type), dfs_initialize_vtbl_ptrs,
NULL, dfs_unmarked_real_bases_queue_p, list);
dfs_walk (TYPE_BINFO (type), dfs_unmark,
......@@ -851,8 +851,8 @@ expand_virtual_init (binfo, decl)
/* Compute the initializer for vptr. */
vtbl = build_vtbl_address (binfo);
/* Under the new ABI, we may get this vptr from a VTT, if this is a
subobject constructor or subobject destructor. */
/* We may get this vptr from a VTT, if this is a subobject
constructor or subobject destructor. */
vtt_index = BINFO_VPTR_INDEX (binfo);
if (vtt_index)
{
......@@ -951,22 +951,6 @@ construct_virtual_bases (type, this_ref, this_ptr, init_list, flag)
/* If there are no virtual baseclasses, we shouldn't even be here. */
my_friendly_assert (TYPE_USES_VIRTUAL_BASECLASSES (type), 19990621);
/* First set the pointers in our object that tell us where to find
our virtual baseclasses. */
if (!vbase_offsets_in_vtable_p ())
{
tree if_stmt;
tree result;
if_stmt = begin_if_stmt ();
finish_if_stmt_cond (flag, if_stmt);
result = init_vbase_pointers (type, this_ptr);
if (result)
finish_expr_stmt (build_compound_expr (result));
finish_then_clause (if_stmt);
finish_if_stmt ();
}
/* Now, run through the baseclasses, initializing each. */
for (vbases = CLASSTYPE_VBASECLASSES (type); vbases;
vbases = TREE_CHAIN (vbases))
......@@ -2213,7 +2197,7 @@ build_java_class_ref (type)
jclass_node = TREE_TYPE (jclass_node);
}
/* Mangle the class$ field, new and old ABI */
/* Mangle the class$ field */
{
tree field;
for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
......@@ -2252,8 +2236,8 @@ get_cookie_size (type)
{
tree cookie_size;
/* Under the new ABI, we need to allocate an additional max
(sizeof (size_t), alignof (true_type)) bytes. */
/* We need to allocate an additional max (sizeof (size_t), alignof
(true_type)) bytes. */
tree sizetype_size;
tree type_align;
......@@ -2360,9 +2344,7 @@ build_new_1 (exp)
if (!has_array || !TYPE_VEC_NEW_USES_COOKIE (true_type))
use_cookie = 0;
/* When using placement new, users may not realize that they need
the extra storage. Under the old ABI, we don't allocate the
cookie whenever they use one placement argument of type `void
*'. Under the new ABI, we require that the operator called be
the extra storage. We require that the operator called be
the global placement operator delete[]. */
else if (placement && !TREE_CHAIN (placement)
&& same_type_p (TREE_TYPE (TREE_VALUE (placement)),
......@@ -2479,9 +2461,8 @@ build_new_1 (exp)
tree cookie;
/* Store the number of bytes allocated so that we can know how
many elements to destroy later. Under the new ABI, we use
the last sizeof (size_t) bytes to store the number of
elements. */
many elements to destroy later. We use the last sizeof
(size_t) bytes to store the number of elements. */
cookie = build (MINUS_EXPR, build_pointer_type (sizetype),
alloc_node, size_in_bytes (sizetype));
cookie = build_indirect_ref (cookie, NULL);
......
......@@ -38,14 +38,14 @@ Boston, MA 02111-1307, USA. */
"%{E|M|MM:cpp0 -lang-c++ %{!no-gcc:-D__GNUG__=%v1}\
%{!Wno-deprecated:-D__DEPRECATED}\
%{!fno-exceptions:-D__EXCEPTIONS}\
%{!fno-new-abi:-D__GXX_ABI_VERSION=100}\
-D__GXX_ABI_VERSION=100\
%{ansi:-D__STRICT_ANSI__ -trigraphs -$} %(cpp_options)}\
%{!E:%{!M:%{!MM:\
%{save-temps:cpp0 -lang-c++ \
%{!no-gcc:-D__GNUG__=%v1}\
%{!Wno-deprecated:-D__DEPRECATED}\
%{!fno-exceptions:-D__EXCEPTIONS}\
%{!fno-new-abi:-D__GXX_ABI_VERSION=100}\
-D__GXX_ABI_VERSION=100\
%{ansi:-D__STRICT_ANSI__ -trigraphs -$}\
%(cpp_options) %b.ii \n}\
cc1plus %{save-temps:-fpreprocessed %b.ii}\
......@@ -53,7 +53,7 @@ Boston, MA 02111-1307, USA. */
%{!no-gcc:-D__GNUG__=%v1} \
%{!Wno-deprecated:-D__DEPRECATED}\
%{!fno-exceptions:-D__EXCEPTIONS}\
%{!fno-new-abi:-D__GXX_ABI_VERSION=100}\
-D__GXX_ABI_VERSION=100\
%{ansi:-D__STRICT_ANSI__}}\
%{ansi:-trigraphs -$}\
%(cc1_options) %2 %{+e1*}\
......
/* Name mangling for the new standard C++ ABI.
/* Name mangling for the 3.0 C++ ABI.
Copyright (C) 2000, 2001 Free Software Foundation, Inc.
Written by Alex Samuel <sameul@codesourcery.com>
......@@ -1168,10 +1168,9 @@ write_identifier (identifier)
Currently, allocating constructors are never used.
We also need to provide unique mangled names (which should never be
exported) for the constructor that takes an in-charge parameter,
and for a constructor whose name is the same as its class's name.
We use "C*INTERNAL*" for these. */
We also need to provide mangled names for the maybe-in-charge
constructor, so we treat it here too. mangle_decl_string will
append *INTERNAL* to that, to make sure we never emit it. */
static void
write_special_name_constructor (ctor)
......@@ -1190,15 +1189,15 @@ write_special_name_constructor (ctor)
}
/* Handle destructor productions of non-terminal <special-name>.
DTOR is a denstructor FUNCTION_DECL.
DTOR is a destructor FUNCTION_DECL.
<special-name> ::= D0 # deleting (in-charge) destructor
::= D1 # complete object (in-charge) destructor
::= D2 # base object (not-in-charge) destructor
::= D2 # base object (not-in-charge) destructor
We also need to provide unique mngled names for old-ABI
destructors, sometimes. These should only be used internally. We
use "D*INTERNAL*" for these. */
We also need to provide mangled names for the maybe-incharge
destructor, so we treat it here too. mangle_decl_string will
append *INTERNAL* to that, to make sure we never emit it. */
static void
write_special_name_destructor (dtor)
......
......@@ -130,8 +130,7 @@ build_headof (exp)
/* We use this a couple of times below, protect it. */
exp = save_expr (exp);
/* Under the new ABI, the offset-to-top field is at index -2 from
the vptr. */
/* The offset-to-top field is at index -2 from the vptr. */
index = build_int_2 (-2, -1);
aref = build_vtbl_ref (build_indirect_ref (exp, NULL), index);
......@@ -452,36 +451,12 @@ get_base_offset (binfo, parent)
{
if (! TREE_VIA_VIRTUAL (binfo))
return BINFO_OFFSET (binfo);
else if (! vbase_offsets_in_vtable_p ())
{
const char *name;
tree result;
tree field;
FORMAT_VBASE_NAME (name, BINFO_TYPE (binfo));
field = lookup_field (parent, get_identifier (name), 0, 0);
result = byte_position (field);
if (DECL_CONTEXT (field) != parent)
{
/* The vbase pointer might be in a non-virtual base of PARENT.
* Adjust for the offset of that base in PARENT. */
tree path;
get_base_distance (DECL_CONTEXT (field), parent, -1, &path);
result = build (PLUS_EXPR, TREE_TYPE (result),
result, BINFO_OFFSET (path));
result = fold (result);
}
return result;
}
else
/* Under the new ABI, we store the vtable offset at which
the virtual base offset can be found. */
/* We store the vtable offset at which the virtual base offset can
be found. */
return convert (sizetype,
BINFO_VPTR_FIELD (binfo_for_vbase (BINFO_TYPE (binfo),
parent)));
}
/* Execute a dynamic cast, as described in section 5.2.6 of the 9/93 working
......@@ -833,8 +808,8 @@ tinfo_base_init (desc, target)
DECL_EXTERNAL (name_decl) = 0;
TREE_PUBLIC (name_decl) = 1;
comdat_linkage (name_decl);
/* The new ABI specifies the external name of the string
containing the type's name. */
/* External name of the string containing the type's name has a
special name. */
SET_DECL_ASSEMBLER_NAME (name_decl,
mangle_typeinfo_string_for_type (target));
DECL_INITIAL (name_decl) = name_string;
......@@ -1295,8 +1270,7 @@ create_pseudo_type_info VPARAMS((const char *real_name, int ident, ...))
vtable_decl = get_vtable_decl (real_type, /*complete=*/1);
vtable_decl = build_unary_op (ADDR_EXPR, vtable_decl, 0);
/* Under the new ABI, we need to point into the middle of the
vtable. */
/* We need to point into the middle of the vtable. */
vtable_decl = build (PLUS_EXPR,
TREE_TYPE (vtable_decl),
vtable_decl,
......
......@@ -102,7 +102,6 @@ static tree marked_pushdecls_p PARAMS ((tree, void *));
static tree unmarked_pushdecls_p PARAMS ((tree, void *));
static tree dfs_debug_unmarkedp PARAMS ((tree, void *));
static tree dfs_debug_mark PARAMS ((tree, void *));
static tree dfs_init_vbase_pointers PARAMS ((tree, void *));
static tree dfs_get_vbase_types PARAMS ((tree, void *));
static tree dfs_push_type_decls PARAMS ((tree, void *));
static tree dfs_push_decls PARAMS ((tree, void *));
......@@ -140,7 +139,6 @@ static tree get_shared_vbase_if_not_primary PARAMS ((tree, void *));
static tree dfs_find_vbase_instance PARAMS ((tree, void *));
static tree dfs_get_pure_virtuals PARAMS ((tree, void *));
static tree dfs_build_inheritance_graph_order PARAMS ((tree, void *));
static tree dfs_vtable_path_unmark PARAMS ((tree, void *));
/* Allocate a level of searching. */
......@@ -2335,108 +2333,6 @@ dfs_unmark (binfo, data)
}
static tree
dfs_init_vbase_pointers (binfo, data)
tree binfo;
void *data;
{
struct vbase_info *vi = (struct vbase_info *) data;
tree type = BINFO_TYPE (binfo);
tree fields;
tree this_vbase_ptr;
/* Don't initialize the same base more than once. */
SET_BINFO_VTABLE_PATH_MARKED (binfo);
/* We know that VI->DECL_PTR points to the complete object. So,
finding a pointer to this subobject is easy. */
this_vbase_ptr = build (PLUS_EXPR,
build_pointer_type (type),
vi->decl_ptr,
BINFO_OFFSET (binfo));
/* We're going to iterate through all the pointers to virtual
base-classes. They come at the beginning of the class. */
fields = TYPE_FIELDS (type);
if (fields == NULL_TREE
|| DECL_NAME (fields) == NULL_TREE
|| ! VBASE_NAME_P (DECL_NAME (fields)))
return NULL_TREE;
if (build_pointer_type (type)
!= TYPE_MAIN_VARIANT (TREE_TYPE (this_vbase_ptr)))
my_friendly_abort (125);
while (fields && DECL_NAME (fields) && VBASE_NAME_P (DECL_NAME (fields)))
{
tree ref = build (COMPONENT_REF, TREE_TYPE (fields),
build_indirect_ref (this_vbase_ptr, NULL), fields);
tree init;
tree vbase_type;
tree vbase_binfo;
vbase_type = TREE_TYPE (TREE_TYPE (fields));
vbase_binfo = binfo_for_vbase (vbase_type, vi->type);
init = build (PLUS_EXPR,
build_pointer_type (vbase_type),
vi->decl_ptr,
BINFO_OFFSET (vbase_binfo));
vi->inits
= tree_cons (vbase_binfo,
build_modify_expr (ref, NOP_EXPR, init),
vi->inits);
fields = TREE_CHAIN (fields);
}
return NULL_TREE;
}
/* Call CLEAR_BINFO_VTABLE_PATH_MARKED for BINFO. */
static tree
dfs_vtable_path_unmark (binfo, data)
tree binfo;
void *data ATTRIBUTE_UNUSED;
{
CLEAR_BINFO_VTABLE_PATH_MARKED (binfo);
return NULL_TREE;
}
tree
init_vbase_pointers (type, decl_ptr)
tree type;
tree decl_ptr;
{
my_friendly_assert (!vbase_offsets_in_vtable_p (), 20000516);
if (TYPE_USES_VIRTUAL_BASECLASSES (type))
{
struct vbase_info vi;
tree binfo = TYPE_BINFO (type);
/* Find all the virtual base classes, marking them for later
initialization. */
vi.type = type;
vi.decl_ptr = decl_ptr;
vi.inits = NULL_TREE;
/* Build up a list of the initializers. */
dfs_walk_real (binfo,
dfs_init_vbase_pointers, 0,
unmarked_vtable_pathp,
&vi);
dfs_walk (binfo,
dfs_vtable_path_unmark,
marked_vtable_pathp,
NULL);
return vi.inits;
}
return 0;
}
/* get the virtual context (the vbase that directly contains the
DECL_CONTEXT of the FNDECL) that the given FNDECL is declared in,
or NULL_TREE if there is none.
......
......@@ -2337,7 +2337,7 @@ emit_associated_thunks (fn)
is so that you can know statically the entire set of thunks that
will ever be needed for a given virtual function, thereby
enabling you to output all the thunks with the function itself. */
if (vcall_offsets_in_vtable_p () && DECL_VIRTUAL_P (fn))
if (DECL_VIRTUAL_P (fn))
{
tree binfo;
tree v;
......@@ -2403,8 +2403,8 @@ expand_body (fn)
simplify_aggr_init_exprs_r,
NULL);
/* If this is a constructor or destructor body, we have to clone it
under the new ABI. */
/* If this is a constructor or destructor body, we have to clone
it. */
if (maybe_clone_body (fn))
{
/* We don't want to process FN again, so pretend we've written
......
......@@ -6105,8 +6105,7 @@ build_ptrmemfunc (type, pfn, force)
delta = build_component_ref (pfn, delta_identifier, NULL_TREE, 0);
}
/* Under the new ABI, the conversion is easy. Just adjust
the DELTA field. */
/* Just adjust the DELTA field. */
delta = cp_convert (ptrdiff_type_node, delta);
if (TARGET_PTRMEMFUNC_VBIT_LOCATION == ptrmemfunc_vbit_in_delta)
n = cp_build_binary_op (LSHIFT_EXPR, n, integer_one_node);
......@@ -6171,10 +6170,9 @@ expand_ptrmemfunc_cst (cst, delta, pfn)
*delta = fold (build (PLUS_EXPR, TREE_TYPE (*delta),
*delta, BINFO_OFFSET (binfo)));
/* Under the new ABI, we set PFN to the vtable offset at
which the function can be found, plus one (unless
ptrmemfunc_vbit_in_delta, in which case delta is shifted
left, and then incremented). */
/* We set PFN to the vtable offset at which the function can be
found, plus one (unless ptrmemfunc_vbit_in_delta, in which
case delta is shifted left, and then incremented). */
*pfn = DECL_VINDEX (fn);
*pfn = fold (build (MULT_EXPR, integer_type_node, *pfn,
TYPE_SIZE_UNIT (vtable_entry_type)));
......
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