aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog14
-rw-r--r--gcc/cp/ChangeLog7
-rw-r--r--gcc/cp/cp-tree.h10
-rw-r--r--gcc/cp/tree.c2
-rw-r--r--gcc/java/ChangeLog6
-rw-r--r--gcc/java/class.c6
-rw-r--r--gcc/objc/objc-act.c2
-rw-r--r--gcc/stor-layout.c10
-rw-r--r--gcc/tree.h15
9 files changed, 44 insertions, 28 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index da8295d..96b25f5 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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.
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index a9dd91e..4589a91 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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.
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 087a1c0..764c428 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -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
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 0f60b91..320ea95 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -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)
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index 4afcc94..062c368 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -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
diff --git a/gcc/java/class.c b/gcc/java/class.c
index dfaf6f1..43468b3 100644
--- a/gcc/java/class.c
+++ b/gcc/java/class.c
@@ -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;
diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c
index 3a5de01..fb3b79f 100644
--- a/gcc/objc/objc-act.c
+++ b/gcc/objc/objc-act.c
@@ -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;
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c
index 4a55b66..8fd70ad 100644
--- a/gcc/stor-layout.c
+++ b/gcc/stor-layout.c
@@ -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));
diff --git a/gcc/tree.h b/gcc/tree.h
index b124a50..2d4c741 100644
--- a/gcc/tree.h
+++ b/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,