summaryrefslogtreecommitdiff
path: root/gcc/cp/search.c
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@codesourcery.com>2004-07-19 15:45:53 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2004-07-19 15:45:53 +0000
commit9ba5ff0f25985468d845360aee1d11cb3a0f09c8 (patch)
tree46c29242b882c33b8a12977fcf57e4b3cd23ce78 /gcc/cp/search.c
parent6df91b0004725e310b8dc7fa463745a703c1c059 (diff)
downloadgcc-9ba5ff0f25985468d845360aee1d11cb3a0f09c8.tar.gz
vec.h: Propagate location information properly.
.: * vec.h: Propagate location information properly. (VEC_T_iterate): Add result pointer parameter. (VEC_T_space): New. (VEC_T_reserve): Use it. cp: * class.c (add_method): Delay adding the slot until the end. (determine_primary_base): Adjust VEC_iterate invokation. (resort_type_method_vec, finish_struct_methods, warn_hidden, walk_subobject_offsets, end_of_class, warn_about_ambiguous_bases, build_vtbl_initializer): Likewise. * init.c (sort_mem_initializers, build_delete, push_base_cleanups, build_vbase_delete): Likewise. * method.c (do_build_copy_constructor): Likewise. * name-lookup.c (new_class_binding, print_binding_level, poplevel_class, store_class_bindings, push_to_top_level, pop_from_top_level): Likewise. * pt.c (check_explicit_specialization): Likewise. * search.c (lookup_conversion_operator, lookup_fnfields_1, get_pure_virtuals, add_conversions, dfs_check_overlap, binfo_for_vbase): Likewise. From-SVN: r84924
Diffstat (limited to 'gcc/cp/search.c')
-rw-r--r--gcc/cp/search.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/gcc/cp/search.c b/gcc/cp/search.c
index ceefa3cd05f..e172aa38553 100644
--- a/gcc/cp/search.c
+++ b/gcc/cp/search.c
@@ -1319,8 +1319,7 @@ lookup_conversion_operator (tree class_type, tree type)
for (pass = 0; pass < 2; ++pass)
for (i = CLASSTYPE_FIRST_CONVERSION_SLOT;
- (fn = VEC_iterate (tree, methods, i));
- ++i)
+ VEC_iterate (tree, methods, i, fn); ++i)
{
/* All the conversion operators come near the beginning of the
class. Therefore, if FN is not a conversion operator, there
@@ -1410,7 +1409,7 @@ lookup_fnfields_1 (tree type, tree name)
/* Skip the conversion operators. */
for (i = CLASSTYPE_FIRST_CONVERSION_SLOT;
- (fn = VEC_iterate (tree, method_vec, i));
+ VEC_iterate (tree, method_vec, i, fn);
++i)
if (!DECL_CONV_FN_P (OVL_CURRENT (fn)))
break;
@@ -1442,9 +1441,7 @@ lookup_fnfields_1 (tree type, tree name)
}
}
else
- for (;
- (fn = VEC_iterate (tree, method_vec, i));
- ++i)
+ for (; VEC_iterate (tree, method_vec, i, fn); ++i)
{
#ifdef GATHER_STATISTICS
n_outer_fields_searched++;
@@ -1887,6 +1884,7 @@ get_pure_virtuals (tree type)
{
unsigned ix;
tree binfo;
+ VEC (tree) *vbases;
/* Clear the CLASSTYPE_PURE_VIRTUALS list; whatever is already there
is going to be overridden. */
@@ -1903,8 +1901,8 @@ get_pure_virtuals (tree type)
/* Put the pure virtuals in dfs order. */
CLASSTYPE_PURE_VIRTUALS (type) = nreverse (CLASSTYPE_PURE_VIRTUALS (type));
- for (ix = 0; (binfo = VEC_iterate
- (tree, CLASSTYPE_VBASECLASSES (type), ix)); ix++)
+ for (vbases = CLASSTYPE_VBASECLASSES (type), ix = 0;
+ VEC_iterate (tree, vbases, ix, binfo); ix++)
{
tree virtuals;
@@ -2078,12 +2076,12 @@ add_conversions (tree binfo, void *data)
return NULL_TREE;
for (i = CLASSTYPE_FIRST_CONVERSION_SLOT;
- (tmp = VEC_iterate (tree, method_vec, i));
+ VEC_iterate (tree, method_vec, i, tmp);
++i)
{
tree name;
- if (!tmp || ! DECL_CONV_FN_P (OVL_CURRENT (tmp)))
+ if (!DECL_CONV_FN_P (OVL_CURRENT (tmp)))
break;
name = DECL_NAME (OVL_CURRENT (tmp));
@@ -2153,6 +2151,7 @@ dfs_check_overlap (tree empty_binfo, void *data)
{
struct overlap_info *oi = (struct overlap_info *) data;
tree binfo;
+
for (binfo = TYPE_BINFO (oi->compare_type);
;
binfo = BINFO_BASE_BINFO (binfo, 0))
@@ -2308,9 +2307,10 @@ binfo_for_vbase (tree base, tree t)
{
unsigned ix;
tree binfo;
+ VEC (tree) *vbases;
- for (ix = 0; (binfo = VEC_iterate
- (tree, CLASSTYPE_VBASECLASSES (t), ix)); ix++)
+ for (vbases = CLASSTYPE_VBASECLASSES (t), ix = 0;
+ VEC_iterate (tree, vbases, ix, binfo); ix++)
if (BINFO_TYPE (binfo) == base)
return binfo;
return NULL;