diff options
Diffstat (limited to 'gcc/java/expr.c')
-rw-r--r-- | gcc/java/expr.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/gcc/java/expr.c b/gcc/java/expr.c index a6bc5759a63..228c1d16a4a 100644 --- a/gcc/java/expr.c +++ b/gcc/java/expr.c @@ -426,15 +426,16 @@ can_widen_reference_to (tree source_type, tree target_type) { /* target_type is OK if source_type or source_type ancestors implement target_type. We handle multiple sub-interfaces */ + tree binfo, base_binfo; + int i; - tree basetype_vec = BINFO_BASE_BINFOS (TYPE_BINFO (source_type)); - int n = TREE_VEC_LENGTH (basetype_vec), i; - for (i=0 ; i < n; i++) - if (can_widen_reference_to - (TREE_TYPE (TREE_VEC_ELT (basetype_vec, i)), - target_type)) + for (binfo = TYPE_BINFO (source_type), i = 0; + BINFO_BASE_ITERATE (binfo, i, base_binfo); i++) + if (can_widen_reference_to + (BINFO_TYPE (base_binfo), target_type)) return 1; - if (n == 0) + + if (!i) return 0; } @@ -1459,21 +1460,20 @@ lookup_field (tree *typep, tree name) } do { - tree field, basetype_vec; + tree field, binfo, base_binfo; tree save_field; - int n, i; + int i; for (field = TYPE_FIELDS (*typep); field; field = TREE_CHAIN (field)) if (DECL_NAME (field) == name) return field; /* Process implemented interfaces. */ - basetype_vec = BINFO_BASE_BINFOS (TYPE_BINFO (*typep)); - n = TREE_VEC_LENGTH (basetype_vec); save_field = NULL_TREE; - for (i = 0; i < n; i++) + for (binfo = TYPE_BINFO (*typep), i = 0; + BINFO_BASE_ITERATE (binfo, i, base_binfo); i++) { - tree t = BINFO_TYPE (TREE_VEC_ELT (basetype_vec, i)); + tree t = BINFO_TYPE (base_binfo); if ((field = lookup_field (&t, name))) { if (save_field == field) |