tree.h (TYPE_BINFO_SIZE, [...]): Remove.
* tree.h (TYPE_BINFO_SIZE, TYPE_BINFO_SIZE_UNIT): Remove. (BINFO_ELTS): New #define. * stor-layout.c (finalize_record_size): Don't set them. * cp/cp-tree.h (BINFO_SUBVTT_INDEX, BINFO_VPTR_INDEX, BINFO_PRIMARY_BASE_OF): Use BINFO_ELTS. (BINFO_LANG_ELTS): New #define. * cp/tree.c (make_binfo): Use BINFO_LANG_ELTS. * java/class.c (make_class): Use BINFO_ELTS. (set_super_info): Likewse. (add_interface_do): Likewise. * objc/objc-act.c (start_class): Use BINFO_ELTS. From-SVN: r62180
This commit is contained in:
parent
8f9a402caa
commit
1824b90d08
9 changed files with 44 additions and 28 deletions
|
@ -1,3 +1,17 @@
|
|||
2003-01-31 Nathan Sidwell <nathan@codesourcery.com>
|
||||
|
||||
* tree.h (TYPE_BINFO_SIZE, TYPE_BINFO_SIZE_UNIT): Remove.
|
||||
(BINFO_ELTS): New #define.
|
||||
* stor-layout.c (finalize_record_size): Don't set them.
|
||||
* cp/cp-tree.h (BINFO_SUBVTT_INDEX, BINFO_VPTR_INDEX,
|
||||
BINFO_PRIMARY_BASE_OF): Use BINFO_ELTS.
|
||||
(BINFO_LANG_ELTS): New #define.
|
||||
* cp/tree.c (make_binfo): Use BINFO_LANG_ELTS.
|
||||
* java/class.c (make_class): Use BINFO_ELTS.
|
||||
(set_super_info): Likewse.
|
||||
(add_interface_do): Likewise.
|
||||
* objc/objc-act.c (start_class): Use BINFO_ELTS.
|
||||
|
||||
2003-01-31 Danny Smith <dannysmith@users.sourceforge.net>
|
||||
|
||||
* timevar.c (getrusage): Don't ever declare if not HAVE_GETRUSAGE.
|
||||
|
|
|
@ -1,3 +1,10 @@
|
|||
2003-01-31 Nathan Sidwell <nathan@codesourcery.com>
|
||||
|
||||
* cp-tree.h (BINFO_SUBVTT_INDEX, BINFO_VPTR_INDEX,
|
||||
BINFO_PRIMARY_BASE_OF): Use BINFO_ELTS.
|
||||
(BINFO_LANG_ELTS): New #define.
|
||||
* tree.c (make_binfo): Use BINFO_LANG_ELTS.
|
||||
|
||||
2003-01-30 Geoffrey Keating <geoffk@apple.com>
|
||||
|
||||
* cp/Make-lang.in: Remove -Wno-error from cp/decl.o.
|
||||
|
|
|
@ -1630,17 +1630,21 @@ struct lang_type GTY(())
|
|||
|
||||
/* The index in the VTT where this subobject's sub-VTT can be found.
|
||||
NULL_TREE if there is no sub-VTT. */
|
||||
#define BINFO_SUBVTT_INDEX(NODE) TREE_VEC_ELT (NODE, 8)
|
||||
#define BINFO_SUBVTT_INDEX(NODE) TREE_VEC_ELT (NODE, BINFO_ELTS + 0)
|
||||
|
||||
/* The index in the VTT where the vptr for this subobject can be
|
||||
found. NULL_TREE if there is no secondary vptr in the VTT. */
|
||||
#define BINFO_VPTR_INDEX(NODE) TREE_VEC_ELT (NODE, 9)
|
||||
#define BINFO_VPTR_INDEX(NODE) TREE_VEC_ELT (NODE, BINFO_ELTS + 1)
|
||||
|
||||
/* The binfo of which NODE is a primary base. (This is different from
|
||||
BINFO_INHERITANCE_CHAIN for virtual base because a virtual base is
|
||||
sometimes a primary base for a class for which it is not an
|
||||
immediate base.) */
|
||||
#define BINFO_PRIMARY_BASE_OF(NODE) TREE_VEC_ELT (NODE, 10)
|
||||
#define BINFO_PRIMARY_BASE_OF(NODE) TREE_VEC_ELT (NODE, BINFO_ELTS + 2)
|
||||
|
||||
/* C++ binfos have 3 additional entries. */
|
||||
|
||||
#define BINFO_LANG_ELTS (BINFO_ELTS + 3)
|
||||
|
||||
/* Nonzero if this binfo has lost its primary base binfo (because that
|
||||
is a nearly-empty virtual base that has been taken by some other
|
||||
|
|
|
@ -893,7 +893,7 @@ make_binfo (offset, binfo, vtable, virtuals)
|
|||
tree offset, binfo;
|
||||
tree vtable, virtuals;
|
||||
{
|
||||
tree new_binfo = make_tree_vec (11);
|
||||
tree new_binfo = make_tree_vec (BINFO_LANG_ELTS);
|
||||
tree type;
|
||||
|
||||
if (TREE_CODE (binfo) == TREE_VEC)
|
||||
|
|
|
@ -1,3 +1,9 @@
|
|||
2003-01-31 Nathan Sidwell <nathan@codesourcery.com>
|
||||
|
||||
* class.c (make_class): Use BINFO_ELTS.
|
||||
(set_super_info): Likewse.
|
||||
(add_interface_do): Likewise.
|
||||
|
||||
2003-01-30 Tom Tromey <tromey@redhat.com>
|
||||
|
||||
* jcf-parse.c (read_class): Update identifier's class value if it
|
||||
|
|
|
@ -275,7 +275,7 @@ make_class (void)
|
|||
{
|
||||
tree type;
|
||||
type = make_node (RECORD_TYPE);
|
||||
TYPE_BINFO (type) = make_tree_vec (6);
|
||||
TYPE_BINFO (type) = make_tree_vec (BINFO_ELTS);
|
||||
MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC (type);
|
||||
|
||||
return type;
|
||||
|
@ -360,7 +360,7 @@ set_super_info (int access_flags, tree this_class,
|
|||
TYPE_BINFO_BASETYPES (this_class) = make_tree_vec (total_supers);
|
||||
if (super_class)
|
||||
{
|
||||
tree super_binfo = make_tree_vec (6);
|
||||
tree super_binfo = make_tree_vec (BINFO_ELTS);
|
||||
BINFO_TYPE (super_binfo) = super_class;
|
||||
BINFO_OFFSET (super_binfo) = integer_zero_node;
|
||||
TREE_VIA_PUBLIC (super_binfo) = 1;
|
||||
|
@ -492,7 +492,7 @@ int common_enclosing_context_p (tree type1, tree type2)
|
|||
static void
|
||||
add_interface_do (tree basetype_vec, tree interface_class, int i)
|
||||
{
|
||||
tree interface_binfo = make_tree_vec (6);
|
||||
tree interface_binfo = make_tree_vec (BINFO_ELTS);
|
||||
BINFO_TYPE (interface_binfo) = interface_class;
|
||||
BINFO_OFFSET (interface_binfo) = integer_zero_node;
|
||||
BINFO_VPTR_FIELD (interface_binfo) = integer_zero_node;
|
||||
|
|
|
@ -6146,7 +6146,7 @@ start_class (code, class_name, super_name, protocol_list)
|
|||
}
|
||||
|
||||
class = make_node (code);
|
||||
TYPE_BINFO (class) = make_tree_vec (6);
|
||||
TYPE_BINFO (class) = make_tree_vec (BINFO_ELTS);
|
||||
|
||||
CLASS_NAME (class) = class_name;
|
||||
CLASS_SUPER_NAME (class) = super_name;
|
||||
|
|
|
@ -1254,15 +1254,7 @@ finalize_record_size (rli)
|
|||
unpadded_size_unit
|
||||
= size_binop (PLUS_EXPR, unpadded_size_unit, size_one_node);
|
||||
|
||||
/* Record the un-rounded size in the binfo node. But first we check
|
||||
the size of TYPE_BINFO to make sure that BINFO_SIZE is available. */
|
||||
if (TYPE_BINFO (rli->t) && TREE_VEC_LENGTH (TYPE_BINFO (rli->t)) > 6)
|
||||
{
|
||||
TYPE_BINFO_SIZE (rli->t) = unpadded_size;
|
||||
TYPE_BINFO_SIZE_UNIT (rli->t) = unpadded_size_unit;
|
||||
}
|
||||
|
||||
/* Round the size up to be a multiple of the required alignment */
|
||||
/* Round the size up to be a multiple of the required alignment */
|
||||
#ifdef ROUND_TYPE_SIZE
|
||||
TYPE_SIZE (rli->t) = ROUND_TYPE_SIZE (rli->t, unpadded_size,
|
||||
TYPE_ALIGN (rli->t));
|
||||
|
|
15
gcc/tree.h
15
gcc/tree.h
|
@ -1357,19 +1357,12 @@ struct tree_type GTY(())
|
|||
|
||||
/* For a BINFO record describing a virtual base class, i.e., one where
|
||||
TREE_VIA_VIRTUAL is set, this field assists in locating the virtual
|
||||
base. The actual contents are language-dependent. Under the old
|
||||
ABI, the C++ front-end uses a FIELD_DECL whose contents are a
|
||||
pointer to the virtual base; under the new ABI this field is
|
||||
instead an INTEGER_CST giving an offset into the vtable where the
|
||||
offset to the virtual base can be found. */
|
||||
base. The actual contents are language-dependent. In the C++
|
||||
front-end this field is an INTEGER_CST giving an offset into the
|
||||
vtable where the offset to the virtual base can be found. */
|
||||
#define BINFO_VPTR_FIELD(NODE) TREE_VEC_ELT (NODE, 5)
|
||||
|
||||
/* The size of a base class subobject of this type. Not all frontends
|
||||
currently allocate the space for these fields. */
|
||||
#define BINFO_SIZE(NODE) TREE_VEC_ELT (NODE, 6)
|
||||
#define BINFO_SIZE_UNIT(NODE) TREE_VEC_ELT (NODE, 7)
|
||||
#define TYPE_BINFO_SIZE(NODE) BINFO_SIZE (TYPE_BINFO (NODE))
|
||||
#define TYPE_BINFO_SIZE_UNIT(NODE) BINFO_SIZE_UNIT (TYPE_BINFO (NODE))
|
||||
#define BINFO_ELTS 6
|
||||
|
||||
/* Slot used to build a chain that represents a use of inheritance.
|
||||
For example, if X is derived from Y, and Y is derived from Z,
|
||||
|
|
Loading…
Add table
Reference in a new issue