Commit 63d1c7b3 by Nathan Sidwell

tree.h (BINFO_BASE_ACCESSES): Accesses are a VEC(tree).

.:	* tree.h (BINFO_BASE_ACCESSES): Accesses are a VEC(tree).
	(BINFO_BASE_ACCESS): Adjust.
	(BINFO_BASE_ACCESS_APPEND): New.
	(struct tree_binfo): Make base_accesses a VEC(tree) pointer.
	* dbxout.c (dbxout_type): Adjust binfo access accessing.
	* dwarf2out.c (gen_member_die): Likewise.
	* tree-dump.c (deque_and_dump): Likewise.
cp:
	* decl.c (xref_basetypes): Adjust base access vector creation.
	* rtti.c (get_pseudo_ti_init, get_pseudo_ti_desc): Adjust base
	access accesses.
	* search.c (dynamic_cast_base_recurse, dfs_access_in_type): Likewise.

From-SVN: r85187
parent 9b4f6a07
2004-07-26 Falk Hueffner <falk@debian.org>> 2004-07-24 Nathan Sidwell <nathan@codesourcery.com>
* tree.h (BINFO_BASE_ACCESSES): Accesses are a VEC(tree).
(BINFO_BASE_ACCESS): Adjust.
(BINFO_BASE_ACCESS_APPEND): New.
(struct tree_binfo): Make base_accesses a VEC(tree) pointer.
* dbxout.c (dbxout_type): Adjust binfo access accessing.
* dwarf2out.c (gen_member_die): Likewise.
* tree-dump.c (deque_and_dump): Likewise.
2004-07-26 Falk Hueffner <falk@debian.org>
* config/alpha/alpha.c (alpha_rtx_cost_data): Tweak int_div * config/alpha/alpha.c (alpha_rtx_cost_data): Tweak int_div
costs. costs.
...@@ -340,8 +350,8 @@ ...@@ -340,8 +350,8 @@
2004-07-23 Mike Stump <mrs@apple.com> 2004-07-23 Mike Stump <mrs@apple.com>
* c-typeck.c (convert_for_assignment): Tightened up pointer converstions * c-typeck.c (convert_for_assignment): Tightened up pointer
that differ in signedness. converstions that differ in signedness.
2004-07-23 Zack Weinberg <zack@codesourcery.com> 2004-07-23 Zack Weinberg <zack@codesourcery.com>
......
2004-07-26 Nathan Sidwell <nathan@codesourcery.com>
* decl.c (xref_basetypes): Adjust base access vector creation.
* rtti.c (get_pseudo_ti_init, get_pseudo_ti_desc): Adjust base
access accesses.
* search.c (dynamic_cast_base_recurse, dfs_access_in_type): Likewise.
2004-07-26 Niall Douglas <s_fsfeurope2@nedprod.com> 2004-07-26 Niall Douglas <s_fsfeurope2@nedprod.com>
Brian Ryner <bryner@brianryner.com> Brian Ryner <bryner@brianryner.com>
......
...@@ -9109,7 +9109,7 @@ xref_basetypes (tree ref, tree base_list) ...@@ -9109,7 +9109,7 @@ xref_basetypes (tree ref, tree base_list)
if (max_bases) if (max_bases)
{ {
BINFO_BASE_ACCESSES (binfo) = make_tree_vec (max_bases); BINFO_BASE_ACCESSES (binfo) = VEC_alloc (tree, max_bases);
/* An aggregate cannot have baseclasses. */ /* An aggregate cannot have baseclasses. */
CLASSTYPE_NON_AGGREGATE (ref) = 1; CLASSTYPE_NON_AGGREGATE (ref) = 1;
...@@ -9199,17 +9199,10 @@ xref_basetypes (tree ref, tree base_list) ...@@ -9199,17 +9199,10 @@ xref_basetypes (tree ref, tree base_list)
if (!BINFO_INHERITANCE_CHAIN (base_binfo)) if (!BINFO_INHERITANCE_CHAIN (base_binfo))
BINFO_INHERITANCE_CHAIN (base_binfo) = binfo; BINFO_INHERITANCE_CHAIN (base_binfo) = binfo;
TREE_VEC_ELT (BINFO_BASE_ACCESSES (binfo),
BINFO_N_BASE_BINFOS (binfo)) = access;
BINFO_BASE_APPEND (binfo, base_binfo); BINFO_BASE_APPEND (binfo, base_binfo);
BINFO_BASE_ACCESS_APPEND (binfo, access);
} }
if (max_bases)
/* If any bases were invalid, we will have allocated too many
slots. */
TREE_VEC_LENGTH (BINFO_BASE_ACCESSES (binfo))
= BINFO_N_BASE_BINFOS (binfo);
/* Unmark all the types. */ /* Unmark all the types. */
for (i = 0; BINFO_BASE_ITERATE (binfo, i, base_binfo); i++) for (i = 0; BINFO_BASE_ITERATE (binfo, i, base_binfo); i++)
CLEAR_CLASSTYPE_MARKED (BINFO_TYPE (base_binfo)); CLEAR_CLASSTYPE_MARKED (BINFO_TYPE (base_binfo));
......
...@@ -1052,7 +1052,7 @@ get_pseudo_ti_init (tree type, tree var_desc, bool *non_public_p) ...@@ -1052,7 +1052,7 @@ get_pseudo_ti_init (tree type, tree var_desc, bool *non_public_p)
int hint = class_hint_flags (type); int hint = class_hint_flags (type);
tree binfo = TYPE_BINFO (type); tree binfo = TYPE_BINFO (type);
int nbases = BINFO_N_BASE_BINFOS (binfo); int nbases = BINFO_N_BASE_BINFOS (binfo);
tree base_accesses = BINFO_BASE_ACCESSES (binfo); VEC (tree) *base_accesses = BINFO_BASE_ACCESSES (binfo);
tree base_inits = NULL_TREE; tree base_inits = NULL_TREE;
int ix; int ix;
...@@ -1065,7 +1065,7 @@ get_pseudo_ti_init (tree type, tree var_desc, bool *non_public_p) ...@@ -1065,7 +1065,7 @@ get_pseudo_ti_init (tree type, tree var_desc, bool *non_public_p)
tree tinfo; tree tinfo;
tree offset; tree offset;
if (TREE_VEC_ELT (base_accesses, ix) == access_public_node) if (VEC_index (tree, base_accesses, ix) == access_public_node)
flags |= 2; flags |= 2;
tinfo = get_tinfo_ptr (BINFO_TYPE (base_binfo)); tinfo = get_tinfo_ptr (BINFO_TYPE (base_binfo));
if (BINFO_VIRTUAL_P (base_binfo)) if (BINFO_VIRTUAL_P (base_binfo))
...@@ -1199,12 +1199,12 @@ get_pseudo_ti_desc (tree type) ...@@ -1199,12 +1199,12 @@ get_pseudo_ti_desc (tree type)
else else
{ {
tree binfo = TYPE_BINFO (type); tree binfo = TYPE_BINFO (type);
tree base_accesses = BINFO_BASE_ACCESSES (binfo); VEC (tree) *base_accesses = BINFO_BASE_ACCESSES (binfo);
tree base_binfo = BINFO_BASE_BINFO (binfo, 0); tree base_binfo = BINFO_BASE_BINFO (binfo, 0);
int num_bases = BINFO_N_BASE_BINFOS (binfo); int num_bases = BINFO_N_BASE_BINFOS (binfo);
if (num_bases == 1 if (num_bases == 1
&& TREE_VEC_ELT (base_accesses, 0) == access_public_node && VEC_index (tree, base_accesses, 0) == access_public_node
&& !BINFO_VIRTUAL_P (base_binfo) && !BINFO_VIRTUAL_P (base_binfo)
&& integer_zerop (BINFO_OFFSET (base_binfo))) && integer_zerop (BINFO_OFFSET (base_binfo)))
/* single non-virtual public. */ /* single non-virtual public. */
......
...@@ -287,7 +287,7 @@ static int ...@@ -287,7 +287,7 @@ static int
dynamic_cast_base_recurse (tree subtype, tree binfo, bool is_via_virtual, dynamic_cast_base_recurse (tree subtype, tree binfo, bool is_via_virtual,
tree *offset_ptr) tree *offset_ptr)
{ {
tree accesses; VEC (tree) *accesses;
tree base_binfo; tree base_binfo;
int i; int i;
int worst = -2; int worst = -2;
...@@ -306,7 +306,7 @@ dynamic_cast_base_recurse (tree subtype, tree binfo, bool is_via_virtual, ...@@ -306,7 +306,7 @@ dynamic_cast_base_recurse (tree subtype, tree binfo, bool is_via_virtual,
accesses = BINFO_BASE_ACCESSES (binfo); accesses = BINFO_BASE_ACCESSES (binfo);
for (i = 0; BINFO_BASE_ITERATE (binfo, i, base_binfo); i++) for (i = 0; BINFO_BASE_ITERATE (binfo, i, base_binfo); i++)
{ {
tree base_access = TREE_VEC_ELT (accesses, i); tree base_access = VEC_index (tree, accesses, i);
int rval; int rval;
if (base_access != access_public_node) if (base_access != access_public_node)
...@@ -625,14 +625,15 @@ dfs_access_in_type (tree binfo, void *data) ...@@ -625,14 +625,15 @@ dfs_access_in_type (tree binfo, void *data)
if (!access) if (!access)
{ {
int i; int i;
tree base_binfo, accesses; tree base_binfo;
VEC (tree) *accesses;
/* Otherwise, scan our baseclasses, and pick the most favorable /* Otherwise, scan our baseclasses, and pick the most favorable
access. */ access. */
accesses = BINFO_BASE_ACCESSES (binfo); accesses = BINFO_BASE_ACCESSES (binfo);
for (i = 0; BINFO_BASE_ITERATE (binfo, i, base_binfo); i++) for (i = 0; BINFO_BASE_ITERATE (binfo, i, base_binfo); i++)
{ {
tree base_access = TREE_VEC_ELT (accesses, i); tree base_access = VEC_index (tree, accesses, i);
access_kind base_access_now = BINFO_ACCESS (base_binfo); access_kind base_access_now = BINFO_ACCESS (base_binfo);
if (base_access_now == ak_none || base_access_now == ak_private) if (base_access_now == ak_none || base_access_now == ak_private)
......
...@@ -1684,6 +1684,7 @@ dbxout_type (tree type, int full) ...@@ -1684,6 +1684,7 @@ dbxout_type (tree type, int full)
{ {
int i; int i;
tree child; tree child;
VEC (tree) *accesses = BINFO_BASE_ACCESSES (binfo);
if (use_gnu_debug_info_extensions) if (use_gnu_debug_info_extensions)
{ {
...@@ -1696,8 +1697,7 @@ dbxout_type (tree type, int full) ...@@ -1696,8 +1697,7 @@ dbxout_type (tree type, int full)
} }
for (i = 0; BINFO_BASE_ITERATE (binfo, i, child); i++) for (i = 0; BINFO_BASE_ITERATE (binfo, i, child); i++)
{ {
tree access = (BINFO_BASE_ACCESSES (binfo) tree access = (accesses ? VEC_index (tree, accesses, i)
? BINFO_BASE_ACCESS (binfo, i)
: access_public_node); : access_public_node);
if (use_gnu_debug_info_extensions) if (use_gnu_debug_info_extensions)
......
...@@ -11897,13 +11897,13 @@ gen_member_die (tree type, dw_die_ref context_die) ...@@ -11897,13 +11897,13 @@ gen_member_die (tree type, dw_die_ref context_die)
/* First output info about the base classes. */ /* First output info about the base classes. */
if (binfo) if (binfo)
{ {
tree accesses = BINFO_BASE_ACCESSES (binfo); VEC (tree) *accesses = BINFO_BASE_ACCESSES (binfo);
int i; int i;
tree base; tree base;
for (i = 0; BINFO_BASE_ITERATE (binfo, i, base); i++) for (i = 0; BINFO_BASE_ITERATE (binfo, i, base); i++)
gen_inheritance_die (base, gen_inheritance_die (base,
(accesses ? TREE_VEC_ELT (accesses, i) (accesses ? VEC_index (tree, accesses, i)
: access_public_node), context_die); : access_public_node), context_die);
} }
......
...@@ -252,7 +252,7 @@ dequeue_and_dump (dump_info_p di) ...@@ -252,7 +252,7 @@ dequeue_and_dump (dump_info_p di)
{ {
unsigned ix; unsigned ix;
tree base; tree base;
tree accesses = BINFO_BASE_ACCESSES (t); VEC (tree) *accesses = BINFO_BASE_ACCESSES (t);
dump_child ("type", BINFO_TYPE (t)); dump_child ("type", BINFO_TYPE (t));
...@@ -262,7 +262,7 @@ dequeue_and_dump (dump_info_p di) ...@@ -262,7 +262,7 @@ dequeue_and_dump (dump_info_p di)
dump_int (di, "bases", BINFO_N_BASE_BINFOS (t)); dump_int (di, "bases", BINFO_N_BASE_BINFOS (t));
for (ix = 0; BINFO_BASE_ITERATE (t, ix, base); ix++) for (ix = 0; BINFO_BASE_ITERATE (t, ix, base); ix++)
{ {
tree access = (accesses ? TREE_VEC_ELT (accesses, ix) tree access = (accesses ? VEC_index (tree, accesses, ix)
: access_public_node); : access_public_node);
const char *string = NULL; const char *string = NULL;
......
...@@ -1671,7 +1671,11 @@ struct tree_type GTY(()) ...@@ -1671,7 +1671,11 @@ struct tree_type GTY(())
access_public_node, access_protected_node or access_private_node. access_public_node, access_protected_node or access_private_node.
If this array is not present, public access is implied. */ If this array is not present, public access is implied. */
#define BINFO_BASE_ACCESSES(NODE) (TREE_BINFO_CHECK(NODE)->binfo.base_accesses) #define BINFO_BASE_ACCESSES(NODE) (TREE_BINFO_CHECK(NODE)->binfo.base_accesses)
#define BINFO_BASE_ACCESS(NODE,N) TREE_VEC_ELT (BINFO_BASE_ACCESSES(NODE), (N))
#define BINFO_BASE_ACCESS(NODE,N) \
VEC_index (tree, BINFO_BASE_ACCESSES (NODE), (N))
#define BINFO_BASE_ACCESS_APPEND(NODE,T) \
VEC_quick_push (tree, BINFO_BASE_ACCESSES (NODE), (T))
/* The index in the VTT where this subobject's sub-VTT can be found. /* The index in the VTT where this subobject's sub-VTT can be found.
NULL_TREE if there is no sub-VTT. */ NULL_TREE if there is no sub-VTT. */
...@@ -1701,7 +1705,7 @@ struct tree_binfo GTY (()) ...@@ -1701,7 +1705,7 @@ struct tree_binfo GTY (())
tree vtable; tree vtable;
tree virtuals; tree virtuals;
tree vptr_field; tree vptr_field;
tree base_accesses; VEC(tree) *base_accesses;
tree inheritance; tree inheritance;
tree vtt_subvtt; tree vtt_subvtt;
......
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