summaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authornathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2004-07-26 08:23:58 +0000
committernathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2004-07-26 08:23:58 +0000
commitdb77fe17b1e55336955cea4bbec2f4e312671f96 (patch)
treea52bd0b1bb36a9dba1bfbf17a55c904a10884e28 /gcc/cp
parentf6777b0a30e67053db325c6bf868d82ecd185c95 (diff)
downloadgcc-db77fe17b1e55336955cea4bbec2f4e312671f96.tar.gz
.:
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@85187 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog7
-rw-r--r--gcc/cp/decl.c11
-rw-r--r--gcc/cp/rtti.c8
-rw-r--r--gcc/cp/search.c9
4 files changed, 18 insertions, 17 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index e6e1a2482fd..1fb00277f9a 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,10 @@
+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>
Brian Ryner <bryner@brianryner.com>
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 2a9e61fdd39..f901d98f3db 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -9109,7 +9109,7 @@ xref_basetypes (tree ref, tree base_list)
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. */
CLASSTYPE_NON_AGGREGATE (ref) = 1;
@@ -9199,17 +9199,10 @@ xref_basetypes (tree ref, tree base_list)
if (!BINFO_INHERITANCE_CHAIN (base_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_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. */
for (i = 0; BINFO_BASE_ITERATE (binfo, i, base_binfo); i++)
CLEAR_CLASSTYPE_MARKED (BINFO_TYPE (base_binfo));
diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c
index 7332a9a6914..c6c9fc6acc4 100644
--- a/gcc/cp/rtti.c
+++ b/gcc/cp/rtti.c
@@ -1052,7 +1052,7 @@ get_pseudo_ti_init (tree type, tree var_desc, bool *non_public_p)
int hint = class_hint_flags (type);
tree binfo = TYPE_BINFO (type);
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;
int ix;
@@ -1065,7 +1065,7 @@ get_pseudo_ti_init (tree type, tree var_desc, bool *non_public_p)
tree tinfo;
tree offset;
- if (TREE_VEC_ELT (base_accesses, ix) == access_public_node)
+ if (VEC_index (tree, base_accesses, ix) == access_public_node)
flags |= 2;
tinfo = get_tinfo_ptr (BINFO_TYPE (base_binfo));
if (BINFO_VIRTUAL_P (base_binfo))
@@ -1199,12 +1199,12 @@ get_pseudo_ti_desc (tree type)
else
{
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);
int num_bases = BINFO_N_BASE_BINFOS (binfo);
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)
&& integer_zerop (BINFO_OFFSET (base_binfo)))
/* single non-virtual public. */
diff --git a/gcc/cp/search.c b/gcc/cp/search.c
index 7841d1e5cec..a1270acdbfa 100644
--- a/gcc/cp/search.c
+++ b/gcc/cp/search.c
@@ -287,7 +287,7 @@ static int
dynamic_cast_base_recurse (tree subtype, tree binfo, bool is_via_virtual,
tree *offset_ptr)
{
- tree accesses;
+ VEC (tree) *accesses;
tree base_binfo;
int i;
int worst = -2;
@@ -306,7 +306,7 @@ dynamic_cast_base_recurse (tree subtype, tree binfo, bool is_via_virtual,
accesses = BINFO_BASE_ACCESSES (binfo);
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;
if (base_access != access_public_node)
@@ -625,14 +625,15 @@ dfs_access_in_type (tree binfo, void *data)
if (!access)
{
int i;
- tree base_binfo, accesses;
+ tree base_binfo;
+ VEC (tree) *accesses;
/* Otherwise, scan our baseclasses, and pick the most favorable
access. */
accesses = BINFO_BASE_ACCESSES (binfo);
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);
if (base_access_now == ak_none || base_access_now == ak_private)