+2010-08-20 Nathan Froyd <froydnj@codesourcery.com>
+
+ * vec.h (FOR_EACH_VEC_ELT): Define.
+ * c-decl.c: Use it.
+ * cfgloop.c: Likewise.
+ * cfgloopmanip.c: Likewise.
+ * cgraph.c: Likewise.
+ * cgraphunit.c: Likewise.
+ * combine.c: Likewise.
+ * config/bfin/bfin.c: Likewise.
+ * config/mips/mips.c: Likewise.
+ * config/rs6000/rs6000.c: Likewise.
+ * dbxout.c: Likewise.
+ * df-scan.c: Likewise.
+ * dominance.c: Likewise.
+ * dse.c: Likewise.
+ * dwarf2out.c: Likewise.
+ * except.c: Likewise.
+ * expr.c: Likewise.
+ * function.c: Likewise.
+ * gcse.c: Likewise.
+ * genattr.c: Likewise.
+ * ggc-common.c: Likewise.
+ * gimplify.c: Likewise.
+ * graphite-blocking.c: Likewise.
+ * graphite-clast-to-gimple.c: Likewise.
+ * graphite-dependences.c: Likewise.
+ * graphite-interchange.c: Likewise.
+ * graphite-poly.c: Likewise.
+ * graphite-scop-detection.c: Likewise.
+ * graphite-sese-to-poly.c: Likewise.
+ * graphite.c: Likewise.
+ * haifa-sched.c: Likewise.
+ * ifcvt.c: Likewise.
+ * implicit-zee.c: Likewise.
+ * ipa-prop.c: Likewise.
+ * ipa-struct-reorg.c: Likewise.
+ * ipa.c: Likewise.
+ * ira-build.c: Likewise.
+ * ira-color.c: Likewise.
+ * ira-emit.c: Likewise.
+ * lambda-code.c: Likewise.
+ * loop-invariant.c: Likewise.
+ * loop-unroll.c: Likewise.
+ * lower-subreg.c: Likewise.
+ * lto-cgraph.c: Likewise.
+ * lto-opts.c: Likewise.
+ * lto-streamer-in.c: Likewise.
+ * lto-streamer-out.c: Likewise.
+ * lto-streamer.c: Likewise.
+ * lto-symtab.c: Likewise.
+ * matrix-reorg.c: Likewise.
+ * opts.c: Likewise.
+ * predict.c: Likewise.
+ * print-tree.c: Likewise.
+ * sdbout.c: Likewise.
+ * sel-sched-dump.c: Likewise.
+ * sel-sched-ir.c: Likewise.
+ * sel-sched.c: Likewise.
+ * sese.c: Likewise.
+ * stor-layout.c: Likewise.
+ * tree-cfg.c: Likewise.
+ * tree-cfgcleanup.c: Likewise.
+ * tree-chrec.c: Likewise.
+ * tree-data-ref.c: Likewise.
+ * tree-emutls.c: Likewise.
+ * tree-inline.c: Likewise.
+ * tree-into-ssa.c: Likewise.
+ * tree-loop-distribution.c: Likewise.
+ * tree-loop-linear.c: Likewise.
+ * tree-mudflap.c: Likewise.
+ * tree-outof-ssa.c: Likewise.
+ * tree-parloops.c: Likewise.
+ * tree-predcom.c: Likewise.
+ * tree-pretty-print.c: Likewise.
+ * tree-scalar-evolution.c: Likewise.
+ * tree-ssa-live.c: Likewise.
+ * tree-ssa-loop-im.c: Likewise.
+ * tree-ssa-loop-ivcanon.c: Likewise.
+ * tree-ssa-loop-ivopts.c: Likewise.
+ * tree-ssa-loop-manip.c: Likewise.
+ * tree-ssa-loop-niter.c: Likewise.
+ * tree-ssa-loop-prefetch.c: Likewise.
+ * tree-ssa-phiprop.c: Likewise.
+ * tree-ssa-pre.c: Likewise.
+ * tree-ssa-reassoc.c: Likewise.
+ * tree-ssa-sccvn.c: Likewise.
+ * tree-ssa-structalias.c: Likewise.
+ * tree-ssa.c: Likewise.
+ * tree-vect-data-refs.c: Likewise.
+ * tree-vect-loop-manip.c: Likewise.
+ * tree-vect-loop.c: Likewise.
+ * tree-vect-patterns.c: Likewise.
+ * tree-vect-slp.c: Likewise.
+ * tree-vect-stmts.c: Likewise.
+ * tree-vrp.c: Likewise.
+ * tree.c: Likewise.
+ * value-prof.c: Likewise.
+ * var-tracking.c: Likewise.
+ * varasm.c: Likewise.
+ * vmsdbgout.c: Likewise.
+
2010-08-20 Joseph Myers <joseph@codesourcery.com>
* doc/tm.texi.in (PIC_OFFSET_TABLE_REG_CALL_CLOBBERED): Document to
+2010-08-20 Nathan Froyd <froydnj@codesourcery.com>
+
+ * gcc-interface/decl.c: Use FOR_EACH_VEC_ELT.
+ * gcc-interface/trans.c: Likewise.
+ * gcc-interface/utils.c: Likewise.
+
2010-08-18 Eric Botcazou <ebotcazou@adacore.com>
* tracebak.c (i386): Use GCC unwinder on Linux with GCC > 4.5.
unsigned int i;
tree t;
- for (i = 0; VEC_iterate (tree, defer_finalize_list, i, t); i++)
+ FOR_EACH_VEC_ELT (tree, defer_finalize_list, i, t)
rest_of_type_decl_compilation_no_defer (t);
VEC_free (tree, heap, defer_finalize_list);
and the dimension in the cache and create a new one on failure. */
if (!optimize && Present (gnat_param))
{
- for (i = 0; VEC_iterate (parm_attr, f_parm_attr_cache, i, pa); i++)
+ FOR_EACH_VEC_ELT (parm_attr, f_parm_attr_cache, i, pa)
if (pa->id == gnat_param && pa->dim == Dimension)
break;
start_stmt_group ();
- for (i = 0; VEC_iterate (parm_attr, cache, i, pa); i++)
+ FOR_EACH_VEC_ELT (parm_attr, cache, i, pa)
{
if (pa->first)
add_stmt_with_node (pa->first, gnat_node);
unsigned int i;
tree iter;
- for (i = 0; VEC_iterate(tree, global_renaming_pointers, i, iter); i++)
+ FOR_EACH_VEC_ELT (tree, global_renaming_pointers, i, iter)
SET_DECL_RENAMED_OBJECT (iter, NULL_TREE);
VEC_free (tree, gc, global_renaming_pointers);
unsigned i;
tree decl;
- for (i = 0; VEC_iterate(tree, builtin_decls, i, decl); i++)
+ FOR_EACH_VEC_ELT (tree, builtin_decls, i, decl)
if (DECL_NAME (decl) == name)
return decl;
/* Update the bindings of any goto statements associated
with this label. */
- for (ix = 0;
- VEC_iterate (c_goto_bindings_p, label_vars->gotos, ix, g);
- ++ix)
+ FOR_EACH_VEC_ELT (c_goto_bindings_p, label_vars->gotos, ix, g)
update_spot_bindings (scope, &g->goto_bindings);
}
}
continue;
label_vars = b->u.label;
++label_vars->label_bindings.stmt_exprs;
- for (ix = 0;
- VEC_iterate (c_goto_bindings_p, label_vars->gotos, ix, g);
- ++ix)
+ FOR_EACH_VEC_ELT (c_goto_bindings_p, label_vars->gotos, ix, g)
++g->goto_bindings.stmt_exprs;
}
}
label_vars->label_bindings.left_stmt_expr = true;
label_vars->label_bindings.stmt_exprs = 0;
}
- for (ix = 0;
- VEC_iterate (c_goto_bindings_p, label_vars->gotos, ix, g);
- ++ix)
+ FOR_EACH_VEC_ELT (c_goto_bindings_p, label_vars->gotos, ix, g)
{
--g->goto_bindings.stmt_exprs;
if (g->goto_bindings.stmt_exprs < 0)
...
goto lab;
Issue a warning or error. */
- for (ix = 0; VEC_iterate (tree, label_vars->decls_in_scope, ix, decl); ++ix)
+ FOR_EACH_VEC_ELT (tree, label_vars->decls_in_scope, ix, decl)
warn_about_goto (loc, label, decl);
if (label_vars->label_bindings.left_stmt_expr)
unsigned int ix;
struct c_goto_bindings *g;
- for (ix = 0;
- VEC_iterate (c_goto_bindings_p, label_vars->gotos, ix, g);
- ++ix)
+ FOR_EACH_VEC_ELT (c_goto_bindings_p, label_vars->gotos, ix, g)
{
struct c_binding *b;
struct c_scope *scope;
because the flag is used to issue visibility warnings, and we
only want to issue those warnings if the type is referenced
outside of the struct declaration. */
- for (ix = 0; VEC_iterate (tree, struct_parse_info->struct_types, ix, x); ++ix)
+ FOR_EACH_VEC_ELT (tree, struct_parse_info->struct_types, ix, x)
C_TYPE_DEFINED_IN_STRUCT (x) = 1;
/* The TYPEDEFS_SEEN field of STRUCT_PARSE_INFO is a list of
a pointer_set because identifiers are interned. */
struct pointer_set_t *tset = pointer_set_create ();
- for (ix = 0;
- VEC_iterate (tree, struct_parse_info->typedefs_seen, ix, x);
- ++ix)
+ FOR_EACH_VEC_ELT (tree, struct_parse_info->typedefs_seen, ix, x)
pointer_set_insert (tset, DECL_NAME (x));
for (x = fieldlist; x != NULL_TREE; x = DECL_CHAIN (x))
/* For each field which has a binding and which was not defined in
an enclosing struct, clear the in_struct field. */
- for (ix = 0;
- VEC_iterate (c_binding_ptr, struct_parse_info->fields, ix, b);
- ++ix)
+ FOR_EACH_VEC_ELT (c_binding_ptr, struct_parse_info->fields, ix, b)
b->in_struct = 0;
}
tree t;
int i;
- for (i = 0; VEC_iterate (tree, pending_sizes, i, t); i++)
+ FOR_EACH_VEC_ELT (tree, pending_sizes, i, t)
add_stmt (t);
}
+2010-08-20 Nathan Froyd <froydnj@codesourcery.com>
+
+ * c-common.c: Use FOR_EACH_VEC_ELT.
+ * c-gimplify.c: Likewise.
+ * c-pragma.c: Likewise.
+
2010-08-16 Joseph Myers <joseph@codesourcery.com>
* c.opt (MDX): Change back to MD. Mark NoDriverArg instead of
ret = make_tree_vector ();
VEC_reserve (tree, gc, ret, VEC_length (tree, orig));
- for (ix = 0; VEC_iterate (tree, orig, ix, t); ++ix)
+ FOR_EACH_VEC_ELT (tree, orig, ix, t)
VEC_quick_push (tree, ret, t);
return ret;
}
gimple bind;
VEC(gimple, heap) *stack = gimple_bind_expr_stack ();
- for (i = 0; VEC_iterate (gimple, stack, i, bind); i++)
+ FOR_EACH_VEC_ELT (gimple, stack, i, bind)
if (gimple_bind_block (bind))
break;
id = DECL_ASSEMBLER_NAME (decl);
- for (i = 0; VEC_iterate (pending_weak, pending_weaks, i, pe); i++)
+ FOR_EACH_VEC_ELT (pending_weak, pending_weaks, i, pe)
if (id == pe->name)
{
apply_pragma_weak (decl, pe->value);
int i;
pending_weak *pe;
- for (i = 0; VEC_iterate (pending_weak, pending_weaks, i, pe); i++)
+ FOR_EACH_VEC_ELT (pending_weak, pending_weaks, i, pe)
{
alias_id = pe->name;
id = pe->value;
unsigned ix;
pending_redefinition *p;
- for (ix = 0;
- VEC_iterate (pending_redefinition, pending_redefine_extname, ix, p);
- ix++)
+ FOR_EACH_VEC_ELT (pending_redefinition, pending_redefine_extname, ix, p)
if (oldname == p->oldname)
{
if (p->newname != newname)
"conflict with previous rename");
/* Take any pending redefine_extname off the list. */
- for (ix = 0;
- VEC_iterate (pending_redefinition, pending_redefine_extname, ix, p);
- ix++)
+ FOR_EACH_VEC_ELT (pending_redefinition, pending_redefine_extname, ix, p)
if (DECL_NAME (decl) == p->oldname)
{
/* Only warn if there is a conflict. */
}
/* Find out if we have a pending #pragma redefine_extname. */
- for (ix = 0;
- VEC_iterate (pending_redefinition, pending_redefine_extname, ix, p);
- ix++)
+ FOR_EACH_VEC_ELT (pending_redefinition, pending_redefine_extname, ix, p)
if (DECL_NAME (decl) == p->oldname)
{
tree newname = p->newname;
{
fprintf (file, "multiple latches:");
latches = get_loop_latch_edges (loop);
- for (i = 0; VEC_iterate (edge, latches, i, e); i++)
+ FOR_EACH_VEC_ELT (edge, latches, i, e)
fprintf (file, " %d", e->src->index);
VEC_free (edge, heap, latches);
fprintf (file, "\n");
loop_p loop;
/* Free the loop descriptors. */
- for (i = 0; VEC_iterate (loop_p, loops->larray, i, loop); i++)
+ FOR_EACH_VEC_ELT (loop_p, loops->larray, i, loop)
{
if (!loop)
continue;
VEC_truncate (loop_p, loop->superloops, 0);
VEC_reserve (loop_p, gc, loop->superloops, depth);
- for (i = 0; VEC_iterate (loop_p, father->superloops, i, ploop); i++)
+ FOR_EACH_VEC_ELT (loop_p, father->superloops, i, ploop)
VEC_quick_push (loop_p, loop->superloops, ploop);
VEC_quick_push (loop_p, loop->superloops, father);
edge e, me = NULL;
gcov_type mcount = 0, tcount = 0;
- for (i = 0; VEC_iterate (edge, latches, i, e); i++)
+ FOR_EACH_VEC_ELT (edge, latches, i, e)
{
if (e->count > mcount)
{
latch = e;
/* Verify that it dominates all the latch edges. */
- for (i = 0; VEC_iterate (edge, latches, i, e); i++)
+ FOR_EACH_VEC_ELT (edge, latches, i, e)
if (!dominated_by_p (CDI_DOMINATORS, e->src, latch->src))
return NULL;
if (!bb || !flow_bb_inside_loop_p (loop, bb))
continue;
- for (i = 0; VEC_iterate (edge, latches, i, e); i++)
+ FOR_EACH_VEC_ELT (edge, latches, i, e)
if (e != latch
&& PHI_ARG_DEF_FROM_EDGE (phi, e) == lop)
return NULL;
fprintf (dump_file, "Merged latch edges of loop %d\n", loop->num);
mfb_reis_set = pointer_set_create ();
- for (i = 0; VEC_iterate (edge, latches, i, e); i++)
+ FOR_EACH_VEC_ELT (edge, latches, i, e)
pointer_set_insert (mfb_reis_set, e);
latch = make_forwarder_block (loop->header, mfb_redirect_edges_in_set,
NULL);
bb->loop_father = loop;
bb->loop_depth = loop_depth (loop);
loop->num_nodes++;
- for (i = 0; VEC_iterate (loop_p, loop->superloops, i, ploop); i++)
+ FOR_EACH_VEC_ELT (loop_p, loop->superloops, i, ploop)
ploop->num_nodes++;
FOR_EACH_EDGE (e, ei, bb->succs)
gcc_assert (loop != NULL);
loop->num_nodes--;
- for (i = 0; VEC_iterate (loop_p, loop->superloops, i, ploop); i++)
+ FOR_EACH_VEC_ELT (loop_p, loop->superloops, i, ploop)
ploop->num_nodes--;
bb->loop_father = NULL;
bb->loop_depth = 0;
struct loop *father = current_loops->tree_root, *act;
bool ret = false;
- for (i = 0; VEC_iterate (edge, exits, i, e); i++)
+ FOR_EACH_VEC_ELT (edge, exits, i, e)
{
act = find_common_loop (loop, e->dest->loop_father);
if (flow_loop_nested_p (father, act))
/* The exit edges of LOOP no longer exits its original immediate
superloops; remove them from the appropriate exit lists. */
- for (i = 0; VEC_iterate (edge, exits, i, e); i++)
+ FOR_EACH_VEC_ELT (edge, exits, i, e)
rescan_loop_exit (e, false, false);
ret = true;
bb->aux = 0;
dom_bbs = get_dominated_by (CDI_DOMINATORS, bb);
- for (j = 0; VEC_iterate (basic_block, dom_bbs, j, dominated); j++)
+ FOR_EACH_VEC_ELT (basic_block, dom_bbs, j, dominated)
{
if (flow_bb_inside_loop_p (loop, dominated))
continue;
n->count = 0;
}
- for (i = 0; VEC_iterate (cgraph_edge_p, redirect_callers, i, e); i++)
+ FOR_EACH_VEC_ELT (cgraph_edge_p, redirect_callers, i, e)
{
/* Redirect calls to the old version node to point to its new
version. */
DECL_WEAK (new_node->decl) = 0;
new_node->clone.tree_map = tree_map;
new_node->clone.args_to_skip = args_to_skip;
- for (i = 0; VEC_iterate (ipa_replace_map_p, tree_map, i, map); i++)
+ FOR_EACH_VEC_ELT (ipa_replace_map_p, tree_map, i, map)
{
tree var = map->new_tree;
e->lto_stmt_uid, REG_BR_PROB_BASE,
CGRAPH_FREQ_BASE,
e->loop_nest, true);
- for (i = 0; VEC_iterate (cgraph_edge_p, redirect_callers, i, e); i++)
+ FOR_EACH_VEC_ELT (cgraph_edge_p, redirect_callers, i, e)
{
/* Redirect calls to the old version node to point to its new
version. */
unsigned int i;
reg_stat_type *p;
- for (i = 0; VEC_iterate (reg_stat_type, reg_stat, i, p); ++i)
+ FOR_EACH_VEC_ELT (reg_stat_type, reg_stat, i, p)
memset (p, 0, offsetof (reg_stat_type, sign_bit_copies));
}
\f
fprintf (dump_file, "{head:%d, depth:%d}", loop->head->index, loop->depth);
fprintf (dump_file, " blocks: [ ");
- for (ix = 0; VEC_iterate (basic_block, loop->blocks, ix, b); ix++)
+ FOR_EACH_VEC_ELT (basic_block, loop->blocks, ix, b)
fprintf (dump_file, "%d ", b->index);
fprintf (dump_file, "] ");
fprintf (dump_file, " inner loops: [ ");
- for (ix = 0; VEC_iterate (loop_info, loop->loops, ix, i); ix++)
+ FOR_EACH_VEC_ELT (loop_info, loop->loops, ix, i)
fprintf (dump_file, "%d ", i->loop_no);
fprintf (dump_file, "]\n");
}
unsigned ix;
basic_block bb;
- for (ix = 0; VEC_iterate (basic_block, loop->blocks, ix, bb); ix++)
+ FOR_EACH_VEC_ELT (basic_block, loop->blocks, ix, bb)
{
rtx insn;
/* Every loop contains in its list of inner loops every loop nested inside
it, even if there are intermediate loops. This works because we're doing
a depth-first search here and never visit a loop more than once. */
- for (ix = 0; VEC_iterate (loop_info, loop->loops, ix, inner); ix++)
+ FOR_EACH_VEC_ELT (loop_info, loop->loops, ix, inner)
{
bfin_optimize_loop (inner);
reg_lb0 = gen_rtx_REG (SImode, REG_LB0);
reg_lb1 = gen_rtx_REG (SImode, REG_LB1);
- for (ix = 0; VEC_iterate (basic_block, loop->blocks, ix, bb); ix++)
+ FOR_EACH_VEC_ELT (basic_block, loop->blocks, ix, bb)
{
rtx insn;
if (!loop->bad)
{
int pass, retry;
- for (dwork = 0; VEC_iterate (basic_block, loop->blocks, dwork, bb); dwork++)
+ FOR_EACH_VEC_ELT (basic_block, loop->blocks, dwork, bb)
{
edge e;
edge_iterator ei;
struct mips_multi_member *member;
unsigned int i;
- for (i = 0;
- VEC_iterate (mips_multi_member, mips_multi_members, i, member);
- i++)
+ FOR_EACH_VEC_ELT (mips_multi_member, mips_multi_members, i, member)
if (member->is_label_p)
fprintf (asm_out_file, "%s\n", member->format);
else
branch_island *bi;
unsigned ix;
- for (ix = 0; VEC_iterate (branch_island, branch_islands, ix, bi); ix++)
+ FOR_EACH_VEC_ELT (branch_island, branch_islands, ix, bi)
if (function_name == bi->function_name)
return 0;
return 1;
branch_island *bi;
unsigned ix;
- for (ix = 0; VEC_iterate (branch_island, branch_islands, ix, bi); ix++)
+ FOR_EACH_VEC_ELT (branch_island, branch_islands, ix, bi)
if (function_name == bi->function_name)
return bi->label_name;
return NULL_TREE;
+2010-08-20 Nathan Froyd <froydnj@codesourcery.com>
+
+ * call.c: Use FOR_EACH_VEC_ELT.
+ * class.c: Likewise.
+ * decl.c: Likewise.
+ * decl2.c: Likewise.
+ * error.c: Likewise.
+ * except.c: Likewise.
+ * mangle.c: Likewise.
+ * method.c: Likewise.
+ * name-lookup.c: Likewise.
+ * parser.c: Likewise.
+ * pt.c: Likewise.
+ * repo.c: Likewise.
+ * semantics.c: Likewise.
+ * typeck2.c: Likewise.
+
2010-08-19 Jason Merrill <jason@redhat.com>
* call.c (reference_related_p): Check for error_mark_node.
unsigned int ix;
tree arg;
- for (ix = 0; VEC_iterate (tree, args, ix, arg); ++ix)
+ FOR_EACH_VEC_ELT (tree, args, ix, arg)
{
if (error_operand_p (arg))
return NULL;
}
/* Detect recursion. */
- for (i = 0; VEC_iterate (tree, default_arg_context, i, t); ++i)
+ FOR_EACH_VEC_ELT (tree, default_arg_context, i, t)
if (t == fn)
{
error ("recursive evaluation of default argument for %q#D", fn);
++nargs;
alcarray = XALLOCAVEC (tree, nargs);
alcarray[0] = first_arg;
- for (ix = 0; VEC_iterate (tree, args, ix, arg); ++ix)
+ FOR_EACH_VEC_ELT (tree, args, ix, arg)
alcarray[ix + 1] = arg;
argarray = alcarray;
}
tree_pair_p p;
unsigned ix;
- for (ix = 0; VEC_iterate (tree_pair_s, indices, ix, p); ix++)
+ FOR_EACH_VEC_ELT (tree_pair_s, indices, ix, p)
if ((DECL_DESTRUCTOR_P (fn) && DECL_DESTRUCTOR_P (p->purpose))
|| same_signature_p (fn, p->purpose))
return p->value;
signature as FN, then we do not need a second vcall offset.
Check the list of functions already present in the derived
class vtable. */
- for (i = 0; VEC_iterate (tree, vid->fns, i, derived_entry); ++i)
+ FOR_EACH_VEC_ELT (tree, vid->fns, i, derived_entry)
{
if (same_signature_p (derived_entry, orig_fn)
/* We only use one vcall offset for virtual destructors,
/* Remove declarations for any `for' variables from inner scopes
that we kept around. */
- for (ix = VEC_length (tree, current_binding_level->dead_vars_from_for) - 1;
- VEC_iterate (tree, current_binding_level->dead_vars_from_for, ix, decl);
- ix--)
+ FOR_EACH_VEC_ELT_REVERSE (tree, current_binding_level->dead_vars_from_for,
+ ix, decl)
pop_binding (DECL_NAME (decl), decl);
/* Restore the IDENTIFIER_TYPE_VALUEs. */
SET_IDENTIFIER_TYPE_VALUE (TREE_PURPOSE (link), TREE_VALUE (link));
/* Restore the IDENTIFIER_LABEL_VALUEs for local labels. */
- for (ix = VEC_length (cp_label_binding,
- current_binding_level->shadowed_labels) - 1;
- VEC_iterate (cp_label_binding, current_binding_level->shadowed_labels,
- ix, label_bind);
- ix--)
+ FOR_EACH_VEC_ELT_REVERSE (cp_label_binding,
+ current_binding_level->shadowed_labels,
+ ix, label_bind)
pop_local_label (label_bind->label, label_bind->prev_value);
/* There may be OVERLOADs (wrapped in TREE_LISTs) on the BLOCK_VARs
identified = true;
}
- for (ix = 0; VEC_iterate (tree, ent->bad_decls, ix, bad); ix++)
+ FOR_EACH_VEC_ELT (tree, ent->bad_decls, ix, bad)
{
int u = decl_jump_unsafe (bad);
VEC(constructor_elt,gc) *v = CONSTRUCTOR_ELTS (initializer);
constructor_elt *ce;
HOST_WIDE_INT i;
- for (i = 0;
- VEC_iterate (constructor_elt, v, i, ce);
- ++i)
+ FOR_EACH_VEC_ELT (constructor_elt, v, i, ce)
if (!check_array_designated_initializer (ce))
failure = 1;
}
unsigned int i;
tree decl;
- for (i = 0; VEC_iterate (tree, deferred_mark_used_calls, i, decl); i++)
+ FOR_EACH_VEC_ELT (tree, deferred_mark_used_calls, i, decl)
mark_used (decl);
VEC_free (tree, gc, deferred_mark_used_calls);
}
/* Call the static storage duration function with appropriate
arguments. */
- for (i = 0; VEC_iterate (tree, ssdf_decls, i, fndecl); ++i)
+ FOR_EACH_VEC_ELT (tree, ssdf_decls, i, fndecl)
{
/* Calls to pure or const functions will expand to nothing. */
if (! (flags_from_decl_or_type (fndecl) & (ECF_CONST | ECF_PURE)))
/* Go through the set of inline functions whose bodies have not
been emitted yet. If out-of-line copies of these functions
are required, emit them. */
- for (i = 0; VEC_iterate (tree, deferred_fns, i, decl); ++i)
+ FOR_EACH_VEC_ELT (tree, deferred_fns, i, decl)
{
/* Does it need synthesizing? */
if (DECL_DEFAULTED_FN (decl) && ! DECL_INITIAL (decl)
reconsider = true;
/* Static data members are just like namespace-scope globals. */
- for (i = 0; VEC_iterate (tree, pending_statics, i, decl); ++i)
+ FOR_EACH_VEC_ELT (tree, pending_statics, i, decl)
{
if (var_finalized_p (decl) || DECL_REALLY_EXTERN (decl)
/* Don't write it out if we haven't seen a definition. */
while (reconsider);
/* All used inline functions must have a definition at this point. */
- for (i = 0; VEC_iterate (tree, deferred_fns, i, decl); ++i)
+ FOR_EACH_VEC_ELT (tree, deferred_fns, i, decl)
{
if (/* Check online inline functions that were actually used. */
DECL_ODR_USED (decl) && DECL_DECLARED_INLINE_P (decl)
}
/* So must decls that use a type with no linkage. */
- for (i = 0; VEC_iterate (tree, no_linkage_decls, i, decl); ++i)
+ FOR_EACH_VEC_ELT (tree, no_linkage_decls, i, decl)
if (!decl_defined_p (decl))
no_linkage_error (decl);
parms = TREE_CHAIN (parms);
}
- for (i = 0; VEC_iterate (tree, typenames, i, t); ++i)
+ FOR_EACH_VEC_ELT (tree, typenames, i, t)
{
if (need_comma)
pp_separate_with_comma (cxx_pp);
int i;
pending_noexcept *p;
location_t saved_loc = input_location;
- for (i = 0;
- VEC_iterate (pending_noexcept, pending_noexcept_checks, i, p);
- ++i)
+ FOR_EACH_VEC_ELT (pending_noexcept, pending_noexcept_checks, i, p)
{
input_location = p->loc;
maybe_noexcept_warning (p->fn);
tree el;
fprintf (stderr, " ++ substitutions ");
- for (i = 0; VEC_iterate (tree, G.substitutions, i, el); ++i)
+ FOR_EACH_VEC_ELT (tree, G.substitutions, i, el)
{
const char *name = "???";
int i;
tree candidate;
- for (i = 0; VEC_iterate (tree, G.substitutions, i, candidate); i++)
+ FOR_EACH_VEC_ELT (tree, G.substitutions, i, candidate)
{
gcc_assert (!(DECL_P (node) && node == candidate));
gcc_assert (!(TYPE_P (node) && TYPE_P (candidate)
if (diag)
msg = ("virtual base %qT does not have a move constructor "
"or trivial copy constructor");
- for (i = 0; VEC_iterate (tree, vbases, i, base_binfo); ++i)
+ FOR_EACH_VEC_ELT (tree, vbases, i, base_binfo)
{
if (copy_arg_p)
argtype = build_stub_type (BINFO_TYPE (base_binfo), quals, move_p);
/* Fixup the current bindings, as they might have moved. */
size_t i;
- for (i = 0;
- VEC_iterate (cp_class_binding, scope->class_shadowed, i, cb);
- i++)
+ FOR_EACH_VEC_ELT (cp_class_binding, scope->class_shadowed, i, cb)
{
cxx_binding **b;
b = &IDENTIFIER_BINDING (cb->identifier);
size_t i;
cp_class_binding *b;
fprintf (stderr, " class-shadowed:");
- for (i = 0;
- VEC_iterate(cp_class_binding, lvl->class_shadowed, i, b);
- ++i)
+ FOR_EACH_VEC_ELT (cp_class_binding, lvl->class_shadowed, i, b)
fprintf (stderr, " %s ", IDENTIFIER_POINTER (b->identifier));
fprintf (stderr, "\n");
}
/* Remove the bindings for all of the class-level declarations. */
if (level->class_shadowed)
{
- for (i = 0;
- VEC_iterate (cp_class_binding, level->class_shadowed, i, cb);
- ++i)
+ FOR_EACH_VEC_ELT (cp_class_binding, level->class_shadowed, i, cb)
IDENTIFIER_BINDING (cb->identifier) = cb->base.previous;
ggc_free (level->class_shadowed);
level->class_shadowed = NULL;
{
unsigned int i;
tree elt;
- for (i = 0; VEC_iterate(tree,vec,i,elt); ++i)
+ FOR_EACH_VEC_ELT (tree,vec,i,elt)
if (elt == target)
return true;
return false;
unsigned int ix;
tree arg;
- for (ix = 0; VEC_iterate (tree, args, ix, arg); ++ix)
+ FOR_EACH_VEC_ELT (tree, args, ix, arg)
if (arg_assoc (k, arg))
return true;
return false;
SET_IDENTIFIER_TYPE_VALUE (TREE_PURPOSE (t), TREE_VALUE (t));
}
- for (i = 0; VEC_iterate (cxx_saved_binding, s->old_bindings, i, sb); ++i)
+ FOR_EACH_VEC_ELT (cxx_saved_binding, s->old_bindings, i, sb)
IDENTIFIER_MARKED (sb->identifier) = 0;
s->prev = scope_chain;
current_lang_base = 0;
scope_chain = s->prev;
- for (i = 0; VEC_iterate (cxx_saved_binding, s->old_bindings, i, saved); ++i)
+ FOR_EACH_VEC_ELT (cxx_saved_binding, s->old_bindings, i, saved)
{
tree id = saved->identifier;
access_check = check_value->checks;
if (access_check)
{
- for (i = 0 ;
- VEC_iterate (deferred_access_check, access_check, i, chk) ;
- ++i)
- {
- perform_or_defer_access_check (chk->binfo,
- chk->decl,
- chk->diag_decl);
- }
+ FOR_EACH_VEC_ELT (deferred_access_check, access_check, i, chk)
+ perform_or_defer_access_check (chk->binfo,
+ chk->decl,
+ chk->diag_decl);
}
/* Return the stored value. */
return check_value->value;
};
*/
- for (ix = 0;
- VEC_iterate (cp_default_arg_entry, unparsed_funs_with_default_args,
- ix, e);
- ix++)
+ FOR_EACH_VEC_ELT (cp_default_arg_entry, unparsed_funs_with_default_args,
+ ix, e)
{
fn = e->decl;
/* If there are default arguments that have not yet been processed,
pop_scope (pushed_scope);
VEC_truncate (cp_default_arg_entry, unparsed_funs_with_default_args, 0);
/* Now parse the body of the functions. */
- for (ix = 0;
- VEC_iterate (tree, unparsed_funs_with_definitions, ix, fn);
- ix++)
+ FOR_EACH_VEC_ELT (tree, unparsed_funs_with_definitions, ix, fn)
cp_parser_late_parsing_for_member (parser, fn);
VEC_truncate (tree, unparsed_funs_with_definitions, 0);
}
checks = check_value->checks;
if (checks)
{
- for (i = 0 ;
- VEC_iterate (deferred_access_check, checks, i, chk) ;
- ++i)
- {
- perform_or_defer_access_check (chk->binfo,
- chk->decl,
- chk->diag_decl);
- }
+ FOR_EACH_VEC_ELT (deferred_access_check, checks, i, chk)
+ perform_or_defer_access_check (chk->binfo,
+ chk->decl,
+ chk->diag_decl);
}
/* Set the scope from the stored value. */
parser->scope = check_value->value;
return;
saved_location = input_location;
- for (i = 0;
- VEC_iterate (qualified_typedef_usage_t,
+ FOR_EACH_VEC_ELT (qualified_typedef_usage_t,
get_types_needing_access_check (tmpl),
- i, iter);
- ++i)
+ i, iter)
{
tree type_decl = iter->typedef_decl;
tree type_scope = iter->context;
n = VEC_copy (constructor_elt, gc, CONSTRUCTOR_ELTS (t));
newlen = VEC_length (constructor_elt, n);
- for (idx = 0; VEC_iterate (constructor_elt, n, idx, ce); idx++)
+ FOR_EACH_VEC_ELT (constructor_elt, n, idx, ce)
{
if (ce->index && process_index_p)
ce->index = RECUR (ce->index);
VEC(constructor_elt,gc) *old_n = n;
n = VEC_alloc (constructor_elt, gc, newlen);
- for (idx = 0; VEC_iterate (constructor_elt, old_n, idx, ce);
- idx++)
+ FOR_EACH_VEC_ELT (constructor_elt, old_n, idx, ce)
{
if (TREE_CODE (ce->value) == TREE_VEC)
{
unsigned int i;
tree arg;
- for (i = 0; VEC_iterate (tree, args, i, arg); ++i)
+ FOR_EACH_VEC_ELT (tree, args, i, arg)
{
if (type_dependent_expression_p (arg))
return true;
unsigned int ix;
tree arg;
- for (ix = 0; VEC_iterate (tree, args, ix, arg); ++ix)
+ FOR_EACH_VEC_ELT (tree, args, ix, arg)
{
tree newarg = build_non_dependent_expr (arg);
if (newarg != arg)
gcc_assert (type_decl && (TREE_CODE (type_decl) == TYPE_DECL));
/* Make sure we don't append the type to the template twice. */
- for (i = 0;
- VEC_iterate (qualified_typedef_usage_t,
+ FOR_EACH_VEC_ELT (qualified_typedef_usage_t,
get_types_needing_access_check (templ),
- i, iter);
- ++i)
+ i, iter)
if (iter->typedef_decl == type_decl && scope == iter->context)
return;
fprintf (repo_file, "\n");
}
- for (ix = VEC_length (tree, pending_repo) - 1;
- VEC_iterate (tree, pending_repo, ix, val);
- ix--)
+ FOR_EACH_VEC_ELT_REVERSE (tree, pending_repo, ix, val)
{
tree name = DECL_ASSEMBLER_NAME (val);
char type = IDENTIFIER_REPO_CHOSEN (name) ? 'C' : 'O';
int i, j;
deferred_access_check *chk, *probe;
- for (i = 0 ;
- VEC_iterate (deferred_access_check, checks, i, chk) ;
- ++i)
+ FOR_EACH_VEC_ELT (deferred_access_check, checks, i, chk)
{
- for (j = 0 ;
- VEC_iterate (deferred_access_check,
- ptr->deferred_access_checks, j, probe) ;
- ++j)
+ FOR_EACH_VEC_ELT (deferred_access_check,
+ ptr->deferred_access_checks, j, probe)
{
if (probe->binfo == chk->binfo &&
probe->decl == chk->decl &&
if (!checks)
return;
- for (i = 0 ; VEC_iterate (deferred_access_check, checks, i, chk) ; ++i)
+ FOR_EACH_VEC_ELT (deferred_access_check, checks, i, chk)
enforce_access (chk->binfo, chk->decl, chk->diag_decl);
}
}
/* See if we are already going to perform this check. */
- for (i = 0 ;
- VEC_iterate (deferred_access_check,
- ptr->deferred_access_checks, i, chk) ;
- ++i)
+ FOR_EACH_VEC_ELT (deferred_access_check,
+ ptr->deferred_access_checks, i, chk)
{
if (chk->decl == decl && chk->binfo == binfo &&
chk->diag_decl == diag_decl)
" because the following virtual functions are pure within %qT:",
type);
- for (ix = 0; VEC_iterate (tree, pure, ix, fn); ix++)
+ FOR_EACH_VEC_ELT (tree, pure, ix, fn)
inform (input_location, "\t%+#D", fn);
/* Now truncate the vector. This leaves it non-null, so we know
there are pure virtuals, but empty so we don't list them out
if (!unbounded && VEC_length (constructor_elt, v) > len)
error ("too many initializers for %qT", type);
- for (i = 0; VEC_iterate (constructor_elt, v, i, ce); ++i)
+ FOR_EACH_VEC_ELT (constructor_elt, v, i, ce)
{
if (ce->index)
{
qsort (VEC_address (tree, types), VEC_length (tree, types),
sizeof (tree), output_types_sort);
- for (i = 0; VEC_iterate (tree, types, i, type); i++)
+ FOR_EACH_VEC_ELT (tree, types, i, type)
debug_queue_symbol (type);
VEC_free (tree, heap, types);
df_ref ref;
struct df_mw_hardreg *mw;
- for (ix = 0; VEC_iterate (df_ref, collection_rec->def_vec, ix, ref); ++ix)
+ FOR_EACH_VEC_ELT (df_ref, collection_rec->def_vec, ix, ref)
df_free_ref (ref);
- for (ix = 0; VEC_iterate (df_ref, collection_rec->use_vec, ix, ref); ++ix)
+ FOR_EACH_VEC_ELT (df_ref, collection_rec->use_vec, ix, ref)
df_free_ref (ref);
- for (ix = 0; VEC_iterate (df_ref, collection_rec->eq_use_vec, ix, ref); ++ix)
+ FOR_EACH_VEC_ELT (df_ref, collection_rec->eq_use_vec, ix, ref)
df_free_ref (ref);
- for (ix = 0;
- VEC_iterate (df_mw_hardreg_ptr, collection_rec->mw_vec, ix, mw);
- ++ix)
+ FOR_EACH_VEC_ELT (df_mw_hardreg_ptr, collection_rec->mw_vec, ix, mw)
pool_free (problem_data->mw_reg_pool, mw);
VEC_free (df_ref, stack, collection_rec->def_vec);
if (add_to_table && df->analyze_subset)
add_to_table = bitmap_bit_p (df->blocks_to_analyze, bb->index);
- for (ix = 0; VEC_iterate (df_ref, old_vec, ix, this_ref); ++ix)
+ FOR_EACH_VEC_ELT (df_ref, old_vec, ix, this_ref)
{
new_vec[ix] = this_ref;
df_install_ref (this_ref, reg_info[DF_REF_REGNO (this_ref)],
unsigned int ix;
df_ref ref;
- for (ix = 0; VEC_iterate (df_ref, collection_rec->def_vec, ix, ref); ++ix)
+ FOR_EACH_VEC_ELT (df_ref, collection_rec->def_vec, ix, ref)
{
if (DF_REF_FLAGS_IS_SET (ref, DF_REF_CONDITIONAL))
{
/* Do not generate clobbers for registers that are the result of the
call. This causes ordering problems in the chain building code
depending on which def is seen first. */
- for (i = 0; VEC_iterate (df_ref, collection_rec->def_vec, i, def); ++i)
+ FOR_EACH_VEC_ELT (df_ref, collection_rec->def_vec, i, def)
bitmap_set_bit (&defs_generated, DF_REF_REGNO (def));
/* Record the registers used to pass arguments, and explicitly
unsigned int ix;
df_ref new_ref;
- for (ix = 0; VEC_iterate (df_ref, new_rec, ix, new_ref); ++ix)
+ FOR_EACH_VEC_ELT (df_ref, new_rec, ix, new_ref)
{
if (*old_rec == NULL || !df_ref_equal_p (new_ref, *old_rec))
{
unsigned int ix;
struct df_mw_hardreg *new_reg;
- for (ix = 0; VEC_iterate (df_mw_hardreg_ptr, new_rec, ix, new_reg); ++ix)
+ FOR_EACH_VEC_ELT (df_mw_hardreg_ptr, new_rec, ix, new_reg)
{
if (*old_rec == NULL || !df_mw_equal_p (new_reg, *old_rec))
{
for (i = nc - 1; i >= 0; i--)
{
dom = NULL;
- for (si = 0; VEC_iterate (int, sccs[i], si, a); si++)
+ FOR_EACH_VEC_ELT (int, sccs[i], si, a)
{
bb = VEC_index (basic_block, bbs, a);
FOR_EACH_EDGE (e, ei, bb->preds)
}
gcc_assert (dom != NULL);
- for (si = 0; VEC_iterate (int, sccs[i], si, a); si++)
+ FOR_EACH_VEC_ELT (int, sccs[i], si, a)
{
bb = VEC_index (basic_block, bbs, a);
set_immediate_dominator (CDI_DOMINATORS, bb, dom);
conservatively correct, setting the dominators using the
heuristics in prune_bbs_to_update_dominators could
create cycles in the dominance "tree", and cause ICE. */
- for (i = 0; VEC_iterate (basic_block, bbs, i, bb); i++)
+ FOR_EACH_VEC_ELT (basic_block, bbs, i, bb)
set_immediate_dominator (CDI_DOMINATORS, bb, NULL);
}
/* Construct the graph G. */
map = pointer_map_create ();
- for (i = 0; VEC_iterate (basic_block, bbs, i, bb); i++)
+ FOR_EACH_VEC_ELT (basic_block, bbs, i, bb)
{
/* If the dominance tree is conservatively correct, split it now. */
if (conservative)
g = new_graph (n + 1);
for (y = 0; y < g->n_vertices; y++)
g->vertices[y].data = BITMAP_ALLOC (NULL);
- for (i = 0; VEC_iterate (basic_block, bbs, i, bb); i++)
+ FOR_EACH_VEC_ELT (basic_block, bbs, i, bb)
{
FOR_EACH_EDGE (e, ei, bb->preds)
{
unsigned int i;
group_info_t group;
- for (i = 0; VEC_iterate (group_info_t, rtx_group_vec, i, group); i++)
+ FOR_EACH_VEC_ELT (group_info_t, rtx_group_vec, i, group)
{
/* For all non stack related bases, we only consider a store to
be deletable if there are two or more stores for that
unused. */
current_position = 1;
- for (i = 0; VEC_iterate (group_info_t, rtx_group_vec, i, group); i++)
+ FOR_EACH_VEC_ELT (group_info_t, rtx_group_vec, i, group)
{
bitmap_iterator bi;
unsigned int j;
/* If this insn reads the frame, kill all the frame related stores. */
if (insn_info->frame_read)
{
- for (i = 0; VEC_iterate (group_info_t, rtx_group_vec, i, group); i++)
+ FOR_EACH_VEC_ELT (group_info_t, rtx_group_vec, i, group)
if (group->process_globally && group->frame_related)
{
if (kill)
while (read_info)
{
- for (i = 0; VEC_iterate (group_info_t, rtx_group_vec, i, group); i++)
+ FOR_EACH_VEC_ELT (group_info_t, rtx_group_vec, i, group)
{
if (group->process_globally)
{
unsigned int i;
group_info_t group;
- for (i = 0; VEC_iterate (group_info_t, rtx_group_vec, i, group); i++)
+ FOR_EACH_VEC_ELT (group_info_t, rtx_group_vec, i, group)
{
if (group->process_globally && group->frame_related)
bitmap_ior_into (bb_info->gen, group->group_kill);
group_info_t group;
all_ones = BITMAP_ALLOC (NULL);
- for (j = 0; VEC_iterate (group_info_t, rtx_group_vec, j, group); j++)
+ FOR_EACH_VEC_ELT (group_info_t, rtx_group_vec, j, group)
bitmap_ior_into (all_ones, group->group_kill);
}
if (!bb_info->out)
group_info_t group;
basic_block bb;
- for (i = 0; VEC_iterate (group_info_t, rtx_group_vec, i, group); i++)
+ FOR_EACH_VEC_ELT (group_info_t, rtx_group_vec, i, group)
{
free (group->offset_map_n);
free (group->offset_map_p);
if (! die)
return NULL;
- for (ix = 0; VEC_iterate (dw_attr_node, die->die_attr, ix, a); ix++)
+ FOR_EACH_VEC_ELT (dw_attr_node, die->die_attr, ix, a)
if (a->dw_attr == attr_kind)
return a;
else if (a->dw_attr == DW_AT_specification
if (! die)
return;
- for (ix = 0; VEC_iterate (dw_attr_node, die->die_attr, ix, a); ix++)
+ FOR_EACH_VEC_ELT (dw_attr_node, die->die_attr, ix, a)
if (a->dw_attr == attr_kind)
{
if (AT_class (a) == dw_val_class_str)
fprintf (outfile, "\n");
}
- for (ix = 0; VEC_iterate (dw_attr_node, die->die_attr, ix, a); ix++)
+ FOR_EACH_VEC_ELT (dw_attr_node, die->die_attr, ix, a)
{
print_spaces (outfile);
fprintf (outfile, " %s: ", dwarf_attr_name (a->dw_attr));
CHECKSUM (die->die_tag);
- for (ix = 0; VEC_iterate (dw_attr_node, die->die_attr, ix, a); ix++)
+ FOR_EACH_VEC_ELT (dw_attr_node, die->die_attr, ix, a)
attr_checksum (a, ctx, mark);
FOR_EACH_CHILD (die, c, die_checksum (c, ctx, mark));
dw_attr_ref a;
unsigned ix;
- for (ix = 0; VEC_iterate (dw_attr_node, die->die_attr, ix, a); ix++)
+ FOR_EACH_VEC_ELT (dw_attr_node, die->die_attr, ix, a)
{
switch (a->dw_attr)
{
!= VEC_length (dw_attr_node, die2->die_attr))
return 0;
- for (ix = 0; VEC_iterate (dw_attr_node, die1->die_attr, ix, a1); ix++)
+ FOR_EACH_VEC_ELT (dw_attr_node, die1->die_attr, ix, a1)
if (!same_attr_p (a1, VEC_index (dw_attr_node, die2->die_attr, ix), mark))
return 0;
dw_attr_ref a;
unsigned ix;
- for (ix = 0; VEC_iterate (dw_attr_node, die->die_attr, ix, a); ix++)
+ FOR_EACH_VEC_ELT (dw_attr_node, die->die_attr, ix, a)
if (a->dw_attr == DW_AT_declaration)
return 1;
clone = ggc_alloc_cleared_die_node ();
clone->die_tag = die->die_tag;
- for (ix = 0; VEC_iterate (dw_attr_node, die->die_attr, ix, a); ix++)
+ FOR_EACH_VEC_ELT (dw_attr_node, die->die_attr, ix, a)
add_dwarf_attr (clone, a);
return clone;
clone = ggc_alloc_cleared_die_node ();
clone->die_tag = die->die_tag;
- for (ix = 0; VEC_iterate (dw_attr_node, die->die_attr, ix, a); ix++)
+ FOR_EACH_VEC_ELT (dw_attr_node, die->die_attr, ix, a)
{
/* We don't want to copy over all attributes.
For example we don't want DW_AT_byte_size because otherwise we will no
remove_AT (die, DW_AT_specification);
- for (ix = 0; VEC_iterate (dw_attr_node, decl->die_attr, ix, a); ix++)
+ FOR_EACH_VEC_ELT (dw_attr_node, decl->die_attr, ix, a)
{
if (a->dw_attr != DW_AT_name
&& a->dw_attr != DW_AT_declaration
dw_attr_ref a;
unsigned ix;
- for (ix = 0; VEC_iterate (dw_attr_node, die->die_attr, ix, a); ix++)
+ FOR_EACH_VEC_ELT (dw_attr_node, die->die_attr, ix, a)
{
if (AT_class (a) == dw_val_class_die_ref)
{
dw_attr_ref a;
unsigned ix;
- for (ix = 0; VEC_iterate (dw_attr_node, die->die_attr, ix, a); ix++)
+ FOR_EACH_VEC_ELT (dw_attr_node, die->die_attr, ix, a)
if (AT_class (a) == dw_val_class_loc_list)
output_loc_list (AT_loc_list (a));
/* Scan the DIE references, and mark as external any that refer to
DIEs from other CUs (i.e. those which are not marked). */
- for (ix = 0; VEC_iterate (dw_attr_node, die->die_attr, ix, a); ix++)
+ FOR_EACH_VEC_ELT (dw_attr_node, die->die_attr, ix, a)
if (AT_class (a) == dw_val_class_die_ref
&& AT_ref (a)->die_mark == 0)
{
!= VEC_length (dw_attr_node, die->die_attr))
continue;
- for (ix = 0; VEC_iterate (dw_attr_node, die->die_attr, ix, die_a); ix++)
+ FOR_EACH_VEC_ELT (dw_attr_node, die->die_attr, ix, die_a)
{
abbrev_a = VEC_index (dw_attr_node, abbrev->die_attr, ix);
if ((abbrev_a->dw_attr != die_a->dw_attr)
unsigned ix;
size += size_of_uleb128 (die->die_abbrev);
- for (ix = 0; VEC_iterate (dw_attr_node, die->die_attr, ix, a); ix++)
+ FOR_EACH_VEC_ELT (dw_attr_node, die->die_attr, ix, a)
{
switch (AT_class (a))
{
FOR_EACH_CHILD (die, c, unmark_all_dies (c));
- for (ix = 0; VEC_iterate (dw_attr_node, die->die_attr, ix, a); ix++)
+ FOR_EACH_VEC_ELT (dw_attr_node, die->die_attr, ix, a)
if (AT_class (a) == dw_val_class_die_ref)
unmark_all_dies (AT_ref (a));
}
pubname_ref p;
size = DWARF_PUBNAMES_HEADER_SIZE;
- for (i = 0; VEC_iterate (pubname_entry, names, i, p); i++)
+ FOR_EACH_VEC_ELT (pubname_entry, names, i, p)
if (names != pubtype_table
|| p->die->die_offset != 0
|| !flag_eliminate_unused_debug_types)
(unsigned long)die->die_offset,
dwarf_tag_name (die->die_tag));
- for (ix = 0; VEC_iterate (dw_attr_node, die->die_attr, ix, a); ix++)
+ FOR_EACH_VEC_ELT (dw_attr_node, die->die_attr, ix, a)
{
const char *name = dwarf_attr_name (a->dw_attr);
dw2_asm_output_data (DWARF_OFFSET_SIZE, next_die_offset,
"Compilation Unit Length");
- for (i = 0; VEC_iterate (pubname_entry, names, i, pub); i++)
+ FOR_EACH_VEC_ELT (pubname_entry, names, i, pub)
{
/* We shouldn't see pubnames for DIEs outside of the main CU. */
if (names == pubname_table)
size = 2 + DWARF_OFFSET_SIZE + 1;
/* Each entry: code label + DIE offset. */
- for (i = 0; VEC_iterate (dcall_entry, dcall_table, i, p); i++)
+ FOR_EACH_VEC_ELT (dcall_entry, dcall_table, i, p)
{
gcc_assert (p->targ_die != NULL);
/* Insert a "from" entry when the point-of-call DIE offset changes. */
"Offset of Compilation Unit Info");
dw2_asm_output_data (1, DWARF2_ADDR_SIZE, "Pointer Size (in bytes)");
- for (i = 0; VEC_iterate (dcall_entry, dcall_table, i, p); i++)
+ FOR_EACH_VEC_ELT (dcall_entry, dcall_table, i, p)
{
/* Insert a "from" entry when the point-of-call DIE offset changes. */
if (p->poc_decl != last_poc_decl)
size = 2 + 1;
/* Each entry: code label + vtable slot index. */
- for (i = 0; VEC_iterate (vcall_entry, vcall_table, i, p); i++)
+ FOR_EACH_VEC_ELT (vcall_entry, vcall_table, i, p)
size += DWARF_OFFSET_SIZE + size_of_uleb128 (p->vtable_slot);
return size;
dw2_asm_output_data (2, 4, "Version number");
dw2_asm_output_data (1, DWARF2_ADDR_SIZE, "Pointer Size (in bytes)");
- for (i = 0; VEC_iterate (vcall_entry, vcall_table, i, p); i++)
+ FOR_EACH_VEC_ELT (vcall_entry, vcall_table, i, p)
{
ASM_GENERATE_INTERNAL_LABEL (poc_label, "LPOC", p->poc_label_num);
dw2_asm_output_addr (DWARF_OFFSET_SIZE, poc_label, "Point of call");
min_index = tree_low_cst (TYPE_MIN_VALUE (TYPE_DOMAIN (type)), 0);
memset (array, '\0', size);
- for (cnt = 0;
- VEC_iterate (constructor_elt, CONSTRUCTOR_ELTS (init), cnt, ce);
- cnt++)
+ FOR_EACH_VEC_ELT (constructor_elt, CONSTRUCTOR_ELTS (init), cnt, ce)
{
tree val = ce->value;
tree index = ce->index;
if (TREE_CODE (type) == RECORD_TYPE)
field = TYPE_FIELDS (type);
- for (cnt = 0;
- VEC_iterate (constructor_elt, CONSTRUCTOR_ELTS (init), cnt, ce);
- cnt++, field = field ? DECL_CHAIN (field) : 0)
+ FOR_EACH_VEC_ELT (constructor_elt, CONSTRUCTOR_ELTS (init), cnt, ce)
{
tree val = ce->value;
int pos, fieldsize;
unsigned i;
die_arg_entry *e;
- for (i = 0;
- VEC_iterate (die_arg_entry, tmpl_value_parm_die_table, i, e);
- i++)
+ FOR_EACH_VEC_ELT (die_arg_entry, tmpl_value_parm_die_table, i, e)
tree_add_const_value_attribute (e->die, e->arg);
}
}
dw_attr_ref a;
unsigned ix;
- for (ix = 0; VEC_iterate (dw_attr_node, die->die_attr, ix, a); ix++)
+ FOR_EACH_VEC_ELT (dw_attr_node, die->die_attr, ix, a)
{
if (a->dw_attr_val.val_class == dw_val_class_die_ref)
{
dw_attr_ref a;
unsigned ix;
- for (ix = 0; VEC_iterate (dw_attr_node, die->die_attr, ix, a); ix++)
+ FOR_EACH_VEC_ELT (dw_attr_node, die->die_attr, ix, a)
if (AT_class (a) == dw_val_class_str)
{
struct indirect_string_node *s = a->dw_attr_val.v.val_str;
/* Also set the mark on nodes referenced from the
pubname_table or arange_table. */
- for (i = 0; VEC_iterate (pubname_entry, pubname_table, i, pub); i++)
+ FOR_EACH_VEC_ELT (pubname_entry, pubname_table, i, pub)
prune_unused_types_mark (pub->die, 1);
for (i = 0; i < arange_table_in_use; i++)
prune_unused_types_mark (arange_table[i], 1);
/* Mark nodes referenced from the direct call table. */
- for (i = 0; VEC_iterate (dcall_entry, dcall_table, i, dcall); i++)
+ FOR_EACH_VEC_ELT (dcall_entry, dcall_table, i, dcall)
prune_unused_types_mark (dcall->targ_die, 1);
/* Get rid of nodes that aren't marked; and update the string counts. */
dw_loc_list_ref *curr;
unsigned ix;
- for (ix = 0; VEC_iterate (dw_attr_node, die->die_attr, ix, a); ix++)
+ FOR_EACH_VEC_ELT (dw_attr_node, die->die_attr, ix, a)
switch (AT_class (a))
{
case dw_val_class_loc_list:
/* ??? Decode and interpret the data for flag_debug_asm. */
{
uchar uc;
- for (i = 0; VEC_iterate (uchar, crtl->eh.action_record_data, i, uc); ++i)
+ FOR_EACH_VEC_ELT (uchar, crtl->eh.action_record_data, i, uc)
dw2_asm_output_data (1, uc, i ? NULL : "Action record table");
}
constructor_elt *ce;
unsigned HOST_WIDE_INT idx;
- for (idx = 0;
- VEC_iterate (constructor_elt, CONSTRUCTOR_ELTS (exp), idx, ce);
- idx++)
+ FOR_EACH_VEC_ELT (constructor_elt, CONSTRUCTOR_ELTS (exp), idx, ce)
if ((ce->index != NULL_TREE && !safe_from_p (x, ce->index, 0))
|| !safe_from_p (x, ce->value, 0))
return 0;
+2010-08-20 Nathan Froyd <froydnj@codesourcery.com>
+
+ * trans-openmp.c: Use FOR_EACH_VEC_ELT.
+
2010-08-19 Daniel Kraft <d@domob.eu>
PR fortran/29785
gfc_start_block (&body);
- for (ix = 0; VEC_iterate (dovar_init, inits, ix, di); ix++)
+ FOR_EACH_VEC_ELT (dovar_init, inits, ix, di)
gfc_add_modify (&body, di->var, di->init);
VEC_free (dovar_init, heap, inits);
unsigned i;
tree p;
- for (i = 0; VEC_iterate (tree, *args, i, p); ++i)
+ FOR_EACH_VEC_ELT (tree, *args, i, p)
{
tree type = TREE_TYPE (p);
if (TREE_CODE (type) == COMPLEX_TYPE
assign_parms_initialize_all (&all);
fnargs = assign_parms_augmented_arg_list (&all);
- for (i = 0; VEC_iterate (tree, fnargs, i, parm); ++i)
+ FOR_EACH_VEC_ELT (tree, fnargs, i, parm)
{
struct assign_parm_data_one data;
assign_parms_initialize_all (&all);
fnargs = assign_parms_augmented_arg_list (&all);
- for (i = 0; VEC_iterate (tree, fnargs, i, parm); ++i)
+ FOR_EACH_VEC_ELT (tree, fnargs, i, parm)
{
struct assign_parm_data_one data;
/* Walk over each basic block looking for potentially hoistable
expressions, nothing gets hoisted from the entry block. */
- for (dom_tree_walk_index = 0;
- VEC_iterate (basic_block, dom_tree_walk, dom_tree_walk_index, bb);
- dom_tree_walk_index++)
+ FOR_EACH_VEC_ELT (basic_block, dom_tree_walk, dom_tree_walk_index, bb)
{
domby = get_dominated_to_depth (CDI_DOMINATORS, bb, MAX_HOIST_DEPTH);
/* We've found a potentially hoistable expression, now
we look at every block BB dominates to see if it
computes the expression. */
- for (j = 0; VEC_iterate (basic_block, domby, j, dominated); j++)
+ FOR_EACH_VEC_ELT (basic_block, domby, j, dominated)
{
int max_distance;
/* Walk through occurences of I'th expressions we want
to hoist to BB and make the transformations. */
- for (j = 0;
- VEC_iterate (occr_t, occrs_to_hoist, j, occr);
- j++)
+ FOR_EACH_VEC_ELT (occr_t, occrs_to_hoist, j, occr)
{
rtx insn;
rtx set;
if (strcmp (XSTR (exp, 0), "alternative") == 0)
return false;
- for (i = 0; VEC_iterate (rtx, const_attrs, i, attr); i++)
+ FOR_EACH_VEC_ELT (rtx, const_attrs, i, attr)
if (strcmp (XSTR (attr, 0), XSTR (exp, 0)) == 0)
{
unsigned int j;
rtx resv;
- for (j = 0; VEC_iterate (rtx, reservations, j, resv); j++)
+ FOR_EACH_VEC_ELT (rtx, reservations, j, resv)
if (! check_tune_attr (XSTR (attr, 0), XEXP (resv, 2)))
return false;
return true;
for (i = 0; i < rti->nelt; i++)
(*rti->cb) (*(void **)((char *)rti->base + rti->stride * i));
- for (i = 0; VEC_iterate (const_ggc_root_tab_t, extra_root_vec, i, rtp); i++)
+ FOR_EACH_VEC_ELT (const_ggc_root_tab_t, extra_root_vec, i, rtp)
{
for (rti = rtp; rti->base != NULL; rti++)
for (i = 0; i < rti->nelt; i++)
for (ct = gt_ggc_cache_rtab; *ct; ct++)
ggc_scan_cache_tab (*ct);
- for (i = 0; VEC_iterate (const_ggc_cache_tab_t, extra_cache_vec, i, ctp); i++)
+ FOR_EACH_VEC_ELT (const_ggc_cache_tab_t, extra_cache_vec, i, ctp)
ggc_scan_cache_tab (ctp);
if (! ggc_protect_identifiers)
constructor_elt *ce;
VEC(constructor_elt,gc) *v = CONSTRUCTOR_ELTS (*expr_p);
- for (ix = 0; VEC_iterate (constructor_elt, v, ix, ce); ix++)
+ FOR_EACH_VEC_ELT (constructor_elt, v, ix, ce)
gimplify_init_ctor_preeval (&ce->value, pre_p, post_p, data);
return;
/* Vector types use CONSTRUCTOR all the way through gimple
compilation as a general initializer. */
- for (ix = 0; VEC_iterate (constructor_elt, elts, ix, ce); ix++)
+ FOR_EACH_VEC_ELT (constructor_elt, elts, ix, ce)
{
enum gimplify_status tret;
tret = gimplify_expr (&ce->value, pre_p, post_p, is_gimple_val,
if (fallback == fb_none)
{
unsigned HOST_WIDE_INT ix;
- constructor_elt *ce;
+ tree val;
tree temp = NULL_TREE;
- for (ix = 0;
- VEC_iterate (constructor_elt, CONSTRUCTOR_ELTS (*expr_p),
- ix, ce);
- ix++)
- if (TREE_SIDE_EFFECTS (ce->value))
- append_to_statement_list (ce->value, &temp);
+ FOR_EACH_CONSTRUCTOR_VALUE (CONSTRUCTOR_ELTS (*expr_p), ix, val)
+ if (TREE_SIDE_EFFECTS (val))
+ append_to_statement_list (val, &temp);
*expr_p = temp;
ret = temp ? GS_OK : GS_ALL_DONE;
{
bool res = false;
- for (i = 0; VEC_iterate (lst_p, LST_SEQ (lst), i, l); i++)
+ FOR_EACH_VEC_ELT (lst_p, LST_SEQ (lst), i, l)
res |= lst_do_strip_mine_loop (l, depth);
return res;
|| !LST_LOOP_P (lst))
return false;
- for (i = 0; VEC_iterate (lst_p, LST_SEQ (lst), i, l); i++)
+ FOR_EACH_VEC_ELT (lst_p, LST_SEQ (lst), i, l)
res |= lst_do_strip_mine (l);
depth = lst_depth (lst);
cloog_program_set_nb_scattdims (prog, nbs);
initialize_cloog_names (scop, prog);
- for (i = 0; VEC_iterate (poly_bb_p, SCOP_BBS (scop), i, pbb); i++)
+ FOR_EACH_VEC_ELT (poly_bb_p, SCOP_BBS (scop), i, pbb)
{
CloogStatement *stmt;
CloogBlock *block;
int i;
poly_dr_p pdr;
- for (i = 0; VEC_iterate (poly_dr_p, PBB_DRS (pbb1), i, pdr); i++)
+ FOR_EACH_VEC_ELT (poly_dr_p, PBB_DRS (pbb1), i, pdr)
if (PDR_TYPE (pdr) == PDR_WRITE)
break;
if (reduction_ddr_p (pbb1, pbb2))
return true;
- for (i = 0; VEC_iterate (poly_dr_p, PBB_DRS (pbb1), i, pdr1); i++)
- for (j = 0; VEC_iterate (poly_dr_p, PBB_DRS (pbb2), j, pdr2); j++)
+ FOR_EACH_VEC_ELT (poly_dr_p, PBB_DRS (pbb1), i, pdr1)
+ FOR_EACH_VEC_ELT (poly_dr_p, PBB_DRS (pbb2), j, pdr2)
if (!graphite_legal_transform_dr (pdr1, pdr2))
return false;
timevar_push (TV_GRAPHITE_DATA_DEPS);
- for (i = 0; VEC_iterate (poly_bb_p, SCOP_BBS (scop), i, pbb1); i++)
- for (j = 0; VEC_iterate (poly_bb_p, SCOP_BBS (scop), j, pbb2); j++)
+ FOR_EACH_VEC_ELT (poly_bb_p, SCOP_BBS (scop), i, pbb1)
+ FOR_EACH_VEC_ELT (poly_bb_p, SCOP_BBS (scop), j, pbb2)
if (!graphite_legal_transform_bb (pbb1, pbb2))
{
timevar_pop (TV_GRAPHITE_DATA_DEPS);
timevar_push (TV_GRAPHITE_DATA_DEPS);
- for (i = 0; VEC_iterate (poly_dr_p, PBB_DRS (pbb1), i, pdr1); i++)
- for (j = 0; VEC_iterate (poly_dr_p, PBB_DRS (pbb2), j, pdr2); j++)
+ FOR_EACH_VEC_ELT (poly_dr_p, PBB_DRS (pbb1), i, pdr1)
+ FOR_EACH_VEC_ELT (poly_dr_p, PBB_DRS (pbb2), j, pdr2)
if (graphite_carried_dependence_level_k (pdr1, pdr2, level))
{
timevar_pop (TV_GRAPHITE_DATA_DEPS);
poly_bb_p pbb1, pbb2;
poly_dr_p pdr1, pdr2;
- for (i = 0; VEC_iterate (poly_bb_p, SCOP_BBS (scop), i, pbb1); i++)
- for (j = 0; VEC_iterate (poly_bb_p, SCOP_BBS (scop), j, pbb2); j++)
+ FOR_EACH_VEC_ELT (poly_bb_p, SCOP_BBS (scop), i, pbb1)
+ FOR_EACH_VEC_ELT (poly_bb_p, SCOP_BBS (scop), j, pbb2)
{
- for (k = 0; VEC_iterate (poly_dr_p, PBB_DRS (pbb1), k, pdr1); k++)
- for (l = 0; VEC_iterate (poly_dr_p, PBB_DRS (pbb2), l, pdr2); l++)
+ FOR_EACH_VEC_ELT (poly_dr_p, PBB_DRS (pbb1), k, pdr1)
+ FOR_EACH_VEC_ELT (poly_dr_p, PBB_DRS (pbb2), l, pdr2)
if (!pddr_is_empty (dependence_polyhedron (pdr1, pdr2, 1, true)))
{
fprintf (file, "OS%d -> OS%d\n",
poly_bb_p pbb1, pbb2;
poly_dr_p pdr1, pdr2;
- for (i = 0; VEC_iterate (poly_bb_p, SCOP_BBS (scop), i, pbb1); i++)
- for (j = 0; VEC_iterate (poly_bb_p, SCOP_BBS (scop), j, pbb2); j++)
+ FOR_EACH_VEC_ELT (poly_bb_p, SCOP_BBS (scop), i, pbb1)
+ FOR_EACH_VEC_ELT (poly_bb_p, SCOP_BBS (scop), j, pbb2)
{
- for (k = 0; VEC_iterate (poly_dr_p, PBB_DRS (pbb1), k, pdr1); k++)
- for (l = 0; VEC_iterate (poly_dr_p, PBB_DRS (pbb2), l, pdr2); l++)
+ FOR_EACH_VEC_ELT (poly_dr_p, PBB_DRS (pbb1), k, pdr1)
+ FOR_EACH_VEC_ELT (poly_dr_p, PBB_DRS (pbb2), l, pdr2)
{
poly_ddr_p pddr = dependence_polyhedron (pdr1, pdr2, 1, false);
poly_bb_p pbb1, pbb2;
poly_dr_p pdr1, pdr2;
- for (i = 0; VEC_iterate (poly_bb_p, SCOP_BBS (scop), i, pbb1); i++)
- for (j = 0; VEC_iterate (poly_bb_p, SCOP_BBS (scop), j, pbb2); j++)
- for (k = 0; VEC_iterate (poly_dr_p, PBB_DRS (pbb1), k, pdr1); k++)
- for (l = 0; VEC_iterate (poly_dr_p, PBB_DRS (pbb2), l, pdr2); l++)
+ FOR_EACH_VEC_ELT (poly_bb_p, SCOP_BBS (scop), i, pbb1)
+ FOR_EACH_VEC_ELT (poly_bb_p, SCOP_BBS (scop), j, pbb2)
+ FOR_EACH_VEC_ELT (poly_dr_p, PBB_DRS (pbb1), k, pdr1)
+ FOR_EACH_VEC_ELT (poly_dr_p, PBB_DRS (pbb2), l, pdr2)
if (!pddr_is_empty (dependence_polyhedron (pdr1, pdr2, 1, true)))
fprintf (file, "OS%d_D%d -> OS%d_D%d\n",
pbb_index (pbb1), PDR_ID (pdr1),
poly_bb_p pbb1, pbb2;
poly_dr_p pdr1, pdr2;
- for (i = 0; VEC_iterate (poly_bb_p, SCOP_BBS (scop), i, pbb1); i++)
- for (j = 0; VEC_iterate (poly_bb_p, SCOP_BBS (scop), j, pbb2); j++)
- for (k = 0; VEC_iterate (poly_dr_p, PBB_DRS (pbb1), k, pdr1); k++)
- for (l = 0; VEC_iterate (poly_dr_p, PBB_DRS (pbb2), l, pdr2); l++)
+ FOR_EACH_VEC_ELT (poly_bb_p, SCOP_BBS (scop), i, pbb1)
+ FOR_EACH_VEC_ELT (poly_bb_p, SCOP_BBS (scop), j, pbb2)
+ FOR_EACH_VEC_ELT (poly_dr_p, PBB_DRS (pbb1), k, pdr1)
+ FOR_EACH_VEC_ELT (poly_dr_p, PBB_DRS (pbb2), l, pdr2)
{
poly_ddr_p pddr = dependence_polyhedron (pdr1, pdr2, 1, false);
mpz_init (s);
mpz_init (n);
- for (j = 0; VEC_iterate (lst_p, LST_SEQ (loop), j, l); j++)
+ FOR_EACH_VEC_ELT (lst_p, LST_SEQ (loop), j, l)
if (LST_LOOP_P (l))
memory_strides_in_loop_1 (l, depth, strides);
else
- for (i = 0; VEC_iterate (poly_dr_p, PBB_DRS (LST_PBB (l)), i, pdr); i++)
+ FOR_EACH_VEC_ELT (poly_dr_p, PBB_DRS (LST_PBB (l)), i, pdr)
{
pdr_stride_in_loop (s, depth, pdr);
mpz_set_si (n, PDR_NB_REFS (pdr));
int i;
lst_p l;
- for (i = 0; VEC_iterate (lst_p, LST_SEQ (lst), i, l); i++)
+ FOR_EACH_VEC_ELT (lst_p, LST_SEQ (lst), i, l)
lst_apply_interchange (l, depth1, depth2);
}
else
loop1 = VEC_index (lst_p, LST_SEQ (outer_father), outer);
- for (inner = 0; VEC_iterate (lst_p, LST_SEQ (inner_father), inner, loop2); inner++)
+ FOR_EACH_VEC_ELT (lst_p, LST_SEQ (inner_father), inner, loop2)
if (LST_LOOP_P (loop2)
&& (lst_try_interchange_loops (scop, loop1, loop2)
|| lst_interchange_select_inner (scop, outer_father, outer, loop2)))
}
if (LST_LOOP_P (loop))
- for (i = 0; VEC_iterate (lst_p, LST_SEQ (loop), i, l); i++)
+ FOR_EACH_VEC_ELT (lst_p, LST_SEQ (loop), i, l)
if (LST_LOOP_P (l))
res |= lst_interchange_select_outer (scop, l, i);
poly_bb_p pbb;
int max_nb_loops = 0;
- for (i = 0; VEC_iterate (poly_bb_p, SCOP_BBS (scop), i, pbb); i++)
+ FOR_EACH_VEC_ELT (poly_bb_p, SCOP_BBS (scop), i, pbb)
{
int nb_loops = pbb_dim_iter_domain (pbb);
if (max_nb_loops < nb_loops)
poly_bb_p pbb;
graphite_dim_t max_scattering = 0;
- for (i = 0; VEC_iterate (poly_bb_p, SCOP_BBS (scop), i, pbb); i++)
+ FOR_EACH_VEC_ELT (poly_bb_p, SCOP_BBS (scop), i, pbb)
max_scattering = MAX (pbb_nb_scattering_transform (pbb), max_scattering);
- for (i = 0; VEC_iterate (poly_bb_p, SCOP_BBS (scop), i, pbb); i++)
+ FOR_EACH_VEC_ELT (poly_bb_p, SCOP_BBS (scop), i, pbb)
extend_scattering (pbb, max_scattering);
return max_scattering;
int i;
poly_bb_p pbb;
- for (i = 0; VEC_iterate (poly_bb_p, SCOP_BBS (scop), i, pbb); i++)
+ FOR_EACH_VEC_ELT (poly_bb_p, SCOP_BBS (scop), i, pbb)
print_scattering_function (file, pbb, verbosity);
}
int i;
poly_bb_p pbb;
- for (i = 0; VEC_iterate (poly_bb_p, SCOP_BBS (scop), i, pbb); i++)
+ FOR_EACH_VEC_ELT (poly_bb_p, SCOP_BBS (scop), i, pbb)
print_iteration_domain (file, pbb, verbosity);
}
unsigned n = VEC_length (poly_dr_p, PBB_DRS (pbb));
VEC (poly_dr_p, heap) *collapsed = VEC_alloc (poly_dr_p, heap, n);
- for (i = 0; VEC_iterate (poly_dr_p, PBB_DRS (pbb), i, pdr1); i++)
- for (j = 0; VEC_iterate (poly_dr_p, collapsed, j, pdr2); j++)
+ FOR_EACH_VEC_ELT (poly_dr_p, PBB_DRS (pbb), i, pdr1)
+ FOR_EACH_VEC_ELT (poly_dr_p, collapsed, j, pdr2)
if (!can_collapse_pdrs (pdr1, pdr2))
VEC_quick_push (poly_dr_p, collapsed, pdr1);
poly_scattering_free (PBB_ORIGINAL (pbb));
if (PBB_DRS (pbb))
- for (i = 0; VEC_iterate (poly_dr_p, PBB_DRS (pbb), i, pdr); i++)
+ FOR_EACH_VEC_ELT (poly_dr_p, PBB_DRS (pbb), i, pdr)
free_poly_dr (pdr);
VEC_free (poly_dr_p, heap, PBB_DRS (pbb));
int i;
poly_bb_p pbb;
- for (i = 0; VEC_iterate (poly_bb_p, SCOP_BBS (scop), i, pbb); i++)
+ FOR_EACH_VEC_ELT (poly_bb_p, SCOP_BBS (scop), i, pbb)
free_poly_bb (pbb);
VEC_free (poly_bb_p, heap, SCOP_BBS (scop));
fprintf (file, "# cases bb_%d (\n", GBB_BB (gbb)->index);
- for (i = 0; VEC_iterate (gimple, cases, i, stmt); i++)
+ FOR_EACH_VEC_ELT (gimple, cases, i, stmt)
{
fprintf (file, "# ");
print_gimple_stmt (file, stmt, 0, 0);
fprintf (file, "# conditions bb_%d (\n", GBB_BB (gbb)->index);
- for (i = 0; VEC_iterate (gimple, conditions, i, stmt); i++)
+ FOR_EACH_VEC_ELT (gimple, conditions, i, stmt)
{
fprintf (file, "# ");
print_gimple_stmt (file, stmt, 0, 0);
fprintf (file, "# Access informations are provided\n");
fprintf (file, "1\n");
- for (i = 0; VEC_iterate (poly_dr_p, PBB_DRS (pbb), i, pdr); i++)
+ FOR_EACH_VEC_ELT (poly_dr_p, PBB_DRS (pbb), i, pdr)
if (PDR_TYPE (pdr) == PDR_READ)
nb_reads++;
else
fprintf (file, "# Read access informations\n");
fprintf (file, "%d\n", nb_reads);
- for (i = 0; VEC_iterate (poly_dr_p, PBB_DRS (pbb), i, pdr); i++)
+ FOR_EACH_VEC_ELT (poly_dr_p, PBB_DRS (pbb), i, pdr)
if (PDR_TYPE (pdr) == PDR_READ)
print_pdr (file, pdr, verbosity);
fprintf (file, "# Write access informations\n");
fprintf (file, "%d\n", nb_writes);
- for (i = 0; VEC_iterate (poly_dr_p, PBB_DRS (pbb), i, pdr); i++)
+ FOR_EACH_VEC_ELT (poly_dr_p, PBB_DRS (pbb), i, pdr)
if (PDR_TYPE (pdr) != PDR_READ)
print_pdr (file, pdr, verbosity);
fprintf (file, "0\n");
}
- for (i = 0; VEC_iterate (tree, SESE_PARAMS (SCOP_REGION (scop)), i, t); i++)
+ FOR_EACH_VEC_ELT (tree, SESE_PARAMS (SCOP_REGION (scop)), i, t)
{
print_generic_expr (file, t, 0);
fprintf (file, " ");
fprintf (file, "%d\n",VEC_length (poly_bb_p, SCOP_BBS (scop)));
- for (i = 0; VEC_iterate (poly_bb_p, SCOP_BBS (scop), i, pbb); i++)
+ FOR_EACH_VEC_ELT (poly_bb_p, SCOP_BBS (scop), i, pbb)
print_pbb (file, pbb, verbosity);
if (verbosity > 1)
fprintf (file, "%d\n", VEC_length (poly_bb_p, SCOP_BBS (scop)));
- for (i = 0; VEC_iterate (poly_bb_p, SCOP_BBS (scop), i, pbb); i++)
+ FOR_EACH_VEC_ELT (poly_bb_p, SCOP_BBS (scop), i, pbb)
{
if (verbosity > 1)
fprintf (file, "# pbb_%d (\n", pbb_index (pbb));
fprintf (file, "%d\n", VEC_length (poly_bb_p, SCOP_BBS (scop)));
unify_scattering_dimensions (scop);
- for (i = 0; VEC_iterate (poly_bb_p, SCOP_BBS (scop), i, pbb); i++)
+ FOR_EACH_VEC_ELT (poly_bb_p, SCOP_BBS (scop), i, pbb)
{
if (!PBB_TRANSFORMED (pbb)
|| !(PBB_TRANSFORMED_SCATTERING (pbb)
else
fprintf (file, "#(root");
- for (i = 0; VEC_iterate (lst_p, LST_SEQ (lst), i, l); i++)
+ FOR_EACH_VEC_ELT (lst_p, LST_SEQ (lst), i, l)
print_lst (file, l, indent + 2);
fprintf (file, ")");
lst_depth (lst),
lst_dewey_number (lst));
- for (i = 0; VEC_iterate (lst_p, LST_SEQ (lst), i, l); i++)
+ FOR_EACH_VEC_ELT (lst_p, LST_SEQ (lst), i, l)
dot_lst_1 (file, l);
}
sd_region *s;
int i;
- for (i = 0; VEC_iterate (sd_region, *source, i, s); i++)
+ FOR_EACH_VEC_ELT (sd_region, *source, i, s)
VEC_safe_push (sd_region, heap, *target, s);
VEC_free (sd_region, heap, *source);
graphite_find_data_references_in_stmt (outermost_loop, stmt, &drs);
- for (j = 0; VEC_iterate (data_reference_p, drs, j, dr); j++)
+ FOR_EACH_VEC_ELT (data_reference_p, drs, j, dr)
for (i = 0; i < DR_NUM_DIMENSIONS (dr); i++)
if (!graphite_can_represent_scev (DR_ACCESS_FN (dr, i), loop))
{
- The exit destinations are dominated by another bb inside
the loop.
- The loop dominates bbs, that are not exit destinations. */
- for (i = 0; VEC_iterate (edge, exits, i, e); i++)
+ FOR_EACH_VEC_ELT (edge, exits, i, e)
if (e->src->loop_father == loop
&& dominated_by_p (CDI_DOMINATORS, e->dest, e->src))
{
/* First check the successors of BB, and check if it is
possible to join the different branches. */
- for (i = 0; VEC_iterate (edge, bb->succs, i, e); i++)
+ FOR_EACH_VEC_ELT (edge, bb->succs, i, e)
{
/* Ignore loop exits. They will be handled after the loop
body. */
/* Scan remaining bbs dominated by BB. */
dominated = get_dominated_by (CDI_DOMINATORS, bb);
- for (i = 0; VEC_iterate (basic_block, dominated, i, dom_bb); i++)
+ FOR_EACH_VEC_ELT (basic_block, dominated, i, dom_bb)
{
/* Ignore loop exits: they will be handled after the loop body. */
if (loop_depth (find_common_loop (loop, dom_bb->loop_father))
edge e;
edge_iterator ei;
- for (i = 0; VEC_iterate (sd_region, regions, i, s); i++)
+ FOR_EACH_VEC_ELT (sd_region, regions, i, s)
FOR_EACH_EDGE (e, ei, s->exit->preds)
e->aux = NULL;
}
edge e;
edge_iterator ei;
- for (i = 0; VEC_iterate (sd_region, regions, i, s); i++)
+ FOR_EACH_VEC_ELT (sd_region, regions, i, s)
FOR_EACH_EDGE (e, ei, s->exit->preds)
if (bb_in_sd_region (e->src, s))
e->aux = s;
int i;
sd_region *s;
- for (i = 0; VEC_iterate (sd_region, regions, i, s); i++)
+ FOR_EACH_VEC_ELT (sd_region, regions, i, s)
create_single_entry_edge (s);
mark_exit_edges (regions);
- for (i = 0; VEC_iterate (sd_region, regions, i, s); i++)
+ FOR_EACH_VEC_ELT (sd_region, regions, i, s)
/* Don't handle multiple edges exiting the function. */
if (!find_single_exit_edge (s)
&& s->exit != EXIT_BLOCK_PTR)
int i;
sd_region *s;
- for (i = 0; VEC_iterate (sd_region, regions, i, s); i++)
+ FOR_EACH_VEC_ELT (sd_region, regions, i, s)
{
edge entry = find_single_entry_edge (s);
edge exit = find_single_exit_edge (s);
int j;
sd_region *s2;
- for (j = 0; VEC_iterate (sd_region, regions, j, s2); j++)
+ FOR_EACH_VEC_ELT (sd_region, regions, j, s2)
if (s != s2)
gcc_assert (!bb_in_sd_region (s->entry, s2));
}
int i;
scop_p scop;
- for (i = 0; VEC_iterate (scop_p, scops, i, scop); i++)
+ FOR_EACH_VEC_ELT (scop_p, scops, i, scop)
print_graphite_scop_statistics (file, scop);
}
int i;
scop_p scop;
- for (i = 0; VEC_iterate (scop_p, *scops, i, scop); i++)
+ FOR_EACH_VEC_ELT (scop_p, *scops, i, scop)
{
int j;
loop_p loop;
sese region = SCOP_REGION (scop);
build_sese_loop_nests (region);
- for (j = 0; VEC_iterate (loop_p, SESE_LOOP_NEST (region), j, loop); j++)
+ FOR_EACH_VEC_ELT (loop_p, SESE_LOOP_NEST (region), j, loop)
if (!loop_in_sese_p (loop_outer (loop), region)
&& single_exit (loop))
{
fprintf (file, "CELLSPACING=\"0\">\n");
/* Select color for SCoP. */
- for (i = 0; VEC_iterate (scop_p, scops, i, scop); i++)
+ FOR_EACH_VEC_ELT (scop_p, scops, i, scop)
{
sese region = SCOP_REGION (scop);
if (bb_in_sese_p (bb, region)
unsigned int i;
struct data_reference *dr;
- for (i = 0; VEC_iterate (data_reference_p, datarefs, i, dr); i++)
+ FOR_EACH_VEC_ELT (data_reference_p, datarefs, i, dr)
if (dr->aux)
{
base_alias_pair *bap = (base_alias_pair *)(dr->aux);
int i;
poly_bb_p pbb;
- for (i = 0; VEC_iterate (poly_bb_p, SCOP_BBS (scop), i, pbb); i++)
+ FOR_EACH_VEC_ELT (poly_bb_p, SCOP_BBS (scop), i, pbb)
free_gimple_bb (PBB_BLACK_BOX (pbb));
}
int i;
scop_p scop;
- for (i = 0; VEC_iterate (scop_p, scops, i, scop); i++)
+ FOR_EACH_VEC_ELT (scop_p, scops, i, scop)
{
remove_gbbs_in_scop (scop);
free_sese (SCOP_REGION (scop));
int i;
basic_block dom_bb;
- for (i = 0; VEC_iterate (basic_block, dom, i, dom_bb); i++)
+ FOR_EACH_VEC_ELT (basic_block, dom, i, dom_bb)
if (all_non_dominated_preds_marked_p (dom_bb, visited))
{
build_scop_bbs_1 (scop, visited, dom_bb, reductions);
ppl_assign_Coefficient_from_mpz_t (c, v);
ppl_Linear_Expression_add_to_coefficient (static_schedule, 0, c);
- for (i = 0; VEC_iterate (poly_bb_p, SCOP_BBS (scop), i, pbb); i++)
+ FOR_EACH_VEC_ELT (poly_bb_p, SCOP_BBS (scop), i, pbb)
{
gimple_bb_p gbb = PBB_BLACK_BOX (pbb);
ppl_Linear_Expression_t common;
gcc_assert (TREE_CODE (name) == SSA_NAME);
- for (i = 0; VEC_iterate (tree, SESE_PARAMS (region), i, p); i++)
+ FOR_EACH_VEC_ELT (tree, SESE_PARAMS (region), i, p)
if (p == name)
return i;
mpz_set_si (one, 1);
/* Find parameters in the access functions of data references. */
- for (i = 0; VEC_iterate (data_reference_p, GBB_DATA_REFS (gbb), i, dr); i++)
+ FOR_EACH_VEC_ELT (data_reference_p, GBB_DATA_REFS (gbb), i, dr)
for (j = 0; j < DR_NUM_DIMENSIONS (dr); j++)
scan_tree_for_params (region, DR_ACCESS_FN (dr, j), NULL, one);
/* Find parameters in conditional statements. */
- for (i = 0; VEC_iterate (gimple, GBB_CONDITIONS (gbb), i, stmt); i++)
+ FOR_EACH_VEC_ELT (gimple, GBB_CONDITIONS (gbb), i, stmt)
{
tree lhs = scalar_evolution_in_region (region, loop,
gimple_cond_lhs (stmt));
mpz_set_si (one, 1);
/* Find the parameters used in the loop bounds. */
- for (i = 0; VEC_iterate (loop_p, SESE_LOOP_NEST (region), i, loop); i++)
+ FOR_EACH_VEC_ELT (loop_p, SESE_LOOP_NEST (region), i, loop)
{
tree nb_iters = number_of_latch_executions (loop);
mpz_clear (one);
/* Find the parameters used in data accesses. */
- for (i = 0; VEC_iterate (poly_bb_p, SCOP_BBS (scop), i, pbb); i++)
+ FOR_EACH_VEC_ELT (poly_bb_p, SCOP_BBS (scop), i, pbb)
find_params_in_bb (region, PBB_BLACK_BOX (pbb));
scop_set_nb_params (scop, sese_nb_params (region));
if (VEC_empty (gimple, GBB_CONDITIONS (gbb)))
return;
- for (i = 0; VEC_iterate (gimple, GBB_CONDITIONS (gbb), i, stmt); i++)
+ FOR_EACH_VEC_ELT (gimple, GBB_CONDITIONS (gbb), i, stmt)
switch (gimple_code (stmt))
{
case GIMPLE_COND:
int i;
poly_bb_p pbb;
- for (i = 0; VEC_iterate (poly_bb_p, SCOP_BBS (scop), i, pbb); i++)
+ FOR_EACH_VEC_ELT (poly_bb_p, SCOP_BBS (scop), i, pbb)
add_conditions_to_domain (pbb);
}
ppl_new_C_Polyhedron_from_space_dimension (&ph, scop_nb_params (scop), 0);
- for (i = 0; VEC_iterate (loop_p, SESE_LOOP_NEST (region), i, loop); i++)
+ FOR_EACH_VEC_ELT (loop_p, SESE_LOOP_NEST (region), i, loop)
if (!loop_in_sese_p (loop_outer (loop), region))
build_loop_iteration_domains (scop, loop, ph, 0, domains);
- for (i = 0; VEC_iterate (poly_bb_p, SCOP_BBS (scop), i, pbb); i++)
+ FOR_EACH_VEC_ELT (poly_bb_p, SCOP_BBS (scop), i, pbb)
if (domains[gbb_loop (PBB_BLACK_BOX (pbb))->num])
ppl_new_Pointset_Powerset_C_Polyhedron_from_Pointset_Powerset_C_Polyhedron
(&PBB_DOMAIN (pbb), (ppl_const_Pointset_Powerset_C_Polyhedron_t)
if (num_vertex == 0)
return true;
- for (i = 0; VEC_iterate (data_reference_p, drs, i, dr1); i++)
+ FOR_EACH_VEC_ELT (data_reference_p, drs, i, dr1)
for (j = i + 1; VEC_iterate (data_reference_p, drs, j, dr2); j++)
if (dr_may_alias_p (dr1, dr2))
edge_num++;
fprintf (file, "p edge %d %d\n", num_vertex, edge_num);
- for (i = 0; VEC_iterate (data_reference_p, drs, i, dr1); i++)
+ FOR_EACH_VEC_ELT (data_reference_p, drs, i, dr1)
for (j = i + 1; VEC_iterate (data_reference_p, drs, j, dr2); j++)
if (dr_may_alias_p (dr1, dr2))
fprintf (file, "e %d %d\n", i + 1, j + 1);
fprintf (file, "c %s\n", comment);
/* First print all the vertices. */
- for (i = 0; VEC_iterate (data_reference_p, drs, i, dr1); i++)
+ FOR_EACH_VEC_ELT (data_reference_p, drs, i, dr1)
fprintf (file, "n%d;\n", i);
- for (i = 0; VEC_iterate (data_reference_p, drs, i, dr1); i++)
+ FOR_EACH_VEC_ELT (data_reference_p, drs, i, dr1)
for (j = i + 1; VEC_iterate (data_reference_p, drs, j, dr2); j++)
if (dr_may_alias_p (dr1, dr2))
fprintf (file, "n%d n%d\n", i, j);
if (comment)
fprintf (file, "c %s\n", comment);
- for (i = 0; VEC_iterate (data_reference_p, drs, i, dr1); i++)
+ FOR_EACH_VEC_ELT (data_reference_p, drs, i, dr1)
for (j = i + 1; VEC_iterate (data_reference_p, drs, j, dr2); j++)
if (dr_may_alias_p (dr1, dr2))
fprintf (file, "%d %d\n", i, j);
int this_component_is_clique;
int all_components_are_cliques = 1;
- for (i = 0; VEC_iterate (data_reference_p, drs, i, dr1); i++)
+ FOR_EACH_VEC_ELT (data_reference_p, drs, i, dr1)
for (j = i+1; VEC_iterate (data_reference_p, drs, j, dr2); j++)
if (dr_may_alias_p (dr1, dr2))
{
int i, j;
int *queue;
- for (i = 0; VEC_iterate (data_reference_p, drs, i, dr1); i++)
+ FOR_EACH_VEC_ELT (data_reference_p, drs, i, dr1)
for (j = i + 1; VEC_iterate (data_reference_p, drs, j, dr2); j++)
if (dr_same_base_object_p (dr1, dr2))
{
data_reference_p dr;
VEC (data_reference_p, heap) *gbb_drs = GBB_DATA_REFS (PBB_BLACK_BOX (pbb));
- for (j = 0; VEC_iterate (data_reference_p, gbb_drs, j, dr); j++)
+ FOR_EACH_VEC_ELT (data_reference_p, gbb_drs, j, dr)
build_poly_dr (dr, pbb);
}
data_reference_p dr;
VEC (data_reference_p, heap) *drs = VEC_alloc (data_reference_p, heap, 3);
- for (i = 0; VEC_iterate (poly_bb_p, SCOP_BBS (scop), i, pbb); i++)
+ FOR_EACH_VEC_ELT (poly_bb_p, SCOP_BBS (scop), i, pbb)
for (j = 0; VEC_iterate (data_reference_p,
GBB_DATA_REFS (PBB_BLACK_BOX (pbb)), j, dr); j++)
VEC_safe_push (data_reference_p, heap, drs, dr);
- for (i = 0; VEC_iterate (data_reference_p, drs, i, dr); i++)
+ FOR_EACH_VEC_ELT (data_reference_p, drs, i, dr)
dr->aux = XNEW (base_alias_pair);
if (!build_alias_set_optimal_p (drs))
VEC_free (data_reference_p, heap, drs);
- for (i = 0; VEC_iterate (poly_bb_p, SCOP_BBS (scop), i, pbb); i++)
+ FOR_EACH_VEC_ELT (poly_bb_p, SCOP_BBS (scop), i, pbb)
build_pbb_drs (pbb);
}
poly_bb_p pbb;
int res = 0;
- for (i = 0; VEC_iterate (poly_bb_p, SCOP_BBS (scop), i, pbb); i++)
+ FOR_EACH_VEC_ELT (poly_bb_p, SCOP_BBS (scop), i, pbb)
if (loop_in_sese_p (gbb_loop (PBB_BLACK_BOX (pbb)), SCOP_REGION (scop)))
res++;
}
}
- for (i = 0; VEC_iterate (gimple, update, i, stmt); i++)
+ FOR_EACH_VEC_ELT (gimple, update, i, stmt)
update_stmt (stmt);
VEC_free (gimple, heap, update);
gimple loop_phi;
tree red = NULL_TREE;
- for (i = 0; VEC_iterate (gimple, in, i, loop_phi); i++)
+ FOR_EACH_VEC_ELT (gimple, in, i, loop_phi)
{
gimple close_phi = VEC_index (gimple, out, i);
scop_p scop;
- for (i = 0; VEC_iterate (scop_p, scops, i, scop); i++)
+ FOR_EACH_VEC_ELT (scop_p, scops, i, scop)
print_graphite_scop_statistics (file, scop);
}
reductions = sbitmap_alloc (last_basic_block * 2);
sbitmap_zero (reductions);
- for (i = 0; VEC_iterate (scop_p, scops, i, scop); i++)
+ FOR_EACH_VEC_ELT (scop_p, scops, i, scop)
if (dbg_cnt (graphite_scop))
rewrite_commutative_reductions_out_of_ssa (SCOP_REGION (scop),
reductions);
- for (i = 0; VEC_iterate (scop_p, scops, i, scop); i++)
+ FOR_EACH_VEC_ELT (scop_p, scops, i, scop)
if (dbg_cnt (graphite_scop))
{
rewrite_reductions_out_of_ssa (scop);
sbitmap_free (reductions);
- for (i = 0; VEC_iterate (scop_p, scops, i, scop); i++)
+ FOR_EACH_VEC_ELT (scop_p, scops, i, scop)
if (dbg_cnt (graphite_scop))
build_poly_scop (scop);
- for (i = 0; VEC_iterate (scop_p, scops, i, scop); i++)
+ FOR_EACH_VEC_ELT (scop_p, scops, i, scop)
if (POLY_SCOP_P (scop)
&& apply_poly_transforms (scop)
&& gloog (scop, bb_pbb_mapping))
int i;
rtx insn;
- for (i = 0; VEC_iterate (rtx, roots, i, insn); i++)
+ FOR_EACH_VEC_ELT (rtx, roots, i, insn)
priority (insn);
}
unsigned i;
basic_block x;
- for (i = 0; VEC_iterate (basic_block, bbs, i, x); i++)
+ FOR_EACH_VEC_ELT (basic_block, bbs, i, x)
init_bb (x);
}
unsigned i;
basic_block x;
- for (i = 0; VEC_iterate (basic_block, bbs, i, x); i++)
+ FOR_EACH_VEC_ELT (basic_block, bbs, i, x)
init_insns_in_bb (x);
}
unsigned i;
rtx x;
- for (i = 0; VEC_iterate (rtx, insns, i, x); i++)
+ FOR_EACH_VEC_ELT (rtx, insns, i, x)
init_insn (x);
}
haifa_insn_data_t data;
struct reg_use_data *use, *next;
- for (i = 0; VEC_iterate (haifa_insn_data_def, h_i_d, i, data); i++)
+ FOR_EACH_VEC_ELT (haifa_insn_data_def, h_i_d, i, data)
{
if (data->reg_pressure != NULL)
free (data->reg_pressure);
source register does not change after the assignment. Also count
the number of registers set in only one of the blocks. */
c = 0;
- for (i = 0; VEC_iterate (int, then_regs, i, reg); i++)
+ FOR_EACH_VEC_ELT (int, then_regs, i, reg)
{
if (!then_vals[reg] && !else_vals[reg])
continue;
}
/* Finish off c for MAX_CONDITIONAL_EXECUTE. */
- for (i = 0; VEC_iterate (int, else_regs, i, reg); ++i)
+ FOR_EACH_VEC_ELT (int, else_regs, i, reg)
if (!then_vals[reg])
++c;
in this vector. */
vec = VEC_alloc (rtx, heap, 8);
- for (defs_ix = 0; VEC_iterate (rtx, defs_list, defs_ix, def_insn); defs_ix++)
+ FOR_EACH_VEC_ELT (rtx, defs_list, defs_ix, def_insn)
{
merge_code = get_insn_status (def_insn);
gcc_assert (merge_code == MERGE_NOT_ATTEMPTED);
if (merge_successful)
{
- for (i = 0; VEC_iterate (rtx, copies_list, i, def_insn); i++)
+ FOR_EACH_VEC_ELT (rtx, copies_list, i, def_insn)
{
if (transform_ifelse (def_insn))
{
if (dump_file)
fprintf (dump_file, "All merges were successful ....\n");
- for (i = 0; VEC_iterate (rtx, vec, i, def_insn); i++)
+ FOR_EACH_VEC_ELT (rtx, vec, i, def_insn)
{
set_insn_status (def_insn, MERGE_SUCCESS);
}
if (dump_file)
{
- for (i = 0; VEC_iterate (rtx, vec, i, def_insn); i++)
+ FOR_EACH_VEC_ELT (rtx, vec, i, def_insn)
{
fprintf (dump_file, " Ummergable definitions : \n");
print_rtl_single (dump_file, def_insn);
zeinsn_list = find_removable_zero_extends ();
- for (ix = 0; VEC_iterate (rtx, zeinsn_list, ix, curr_insn); ix++)
+ FOR_EACH_VEC_ELT (rtx, zeinsn_list, ix, curr_insn)
{
num_ze_opportunities++;
/* Try to combine the zero-extends with the definition here. */
}
/* Delete all useless zero extensions here in one sweep. */
- for (ix = 0; VEC_iterate (rtx, zeinsn_del_list, ix, curr_insn); ix++)
+ FOR_EACH_VEC_ELT (rtx, zeinsn_del_list, ix, curr_insn)
delete_insn (curr_insn);
free (is_insn_merge_attempted);
int i;
struct ipa_edge_args *args;
- for (i = 0;
- VEC_iterate (ipa_edge_args_t, ipa_edge_args_vector, i, args);
- i++)
+ FOR_EACH_VEC_ELT (ipa_edge_args_t, ipa_edge_args_vector, i, args)
ipa_free_edge_args_substructures (args);
VEC_free (ipa_edge_args_t, gc, ipa_edge_args_vector);
int i;
struct ipa_node_params *info;
- for (i = 0;
- VEC_iterate (ipa_node_params_t, ipa_node_params_vector, i, info);
- i++)
+ FOR_EACH_VEC_ELT (ipa_node_params_t, ipa_node_params_vector, i, info)
ipa_free_node_params_substructures (info);
VEC_free (ipa_node_params_t, heap, ipa_node_params_vector);
unsigned i;
tree var;
- for (i = 0; VEC_iterate (tree, n_var->new_vars, i, var); i++)
+ FOR_EACH_VEC_ELT (tree, n_var->new_vars, i, var)
finalize_var_creation (var);
return 1;
}
tree n_var;
unsigned i;
- for (i = 0; VEC_iterate (tree, var->new_vars, i, n_var); i++)
+ FOR_EACH_VEC_ELT (tree, var->new_vars, i, n_var)
{
tree type = strip_type(get_type_of_var (n_var));
gcc_assert (type);
alloc_site_t *call;
unsigned i;
- for (i = 0; VEC_iterate (alloc_site_t, fallocs->allocs, i, call); i++)
+ FOR_EACH_VEC_ELT (alloc_site_t, fallocs->allocs, i, call)
if (call->stmt == stmt
|| get_final_alloc_stmt (call->stmt) == stmt)
return true;
type = TYPE_MAIN_VARIANT (type);
- for (i = 0; VEC_iterate (structure, structures, i, str); i++)
+ FOR_EACH_VEC_ELT (structure, structures, i, str)
if (is_equal_types (str->decl, type))
return i;
arg = integer_zerop (arg0) ? arg1 : arg0;
pos = integer_zerop (arg0) ? 1 : 0;
- for (i = 0; VEC_iterate (tree, str->new_types, i, type); i++)
+ FOR_EACH_VEC_ELT (tree, str->new_types, i, type)
{
tree new_arg;
gimple_set_vdef (new_stmt, NULL_TREE);
}
- for (i = 0; VEC_iterate (tree, acc->vars, i, var); i++)
+ FOR_EACH_VEC_ELT (tree, acc->vars, i, var)
{
tree new_var = find_new_var_of_type (var, new_type);
tree lhs, rhs = NULL_TREE;
gimple stmt = acc->stmt;
unsigned i;
- for (i = 0; VEC_iterate (tree, str->new_types, i, type); i++)
+ FOR_EACH_VEC_ELT (tree, str->new_types, i, type)
{
gimple new_stmt;
tree var;
unsigned i;
- for (i = 0; VEC_iterate (tree, n_var->new_vars, i, var); i++)
+ FOR_EACH_VEC_ELT (tree, n_var->new_vars, i, var)
insert_global_to_varpool (var);
return 1;
}
type = TYPE_MAIN_VARIANT (type);
- for (i = 0; VEC_iterate (tree, *unsuitable_types, i, t); i++)
+ FOR_EACH_VEC_ELT (tree, *unsuitable_types, i, t)
if (is_equal_types (t, type))
break;
print_gimple_stmt (dump_file, acc->stmt, 0, 0);
fprintf(dump_file, " : ");
- for (i = 0; VEC_iterate (tree, acc->vars, i, var); i++)
+ FOR_EACH_VEC_ELT (tree, acc->vars, i, var)
{
print_generic_expr (dump_file, var, 0);
fprintf(dump_file, ", ");
d_str str;
unsigned i;
- for (i = 0; VEC_iterate (structure, structures, i, str); i++)
+ FOR_EACH_VEC_ELT (structure, structures, i, str)
create_new_accs_for_struct (str, bb);
}
alloc_site_t *call;
unsigned j;
- for (j = 0; VEC_iterate (alloc_site_t, m_data->allocs, j, call); j++)
+ FOR_EACH_VEC_ELT (alloc_site_t, m_data->allocs, j, call)
{
gimple stmt = call->stmt;
d_str str = call->str;
}
/* Generate an allocation sites for each new structure type. */
- for (i = 0; VEC_iterate (tree, str->new_types, i, type); i++)
+ FOR_EACH_VEC_ELT (tree, str->new_types, i, type)
{
gimple new_malloc_stmt = NULL;
gimple last_stmt_tmp = NULL;
d_str str;
unsigned i;
- for (i = 0; VEC_iterate (structure, structures, i, str); i++)
+ FOR_EACH_VEC_ELT (structure, structures, i, str)
free_data_struct (str);
VEC_free (structure, heap, structures);
d_str str;
unsigned i;
- for (i = 0; VEC_iterate (structure, structures, i, str); i++)
+ FOR_EACH_VEC_ELT (structure, structures, i, str)
check_type_escape (str, unsuitable_types);
}
tree type;
unsigned i, j;
- for (j = 0; VEC_iterate (tree, unsuitable_types, j, type); j++)
- for (i = 0; VEC_iterate (structure, structures, i, str); i++)
+ FOR_EACH_VEC_ELT (tree, unsuitable_types, j, type)
+ FOR_EACH_VEC_ELT (structure, structures, i, str)
if (is_equal_types (str->decl, type))
{
remove_structure (i);
d_str str;
unsigned i;
- for (i = 0; VEC_iterate (structure, structures, i, str); i++)
+ FOR_EACH_VEC_ELT (structure, structures, i, str)
check_bitfields (str, unsuitable_types);
}
d_str str;
unsigned i;
- for (i = 0; VEC_iterate (structure, structures, i, str); i++)
+ FOR_EACH_VEC_ELT (structure, structures, i, str)
check_struct_form (str, unsuitable_types);
}
if (!dump_file)
return;
- for (i = 0; VEC_iterate (structure, structures, i, str); i++)
+ FOR_EACH_VEC_ELT (structure, structures, i, str)
dump_accs (str);
}
d_str str;
unsigned i;
- for (i = 0; VEC_iterate (structure, structures, i, str); i++)
+ FOR_EACH_VEC_ELT (structure, structures, i, str)
exclude_alloc_and_field_accs_1 (str, node);
}
fprintf (dump_file, "\nThe following are the new types generated by"
" this optimization:\n");
- for (i = 0; VEC_iterate (structure, structures, i, str); i++)
+ FOR_EACH_VEC_ELT (structure, structures, i, str)
{
if (dump_file)
{
fprintf (dump_file, "\nthe number of new types is %d\n",
VEC_length (tree, str->new_types));
}
- for (j = 0; VEC_iterate (tree, str->new_types, j, type); j++)
+ FOR_EACH_VEC_ELT (tree, str->new_types, j, type)
dump_struct_type (type, 2, 0);
}
}
unsigned i;
int str_num = 0;
- for (i = 0; VEC_iterate (structure, structures, i, str); i++)
+ FOR_EACH_VEC_ELT (structure, structures, i, str)
create_new_type (str, &str_num);
}
d_str str;
/* We summarize counts of fields of a structure into the structure count. */
- for (i = 0; VEC_iterate (structure, structures, i, str); i++)
+ FOR_EACH_VEC_ELT (structure, structures, i, str)
sum_counts (str, &hottest);
/* Remove cold structures from structures vector. */
d_str str;
unsigned i;
- for (i = 0; VEC_iterate (structure, structures, i, str); i++)
+ FOR_EACH_VEC_ELT (structure, structures, i, str)
peel_hot_fields (str);
}
alias_pair *p;
/* Discover aliased nodes. */
- for (i = 0; VEC_iterate (alias_pair, alias_pairs, i, p); i++)
+ FOR_EACH_VEC_ELT (alias_pair, alias_pairs, i, p)
{
if (dump_file)
fprintf (dump_file, "Alias %s->%s",
ira_allocate (sizeof (struct ira_loop_tree_node)
* VEC_length (loop_p, ira_loops.larray)));
max_regno = max_reg_num ();
- for (i = 0; VEC_iterate (loop_p, ira_loops.larray, i, loop); i++)
+ FOR_EACH_VEC_ELT (loop_p, ira_loops.larray, i, loop)
{
if (loop != ira_loops.tree_root)
{
if (skip_p)
continue;
edges = get_loop_exit_edges (loop);
- for (j = 0; VEC_iterate (edge, edges, j, e); j++)
+ FOR_EACH_VEC_ELT (edge, edges, j, e)
if ((e->flags & EDGE_ABNORMAL) && EDGE_CRITICAL_P (e))
{
skip_p = true;
unsigned int i;
loop_p loop;
- for (i = 0; VEC_iterate (loop_p, ira_loops.larray, i, loop); i++)
+ FOR_EACH_VEC_ELT (loop_p, ira_loops.larray, i, loop)
if (ira_loop_nodes[i].regno_allocno_map != NULL
&& ira_loop_tree_root != &ira_loop_nodes[i])
return true;
unsigned int i;
loop_p loop;
- for (i = 0; VEC_iterate (loop_p, ira_loops.larray, i, loop); i++)
+ FOR_EACH_VEC_ELT (loop_p, ira_loops.larray, i, loop)
finish_loop_tree_node (&ira_loop_nodes[i]);
ira_free (ira_loop_nodes);
for (i = 0; i < (unsigned int) last_basic_block_before_change; i++)
/* We can not use loop/bb node access macros because of potential
checking and because the nodes are not initialized enough
yet. */
- for (i = 0; VEC_iterate (loop_p, ira_loops.larray, i, loop); i++)
+ FOR_EACH_VEC_ELT (loop_p, ira_loops.larray, i, loop)
if (ira_loop_nodes[i].regno_allocno_map != NULL)
{
ira_loop_nodes[i].children = NULL;
ira_allocno_iterator ai;
max_regno = max_reg_num ();
- for (l = 0; VEC_iterate (loop_p, ira_loops.larray, l, loop); l++)
+ FOR_EACH_VEC_ELT (loop_p, ira_loops.larray, l, loop)
if (ira_loop_nodes[l].regno_allocno_map != NULL)
{
ira_free (ira_loop_nodes[l].regno_allocno_map);
create_loop_allocnos (e);
edges = get_loop_exit_edges (loop_node->loop);
- for (i = 0; VEC_iterate (edge, edges, i, e); i++)
+ FOR_EACH_VEC_ELT (edge, edges, i, e)
create_loop_allocnos (e);
VEC_free (edge, heap, edges);
}
int i;
loop_p loop;
- for (i = 0; VEC_iterate (loop_p, ira_loops.larray, i, loop); i++)
+ FOR_EACH_VEC_ELT (loop_p, ira_loops.larray, i, loop)
if (ira_loop_nodes[i].regno_allocno_map != NULL)
{
if (ira_loop_nodes[i].parent == NULL)
else
{
edges = get_loop_exit_edges (loop_node->loop);
- for (i = 0; VEC_iterate (edge, edges, i, e); i++)
+ FOR_EACH_VEC_ELT (edge, edges, i, e)
if (regno < 0
|| (bitmap_bit_p (DF_LR_OUT (e->src), regno)
&& bitmap_bit_p (DF_LR_IN (e->dest), regno)))
unsigned int i;
loop_p loop;
- for (i = 0; VEC_iterate (loop_p, ira_loops.larray, i, loop); i++)
+ FOR_EACH_VEC_ELT (loop_p, ira_loops.larray, i, loop)
if (ira_loop_nodes[i].regno_allocno_map != NULL)
ira_loop_nodes[i].entered_from_non_parent_p
= entered_from_non_parent_p (&ira_loop_nodes[i]);
+2010-08-20 Nathan Froyd <froydnj@codesourcery.com>
+
+ * class.c: Use FOR_EACH_VEC_ELT.
+ * expr.c: Likewise.
+ * jcf-parse.c: Likewise.
+ * resource.c: Likewise.
+
2010-08-16 Joseph Myers <joseph@codesourcery.com>
* lang.opt (MD_, MMD_, version): Mark RejectDriver.
e = VEC_index (constructor_elt, v, idx--);
e->value = null_pointer_node;
- for (ix = 0;
- VEC_iterate (tree, DECL_FUNCTION_THROWS (mdecl), ix, t);
- ix++)
+ FOR_EACH_VEC_ELT (tree, DECL_FUNCTION_THROWS (mdecl), ix, t)
{
tree sig = DECL_NAME (TYPE_NAME (t));
tree utf8
VAR_DECL, get_identifier ("_Jv_CLS"),
class_array_type);
tree reg_class_list;
- for (i = 0; VEC_iterate (tree, registered_class, i, klass); ++i)
+ FOR_EACH_VEC_ELT (tree, registered_class, i, klass)
{
t = fold_convert (ptr_type_node, build_static_class_ref (klass));
CONSTRUCTOR_APPEND_ELT (init, NULL_TREE, t);
#endif
assemble_align (POINTER_SIZE);
- for (i = 0; VEC_iterate (tree, registered_class, i, klass); ++i)
+ FOR_EACH_VEC_ELT (tree, registered_class, i, klass)
{
t = build_fold_addr_expr (klass);
output_constant (t, POINTER_SIZE / BITS_PER_UNIT, POINTER_SIZE);
DECL_EXTERNAL (t) = 1;
register_class_fn = t;
- for (i = 0; VEC_iterate (tree, registered_class, i, klass); ++i)
+ FOR_EACH_VEC_ELT (tree, registered_class, i, klass)
{
t = build_fold_addr_expr (klass);
t = build_call_expr (register_class_fn, 1, t);
return the_table;
/* Build a list of _Jv_MethodSymbols for each entry in otable_methods. */
- for (index = 0; VEC_iterate (method_entry, decl_table, index, e); index++)
+ FOR_EACH_VEC_ELT (method_entry, decl_table, index, e)
CONSTRUCTOR_APPEND_ELT (v, NULL_TREE,
build_symbol_entry (e->method, e->special));
method_entry *e;
unsigned i;
- for (i = 0; VEC_iterate (method_entry, *symbol_table, i, e); i++)
+ FOR_EACH_VEC_ELT (method_entry, *symbol_table, i, e)
if (t == e->method && special == e->special)
goto done;
unsigned ix;
tree f;
- for (ix = 0; VEC_iterate (tree, predefined_filenames, ix, f); ix++)
+ FOR_EACH_VEC_ELT (tree, predefined_filenames, ix, f)
if (f == node)
return 1;
}
current_jcf = main_jcf;
- for (ix = 0; VEC_iterate (tree, current_file_list, ix, node); ix++)
+ FOR_EACH_VEC_ELT (tree, current_file_list, ix, node)
{
unsigned char magic_string[4];
char *real_path;
}
}
- for (ix = 0; VEC_iterate (tree, current_file_list, ix, node); ix++)
+ FOR_EACH_VEC_ELT (tree, current_file_list, ix, node)
{
input_location = DECL_SOURCE_LOCATION (node);
if (CLASS_FILE_P (node))
register_resource_fn = t;
/* Write out entries in the same order in which they were defined. */
- for (ix = 0; VEC_iterate (tree, resources, ix, decl); ix++)
+ FOR_EACH_VEC_ELT (tree, resources, ix, decl)
{
t = build_fold_addr_expr (decl);
t = build_call_expr (register_resource_fn, 1, t);
{
tree iv, invar;
size_t i;
- for (i = 0; VEC_iterate (tree, outerinductionvars, i, iv); i++)
+ FOR_EACH_VEC_ELT (tree, outerinductionvars, i, iv)
if (iv != NULL)
{
if (SSA_NAME_VAR (iv) == SSA_NAME_VAR (expr))
LLE_DENOMINATOR (lle) = 1;
}
}
- for (i = 0; VEC_iterate (tree, invariants, i, invar); i++)
+ FOR_EACH_VEC_ELT (tree, invariants, i, invar)
if (invar != NULL)
{
if (SSA_NAME_VAR (invar) == SSA_NAME_VAR (expr))
ret = lambda_loopnest_new (depth, 2 * depth, lambda_obstack);
- for (i = 0; VEC_iterate (lambda_loop, loops, i, newloop); i++)
+ FOR_EACH_VEC_ELT (lambda_loop, loops, i, newloop)
LN_LOOPS (ret)[i] = newloop;
fail:
/* Rewrite uses of the old ivs so that they are now specified in terms of
the new ivs. */
- for (i = 0; VEC_iterate (tree, old_ivs, i, oldiv); i++)
+ FOR_EACH_VEC_ELT (tree, old_ivs, i, oldiv)
{
imm_use_iterator imm_iter;
use_operand_p use_p;
distres = lambda_vector_new (nb_loops);
/* For each distance vector in the dependence graph. */
- for (i = 0; VEC_iterate (ddr_p, dependence_relations, i, ddr); i++)
+ FOR_EACH_VEC_ELT (ddr_p, dependence_relations, i, ddr)
{
/* Don't care about relations for which we know that there is no
dependence, nor about read-read (aka. output-dependences):
struct pointer_set_t *parameter_set = pointer_set_create ();
data_reference_p data_reference;
- for (i = 0; VEC_iterate (data_reference_p, datarefs, i, data_reference); i++)
+ FOR_EACH_VEC_ELT (data_reference_p, datarefs, i, data_reference)
for (j = 0; j < DR_NUM_DIMENSIONS (data_reference); j++)
lambda_collect_parameters_from_af (DR_ACCESS_FN (data_reference, j),
parameter_set, parameters);
data_reference_p dataref;
unsigned ix;
- for (ix = 0; VEC_iterate (data_reference_p, datarefs, ix, dataref); ix++)
+ FOR_EACH_VEC_ELT (data_reference_p, datarefs, ix, dataref)
if (!build_access_matrix (dataref, parameters, nest, lambda_obstack))
return false;
htab_t eq = htab_create (VEC_length (invariant_p, invariants),
hash_invariant_expr, eq_invariant_expr, free);
- for (i = 0; VEC_iterate (invariant_p, invariants, i, inv); i++)
+ FOR_EACH_VEC_ELT (invariant_p, invariants, i, inv)
find_identical_invariants (eq, inv);
htab_delete (eq);
int i, gain = 0, again;
unsigned aregs_needed[N_REG_CLASSES], invno;
- for (invno = 0; VEC_iterate (invariant_p, invariants, invno, inv); invno++)
+ FOR_EACH_VEC_ELT (invariant_p, invariants, invno, inv)
{
if (inv->move)
continue;
struct invariant *inv;
unsigned i;
- for (i = 0; VEC_iterate (invariant_p, invariants, i, inv); i++)
+ FOR_EACH_VEC_ELT (invariant_p, invariants, i, inv)
move_invariant_reg (loop, i);
if (flag_ira_loop_pressure && resize_reg_info ())
{
- for (i = 0; VEC_iterate (invariant_p, invariants, i, inv); i++)
+ FOR_EACH_VEC_ELT (invariant_p, invariants, i, inv)
if (inv->reg != NULL_RTX)
{
if (inv->orig_regno >= 0)
}
}
- for (i = 0; VEC_iterate (invariant_p, invariants, i, inv); i++)
+ FOR_EACH_VEC_ELT (invariant_p, invariants, i, inv)
{
BITMAP_FREE (inv->depends_on);
free (inv);
}
/* Remove the exit edges. */
- for (i = 0; VEC_iterate (edge, remove_edges, i, ein); i++)
+ FOR_EACH_VEC_ELT (edge, remove_edges, i, ein)
remove_path (ein);
VEC_free (edge, heap, remove_edges);
}
desc->niter_expr = GEN_INT (desc->niter);
/* Remove the edges. */
- for (i = 0; VEC_iterate (edge, remove_edges, i, e); i++)
+ FOR_EACH_VEC_ELT (edge, remove_edges, i, e)
remove_path (e);
VEC_free (edge, heap, remove_edges);
basic_block bb;
ldom = get_dominated_by (CDI_DOMINATORS, body[i]);
- for (j = 0; VEC_iterate (basic_block, ldom, j, bb); j++)
+ FOR_EACH_VEC_ELT (basic_block, ldom, j, bb)
if (!flow_bb_inside_loop_p (loop, bb))
VEC_safe_push (basic_block, heap, dom_bbs, bb);
}
/* Remove the edges. */
- for (i = 0; VEC_iterate (edge, remove_edges, i, e); i++)
+ FOR_EACH_VEC_ELT (edge, remove_edges, i, e)
remove_path (e);
VEC_free (edge, heap, remove_edges);
start_sequence ();
if (ve->op == PLUS || ve->op == MINUS)
- for (i = 0; VEC_iterate (rtx, ve->var_expansions, i, var); i++)
+ FOR_EACH_VEC_ELT (rtx, ve->var_expansions, i, var)
{
if (honor_signed_zero_p)
zero_init = simplify_gen_unary (NEG, mode, CONST0_RTX (mode), mode);
emit_move_insn (var, zero_init);
}
else if (ve->op == MULT)
- for (i = 0; VEC_iterate (rtx, ve->var_expansions, i, var); i++)
+ FOR_EACH_VEC_ELT (rtx, ve->var_expansions, i, var)
{
zero_init = CONST1_RTX (GET_MODE (var));
emit_move_insn (var, zero_init);
start_sequence ();
if (ve->op == PLUS || ve->op == MINUS)
- for (i = 0; VEC_iterate (rtx, ve->var_expansions, i, var); i++)
+ FOR_EACH_VEC_ELT (rtx, ve->var_expansions, i, var)
{
sum = simplify_gen_binary (PLUS, GET_MODE (ve->reg),
var, sum);
}
else if (ve->op == MULT)
- for (i = 0; VEC_iterate (rtx, ve->var_expansions, i, var); i++)
+ FOR_EACH_VEC_ELT (rtx, ve->var_expansions, i, var)
{
sum = simplify_gen_binary (MULT, GET_MODE (ve->reg),
var, sum);
unsigned int i;
bitmap b;
- for (i = 0; VEC_iterate (bitmap, reg_copy_graph, i, b); ++i)
+ FOR_EACH_VEC_ELT (bitmap, reg_copy_graph, i, b)
if (b)
BITMAP_FREE (b);
}
len = lto_input_uleb128 (ib);
}
- for (i = 0; VEC_iterate (cgraph_node_ptr, nodes, i, node); i++)
+ FOR_EACH_VEC_ELT (cgraph_node_ptr, nodes, i, node)
{
int ref = (int) (intptr_t) node->global.inlined_to;
input_varpool_node (file_data, ib));
len--;
}
- for (i = 0; VEC_iterate (varpool_node_ptr, varpool, i, node); i++)
+ FOR_EACH_VEC_ELT (varpool_node_ptr, varpool, i, node)
{
int ref = (int) (intptr_t) node->same_comdat_group;
lto_output_uleb128_stream (ob->main_stream, index);
lto_output_uleb128_stream (ob->main_stream,
VEC_length (ipa_replace_map_p, node->clone.tree_map));
- for (i = 0; VEC_iterate (ipa_replace_map_p, node->clone.tree_map, i, map); i++)
+ FOR_EACH_VEC_ELT (ipa_replace_map_p, node->clone.tree_map, i, map)
{
int parm_num;
tree parm;
int i;
opt_t *o;
- for (i = 0; VEC_iterate (opt_t, *opts_p, i, o); i++)
+ FOR_EACH_VEC_ELT (opt_t, *opts_p, i, o)
free (o->arg);
VEC_free (opt_t, heap, *opts_p);
output_data_stream (stream, &length, sizeof (length));
- for (i = 0; VEC_iterate (opt_t, opts, i, o); i++)
+ FOR_EACH_VEC_ELT (opt_t, opts, i, o)
{
output_data_stream (stream, &o->type, sizeof (o->type));
output_data_stream (stream, &o->code, sizeof (o->code));
int i;
opt_t *o;
- for (i = 0; VEC_iterate (opt_t, opts, i, o); i++)
+ FOR_EACH_VEC_ELT (opt_t, opts, i, o)
{
const struct cl_option *option = &cl_options[o->code];
/* Convert all the index numbers stored in pointer fields into
pointers to the corresponding slots in the EH region array. */
- for (i = 0; VEC_iterate (eh_region, eh_array, i, r); i++)
+ FOR_EACH_VEC_ELT (eh_region, eh_array, i, r)
{
/* The array may contain NULL regions. */
if (r == NULL)
/* Convert all the index numbers stored in pointer fields into
pointers to the corresponding slots in the EH landing pad array. */
- for (i = 0; VEC_iterate (eh_landing_pad, lp_array, i, lp); i++)
+ FOR_EACH_VEC_ELT (eh_landing_pad, lp_array, i, lp)
{
/* The array may contain NULL landing pads. */
if (lp == NULL)
lto_output_chain (ob, BLOCK_VARS (expr), ref_p);
output_uleb128 (ob, VEC_length (tree, BLOCK_NONLOCALIZED_VARS (expr)));
- for (i = 0; VEC_iterate (tree, BLOCK_NONLOCALIZED_VARS (expr), i, t); i++)
+ FOR_EACH_VEC_ELT (tree, BLOCK_NONLOCALIZED_VARS (expr), i, t)
lto_output_tree_or_ref (ob, t, ref_p);
lto_output_tree_or_ref (ob, BLOCK_SUPERCONTEXT (expr), ref_p);
/* Note that the number of BINFO slots has already been emitted in
EXPR's header (see lto_output_tree_header) because this length
is needed to build the empty BINFO node on the reader side. */
- for (i = 0; VEC_iterate (tree, BINFO_BASE_BINFOS (expr), i, t); i++)
+ FOR_EACH_VEC_ELT (tree, BINFO_BASE_BINFOS (expr), i, t)
lto_output_tree_or_ref (ob, t, ref_p);
output_zero (ob);
lto_output_tree_or_ref (ob, BINFO_VPTR_FIELD (expr), ref_p);
output_uleb128 (ob, VEC_length (tree, BINFO_BASE_ACCESSES (expr)));
- for (i = 0; VEC_iterate (tree, BINFO_BASE_ACCESSES (expr), i, t); i++)
+ FOR_EACH_VEC_ELT (tree, BINFO_BASE_ACCESSES (expr), i, t)
lto_output_tree_or_ref (ob, t, ref_p);
lto_output_tree_or_ref (ob, BINFO_INHERITANCE_CHAIN (expr), ref_p);
/* Emit all the EH regions in the region array. */
output_sleb128 (ob, VEC_length (eh_region, fn->eh->region_array));
- for (i = 0; VEC_iterate (eh_region, fn->eh->region_array, i, eh); i++)
+ FOR_EACH_VEC_ELT (eh_region, fn->eh->region_array, i, eh)
output_eh_region (ob, eh);
/* Emit all landing pads. */
output_sleb128 (ob, VEC_length (eh_landing_pad, fn->eh->lp_array));
- for (i = 0; VEC_iterate (eh_landing_pad, fn->eh->lp_array, i, lp); i++)
+ FOR_EACH_VEC_ELT (eh_landing_pad, fn->eh->lp_array, i, lp)
output_eh_lp (ob, lp);
/* Emit all the runtime type data. */
output_sleb128 (ob, VEC_length (tree, fn->eh->ttype_data));
- for (i = 0; VEC_iterate (tree, fn->eh->ttype_data, i, ttype); i++)
+ FOR_EACH_VEC_ELT (tree, fn->eh->ttype_data, i, ttype)
lto_output_tree_ref (ob, ttype);
/* Emit the table of action chains. */
{
tree t;
output_sleb128 (ob, VEC_length (tree, fn->eh->ehspec_data.arm_eabi));
- for (i = 0;
- VEC_iterate (tree, fn->eh->ehspec_data.arm_eabi, i, t);
- i++)
+ FOR_EACH_VEC_ELT (tree, fn->eh->ehspec_data.arm_eabi, i, t)
lto_output_tree_ref (ob, t);
}
else
{
uchar c;
output_sleb128 (ob, VEC_length (uchar, fn->eh->ehspec_data.other));
- for (i = 0; VEC_iterate (uchar, fn->eh->ehspec_data.other, i, c); i++)
+ FOR_EACH_VEC_ELT (uchar, fn->eh->ehspec_data.other, i, c)
lto_output_1_stream (ob->main_stream, c);
}
}
/* Output all the local variables in the function. */
output_sleb128 (ob, VEC_length (tree, fn->local_decls));
- for (i = 0; VEC_iterate (tree, fn->local_decls, i, t); i++)
+ FOR_EACH_VEC_ELT (tree, fn->local_decls, i, t)
lto_output_tree_ref (ob, t);
/* Output the head of the arguments list. */
output_zero (ob);
/* Emit the alias pairs for the nodes in SET. */
- for (i = 0; VEC_iterate (alias_pair, alias_pairs, i, p); i++)
+ FOR_EACH_VEC_ELT (alias_pair, alias_pairs, i, p)
{
if (output_alias_pair_p (p, set, vset))
{
}
/* Write all aliases. */
- for (i = 0; VEC_iterate (alias_pair, alias_pairs, i, p); i++)
+ FOR_EACH_VEC_ELT (alias_pair, alias_pairs, i, p)
if (output_alias_pair_p (p, set, vset))
write_symbol (cache, &stream, p->decl, seen, true);
unnecessarily. */
common_nodes = lto_get_common_nodes ();
- for (i = 0; VEC_iterate (tree, common_nodes, i, node); i++)
+ FOR_EACH_VEC_ELT (tree, common_nodes, i, node)
preload_common_node (cache, node);
VEC_free(tree, heap, common_nodes);
return;
/* Diagnose all mismatched re-declarations. */
- for (i = 0; VEC_iterate (tree, mismatches, i, decl); ++i)
+ FOR_EACH_VEC_ELT (tree, mismatches, i, decl)
{
if (!gimple_types_compatible_p (TREE_TYPE (prevailing->decl),
TREE_TYPE (decl), GTC_DIAG))
+2010-08-20 Nathan Froyd <froydnj@codesourcery.com>
+
+ * lto.c: Use FOR_EACH_VEC_ELT.
+
2010-07-27 Andi Kleen <ak@linux.intel.com>
* Make-lang.in (lto.o): Add dependency to splay-tree.h
compiled by LTRANS. After this loop, only those sets that
contain callgraph nodes from more than one file will need to be
compiled by LTRANS. */
- for (i = 0; VEC_iterate (ltrans_partition, ltrans_partitions, i, part); i++)
+ FOR_EACH_VEC_ELT (ltrans_partition, ltrans_partitions, i, part)
lto_stats.num_output_cgraph_nodes += VEC_length (cgraph_node_ptr,
part->cgraph_set->nodes);
htab_traverse (file->function_decl_states, lto_fixup_state_aux, &data);
}
- for (i = 0; VEC_iterate (tree, lto_global_var_decls, i, decl); i++)
+ FOR_EACH_VEC_ELT (tree, lto_global_var_decls, i, decl)
{
tree saved_decl = decl;
walk_tree (&decl, lto_fixup_tree, &data, NULL);
set_cfun (NULL);
/* Inform the middle end about the global variables we have seen. */
- for (i = 0; VEC_iterate (tree, lto_global_var_decls, i, decl); i++)
+ FOR_EACH_VEC_ELT (tree, lto_global_var_decls, i, decl)
rest_of_decl_compilation (decl, 1, 0);
if (!quiet_flag)
{
if (mi->access_l)
{
- for (i = 0;
- VEC_iterate (access_site_info_p, mi->access_l, i, acc_info);
- i++)
+ FOR_EACH_VEC_ELT (access_site_info_p, mi->access_l, i, acc_info)
free (acc_info);
VEC_free (access_site_info_p, heap, mi->access_l);
char *s;
name = lang_hooks.decl_printable_name (fndecl, 0);
- for (i = 0;
- VEC_iterate (char_p, flag_instrument_functions_exclude_functions,
- i, s);
- ++i)
- {
- if (strstr (name, s) != NULL)
- return true;
- }
+ FOR_EACH_VEC_ELT (char_p, flag_instrument_functions_exclude_functions,
+ i, s)
+ if (strstr (name, s) != NULL)
+ return true;
}
if (VEC_length (char_p, flag_instrument_functions_exclude_files) > 0)
char *s;
name = DECL_SOURCE_FILE (fndecl);
- for (i = 0;
- VEC_iterate (char_p, flag_instrument_functions_exclude_files, i, s);
- ++i)
- {
- if (strstr (name, s) != NULL)
- return true;
- }
+ FOR_EACH_VEC_ELT (char_p, flag_instrument_functions_exclude_files, i, s)
+ if (strstr (name, s) != NULL)
+ return true;
}
return false;
exits = get_loop_exit_edges (loop);
n_exits = VEC_length (edge, exits);
- for (j = 0; VEC_iterate (edge, exits, j, ex); j++)
+ FOR_EACH_VEC_ELT (edge, exits, j, ex)
{
tree niter = NULL;
HOST_WIDE_INT nitercst;
fprintf (file, "%s <VEC", prefix);
dump_addr (file, " ", vec);
- for (ix = 0; VEC_iterate (tree, vec, ix, elt); ++ix)
+ FOR_EACH_VEC_ELT (tree, vec, ix, elt)
{
char temp[10];
sprintf (temp, "elt %d", ix);
size_t i;
tree decl;
- for (i = 0; VEC_iterate (tree, deferred_global_decls, i, decl); i++)
+ FOR_EACH_VEC_ELT (tree, deferred_global_decls, i, decl)
sdbout_symbol (decl, 0);
}
int i;
rtx succ;
- for (i = 0; VEC_iterate (rtx, succs, i, succ); i++)
+ FOR_EACH_VEC_ELT (rtx, succs, i, succ)
if (succ)
dump_insn (succ);
else
new_rgn_number = sel_create_new_region ();
- for (i = 0; VEC_iterate (basic_block, *loop_blocks, i, bb); i++)
+ FOR_EACH_VEC_ELT (basic_block, *loop_blocks, i, bb)
{
gcc_assert (new_rgn_number >= 0);
{
/* If all preheader blocks are empty - dont create new empty region.
Instead, remove them completely. */
- for (i = 0; VEC_iterate (basic_block, preheader_blocks, i, bb); i++)
+ FOR_EACH_VEC_ELT (basic_block, preheader_blocks, i, bb)
{
edge e;
edge_iterator ei;
/* Add insn to to the tail of current path. */
ilist_add (&p, insn);
- for (is = 0; VEC_iterate (rtx, sinfo->succs_ok, is, succ); is++)
+ FOR_EACH_VEC_ELT (rtx, sinfo->succs_ok, is, succ)
{
av_set_t succ_set;
/* Check liveness restrictions via hard way when there are more than
two successors. */
if (sinfo->succs_ok_n > 2)
- for (is = 0; VEC_iterate (rtx, sinfo->succs_ok, is, succ); is++)
+ FOR_EACH_VEC_ELT (rtx, sinfo->succs_ok, is, succ)
{
basic_block succ_bb = BLOCK_FOR_INSN (succ);
/* Finally, check liveness restrictions on paths leaving the region. */
if (sinfo->all_succs_n > sinfo->succs_ok_n)
- for (is = 0; VEC_iterate (rtx, sinfo->succs_other, is, succ); is++)
+ FOR_EACH_VEC_ELT (rtx, sinfo->succs_other, is, succ)
mark_unavailable_targets
(av1, NULL, BB_LV_SET (BLOCK_FOR_INSN (succ)));
vinsn_t vinsn;
int n;
- for (n = 0; VEC_iterate (vinsn_t, vinsn_vec, n, vinsn); n++)
+ FOR_EACH_VEC_ELT (vinsn_t, vinsn_vec, n, vinsn)
if (VINSN_SEPARABLE_P (vinsn))
{
if (vinsn_equal_p (vinsn, EXPR_VINSN (expr)))
vinsn_t vinsn;
int n;
- for (n = 0; VEC_iterate (vinsn_t, *vinsn_vec, n, vinsn); n++)
+ FOR_EACH_VEC_ELT (vinsn_t, *vinsn_vec, n, vinsn)
vinsn_detach (vinsn);
VEC_block_remove (vinsn_t, *vinsn_vec, 0, len);
}
sel_print ("Total ready exprs: %d, stalled: %d\n",
VEC_length (expr_t, vec_av_set), stalled);
sel_print ("Sorted av set (%d): ", VEC_length (expr_t, vec_av_set));
- for (n = 0; VEC_iterate (expr_t, vec_av_set, n, expr); n++)
+ FOR_EACH_VEC_ELT (expr_t, vec_av_set, n, expr)
dump_expr (expr);
sel_print ("\n");
}
sched_extend_ready_list (ready.n_ready);
}
- for (n = 0; VEC_iterate (expr_t, vec_av_set, n, expr); n++)
+ FOR_EACH_VEC_ELT (expr_t, vec_av_set, n, expr)
{
vinsn_t vi = EXPR_VINSN (expr);
insn_t insn = VINSN_INSN_RTX (vi);
int i;
insn_t insn;
- for (i = 0; VEC_iterate (insn_t, vec_temp_moveop_nops, i, insn); i++)
+ FOR_EACH_VEC_ELT (insn_t, vec_temp_moveop_nops, i, insn)
{
gcc_assert (INSN_NOP_P (insn));
return_nop_to_pool (insn, full_tidying);
/* Make sure that the loops in the SESE_LOOP_NEST are ordered. It
can be the case that an inner loop is inserted before an outer
loop. To avoid this, semi-sort once. */
- for (i = 0; VEC_iterate (loop_p, SESE_LOOP_NEST (region), i, loop0); i++)
+ FOR_EACH_VEC_ELT (loop_p, SESE_LOOP_NEST (region), i, loop0)
{
if (VEC_length (loop_p, SESE_LOOP_NEST (region)) == i + 1)
break;
/* Build the parameter and argument lists in parallel; also
substitute the former for the latter in the expression. */
args = VEC_alloc (tree, gc, VEC_length (tree, self_refs));
- for (i = 0; VEC_iterate (tree, self_refs, i, ref); i++)
+ FOR_EACH_VEC_ELT (tree, self_refs, i, ref)
{
tree subst, param_name, param_type, param_decl;
{
eh_region region = NULL;
- for (i = 0; VEC_iterate (basic_block, bbs, i, bb); i++)
+ FOR_EACH_VEC_ELT (basic_block, bbs, i, bb)
region = find_outermost_region_in_block (saved_cfun, bb, region);
init_eh_for_function ();
d.eh_map = eh_map;
d.remap_decls_p = true;
- for (i = 0; VEC_iterate (basic_block, bbs, i, bb); i++)
+ FOR_EACH_VEC_ELT (basic_block, bbs, i, bb)
{
/* No need to update edge counts on the last block. It has
already been updated earlier when we detached the region from
}
set_immediate_dominator (CDI_DOMINATORS, bb, dom_entry);
- for (i = 0; VEC_iterate (basic_block, dom_bbs, i, abb); i++)
+ FOR_EACH_VEC_ELT (basic_block, dom_bbs, i, abb)
set_immediate_dominator (CDI_DOMINATORS, abb, bb);
VEC_free (basic_block, heap, dom_bbs);
else
{
bbs_to_remove = get_all_dominated_blocks (CDI_DOMINATORS, e->dest);
- for (i = 0; VEC_iterate (basic_block, bbs_to_remove, i, bb); i++)
+ FOR_EACH_VEC_ELT (basic_block, bbs_to_remove, i, bb)
{
FOR_EACH_EDGE (f, ei, bb->succs)
{
bitmap_set_bit (df, f->dest->index);
}
}
- for (i = 0; VEC_iterate (basic_block, bbs_to_remove, i, bb); i++)
+ FOR_EACH_VEC_ELT (basic_block, bbs_to_remove, i, bb)
bitmap_clear_bit (df, bb->index);
EXECUTE_IF_SET_IN_BITMAP (df, 0, i, bi)
redirection, replace it with the PHI argument that used
to be on E. */
head = redirect_edge_var_map_vector (e);
- for (i = 0; VEC_iterate (edge_var_map, head, i, vm); ++i)
+ FOR_EACH_VEC_ELT (edge_var_map, head, i, vm)
{
tree old_arg = redirect_edge_var_map_result (vm);
tree new_arg = redirect_edge_var_map_def (vm);
int i;
tree expr;
- for (i = 0; VEC_iterate (tree, iv_map, i, expr); i++)
+ FOR_EACH_VEC_ELT (tree, iv_map, i, expr)
if (expr)
chrec = chrec_apply (i, chrec, expr);
unsigned int i;
struct data_reference *dr;
- for (i = 0; VEC_iterate (data_reference_p, datarefs, i, dr); i++)
+ FOR_EACH_VEC_ELT (data_reference_p, datarefs, i, dr)
dump_data_reference (file, dr);
}
unsigned int i;
struct data_dependence_relation *ddr;
- for (i = 0; VEC_iterate (ddr_p, ddrs, i, ddr); i++)
+ FOR_EACH_VEC_ELT (ddr_p, ddrs, i, ddr)
dump_data_dependence_relation (file, ddr);
}
unsigned j;
lambda_vector v;
- for (j = 0; VEC_iterate (lambda_vector, dir_vects, j, v); j++)
+ FOR_EACH_VEC_ELT (lambda_vector, dir_vects, j, v)
print_direction_vector (outf, v, length);
}
unsigned j;
lambda_vector v;
- for (j = 0; VEC_iterate (lambda_vector, dist_vects, j, v); j++)
+ FOR_EACH_VEC_ELT (lambda_vector, dist_vects, j, v)
print_lambda_vector (outf, v, length);
}
fprintf (outf, " inner loop index: %d\n", DDR_INNER_LOOP (ddr));
fprintf (outf, " loop nest: (");
- for (i = 0; VEC_iterate (loop_p, DDR_LOOP_NEST (ddr), i, loopi); i++)
+ FOR_EACH_VEC_ELT (loop_p, DDR_LOOP_NEST (ddr), i, loopi)
fprintf (outf, "%d ", loopi->num);
fprintf (outf, ")\n");
struct data_dependence_relation *ddr;
lambda_vector v;
- for (i = 0; VEC_iterate (ddr_p, ddrs, i, ddr); i++)
+ FOR_EACH_VEC_ELT (ddr_p, ddrs, i, ddr)
if (DDR_ARE_DEPENDENT (ddr) == NULL_TREE && DDR_AFFINE_P (ddr))
{
- for (j = 0; VEC_iterate (lambda_vector, DDR_DIST_VECTS (ddr), j, v); j++)
+ FOR_EACH_VEC_ELT (lambda_vector, DDR_DIST_VECTS (ddr), j, v)
{
fprintf (file, "DISTANCE_V (");
print_lambda_vector (file, v, DDR_NB_LOOPS (ddr));
fprintf (file, ")\n");
}
- for (j = 0; VEC_iterate (lambda_vector, DDR_DIR_VECTS (ddr), j, v); j++)
+ FOR_EACH_VEC_ELT (lambda_vector, DDR_DIR_VECTS (ddr), j, v)
{
fprintf (file, "DIRECTION_V (");
print_direction_vector (file, v, DDR_NB_LOOPS (ddr));
unsigned int i;
struct data_dependence_relation *ddr;
- for (i = 0; VEC_iterate (ddr_p, ddrs, i, ddr); i++)
+ FOR_EACH_VEC_ELT (ddr_p, ddrs, i, ddr)
dump_data_dependence_relation (file, ddr);
fprintf (file, "\n\n");
unsigned i;
tree idx;
- for (i = 0; VEC_iterate (tree, DR_ACCESS_FNS (dr), i, idx); i++)
+ FOR_EACH_VEC_ELT (tree, DR_ACCESS_FNS (dr), i, idx)
if (tree_contains_chrecs (idx, NULL))
return false;
unsigned i;
subscript_p s;
- for (i = 0; VEC_iterate (subscript_p, subscripts, i, s); i++)
+ FOR_EACH_VEC_ELT (subscript_p, subscripts, i, s)
{
free_conflict_function (s->conflicting_iterations_in_a);
free_conflict_function (s->conflicting_iterations_in_b);
unsigned i;
lambda_vector v;
- for (i = 0; VEC_iterate (lambda_vector, DDR_DIST_VECTS (ddr), i, v); i++)
+ FOR_EACH_VEC_ELT (lambda_vector, DDR_DIST_VECTS (ddr), i, v)
if (lambda_vector_equal (v, dist_v, DDR_NB_LOOPS (ddr)))
return;
unsigned i;
lambda_vector v;
- for (i = 0; VEC_iterate (lambda_vector, DDR_DIR_VECTS (ddr), i, v); i++)
+ FOR_EACH_VEC_ELT (lambda_vector, DDR_DIR_VECTS (ddr), i, v)
if (lambda_vector_equal (v, dir_v, DDR_NB_LOOPS (ddr)))
return;
unsigned i, j;
lambda_vector dist_v;
- for (i = 0; VEC_iterate (lambda_vector, DDR_DIST_VECTS (ddr), i, dist_v); i++)
+ FOR_EACH_VEC_ELT (lambda_vector, DDR_DIST_VECTS (ddr), i, dist_v)
{
lambda_vector dir_v = lambda_vector_new (DDR_NB_LOOPS (ddr));
VEC(tree,heap) *fns = DR_ACCESS_FNS (a);
tree t;
- for (i = 0; VEC_iterate (tree, fns, i, t); i++)
+ FOR_EACH_VEC_ELT (tree, fns, i, t)
if (!evolution_function_is_invariant_p (t, loop_nest->num)
&& !evolution_function_is_affine_multivariate_p (t, loop_nest->num))
return false;
DDR_NUM_DIST_VECTS (ddr));
fprintf (file, "Banerjee dist vectors:\n");
- for (i = 0; VEC_iterate (lambda_vector, dist_vects, i, b_dist_v); i++)
+ FOR_EACH_VEC_ELT (lambda_vector, dist_vects, i, b_dist_v)
print_lambda_vector (file, b_dist_v, DDR_NB_LOOPS (ddr));
fprintf (file, "Omega dist vectors:\n");
/* Distance vectors are not ordered in the same way in the DDR
and in the DIST_VECTS: search for a matching vector. */
- for (j = 0; VEC_iterate (lambda_vector, dist_vects, j, a_dist_v); j++)
+ FOR_EACH_VEC_ELT (lambda_vector, dist_vects, j, a_dist_v)
if (lambda_vector_equal (a_dist_v, b_dist_v, DDR_NB_LOOPS (ddr)))
break;
/* Direction vectors are not ordered in the same way in the DDR
and in the DIR_VECTS: search for a matching vector. */
- for (j = 0; VEC_iterate (lambda_vector, dir_vects, j, a_dir_v); j++)
+ FOR_EACH_VEC_ELT (lambda_vector, dir_vects, j, a_dir_v)
if (lambda_vector_equal (a_dir_v, b_dir_v, DDR_NB_LOOPS (ddr)))
break;
struct data_reference *a, *b;
unsigned int i, j;
- for (i = 0; VEC_iterate (data_reference_p, datarefs, i, a); i++)
+ FOR_EACH_VEC_ELT (data_reference_p, datarefs, i, a)
for (j = i + 1; VEC_iterate (data_reference_p, datarefs, j, b); j++)
if (!DR_IS_READ (a) || !DR_IS_READ (b) || compute_self_and_rr)
{
}
if (compute_self_and_rr)
- for (i = 0; VEC_iterate (data_reference_p, datarefs, i, a); i++)
+ FOR_EACH_VEC_ELT (data_reference_p, datarefs, i, a)
{
ddr = initialize_data_dependence_relation (a, a, loop_nest);
VEC_safe_push (ddr_p, heap, *dependence_relations, ddr);
return false;
}
- for (i = 0; VEC_iterate (data_ref_loc, references, i, ref); i++)
+ FOR_EACH_VEC_ELT (data_ref_loc, references, i, ref)
{
dr = create_data_ref (nest, *ref->pos, stmt, ref->is_read);
gcc_assert (dr != NULL);
return false;
}
- for (i = 0; VEC_iterate (data_ref_loc, references, i, ref); i++)
+ FOR_EACH_VEC_ELT (data_ref_loc, references, i, ref)
{
dr = create_data_ref (nest, *ref->pos, stmt, ref->is_read);
gcc_assert (dr != NULL);
unsigned nb_chrec_relations = 0;
struct data_dependence_relation *ddr;
- for (i = 0; VEC_iterate (ddr_p, dependence_relations, i, ddr); i++)
+ FOR_EACH_VEC_ELT (ddr_p, dependence_relations, i, ddr)
{
if (chrec_contains_undetermined (DDR_ARE_DEPENDENT (ddr)))
nb_top_relations++;
struct data_dependence_relation *ddr;
VEC (loop_p, heap) *loop_nest = NULL;
- for (i = 0; VEC_iterate (ddr_p, dependence_relations, i, ddr); i++)
+ FOR_EACH_VEC_ELT (ddr_p, dependence_relations, i, ddr)
{
if (ddr == NULL)
continue;
unsigned int i;
struct data_reference *dr;
- for (i = 0; VEC_iterate (data_reference_p, datarefs, i, dr); i++)
+ FOR_EACH_VEC_ELT (data_reference_p, datarefs, i, dr)
free_data_ref (dr);
VEC_free (data_reference_p, heap, datarefs);
}
def_operand_p def_p;
ssa_op_iter iter;
- for (i = 0; VEC_iterate (ddr_p, ddrs, i, ddr); i++)
+ FOR_EACH_VEC_ELT (ddr_p, ddrs, i, ddr)
if (DDR_ARE_DEPENDENT (ddr) == NULL_TREE)
create_rdg_edge_for_ddr (rdg, ddr);
int i, j;
gimple stmt;
- for (i = 0; VEC_iterate (gimple, stmts, i, stmt); i++)
+ FOR_EACH_VEC_ELT (gimple, stmts, i, stmt)
{
VEC (data_ref_loc, heap) *references;
data_ref_loc *ref;
continue;
get_references_in_stmt (stmt, &references);
- for (j = 0; VEC_iterate (data_ref_loc, references, j, ref); j++)
+ FOR_EACH_VEC_ELT (data_ref_loc, references, j, ref)
if (!ref->is_read)
RDG_MEM_WRITE_STMT (rdg, i) = true;
else
ddr_p ddr;
unsigned int i;
- for (i = 0; VEC_iterate (ddr_p, dependence_relations, i, ddr); i++)
+ FOR_EACH_VEC_ELT (ddr_p, dependence_relations, i, ddr)
if (DDR_ARE_DEPENDENT (ddr) == chrec_dont_know)
return false;
get_references_in_stmt (s1, &refs1);
get_references_in_stmt (s2, &refs2);
- for (i = 0; VEC_iterate (data_ref_loc, refs1, i, ref1); i++)
+ FOR_EACH_VEC_ELT (data_ref_loc, refs1, i, ref1)
{
tree base1 = ref_base_address (s1, ref1);
if (base1)
- for (j = 0; VEC_iterate (data_ref_loc, refs2, j, ref2); j++)
+ FOR_EACH_VEC_ELT (data_ref_loc, refs2, j, ref2)
if (base1 == ref_base_address (s2, ref2))
{
res = true;
get_references_in_stmt (stmt, &refs);
- for (i = 0; VEC_iterate (data_ref_loc, refs, i, ref); i++)
+ FOR_EACH_VEC_ELT (data_ref_loc, refs, i, ref)
if (!ref->is_read)
{
res = htab_hash_pointer (ref_base_address (stmt, ref));
VEC (tree,heap) *lambda_parameters = AM_PARAMETERS (access_matrix);
tree lambda_parameter;
- for (i = 0; VEC_iterate (tree, lambda_parameters, i, lambda_parameter); i++)
+ FOR_EACH_VEC_ELT (tree, lambda_parameters, i, lambda_parameter)
if (lambda_parameter == parameter)
return i + AM_NB_INDUCTION_VARS (access_matrix);
VEC_safe_grow (tree, heap, access_vars, n_tls);
/* Create the control variables for each TLS variable. */
- for (i = 0; VEC_iterate (varpool_node_ptr, tls_vars->nodes, i, var); ++i)
+ FOR_EACH_VEC_ELT (varpool_node_ptr, tls_vars->nodes, i, var)
{
tree cdecl;
struct varpool_node *cvar;
if (any_aliases)
{
alias_pair *p;
- for (i = 0; VEC_iterate (alias_pair, alias_pairs, i, p); ++i)
+ FOR_EACH_VEC_ELT (alias_pair, alias_pairs, i, p)
if (DECL_THREAD_LOCAL_P (p->decl))
{
p->decl = emutls_decl (p->decl);
if (!id->debug_stmts)
return;
- for (i = 0; VEC_iterate (gimple, id->debug_stmts, i, stmt); i++)
+ FOR_EACH_VEC_ELT (gimple, id->debug_stmts, i, stmt)
copy_debug_stmt (stmt, id);
VEC_free (gimple, heap, id->debug_stmts);
continue;
phis = VEC_index (gimple_vec, phis_to_rewrite, e->dest->index);
- for (i = 0; VEC_iterate (gimple, phis, i, phi); i++)
+ FOR_EACH_VEC_ELT (gimple, phis, i, phi)
{
tree arg, lhs_sym, reaching_def = NULL;
use_operand_p arg_p;
graphds_dfs (rdg, &v, 1, &nodes, false, NULL);
- for (i = 0; VEC_iterate (int, nodes, i, x); i++)
+ FOR_EACH_VEC_ELT (int, nodes, i, x)
{
if (!bitmap_set_bit (seen, x))
continue;
graphds_dfs (rdg, &v, 1, &nodes, false, remaining_stmts);
rdg_flag_vertex (rdg, v, partition, loops, part_has_writes);
- for (i = 0; VEC_iterate (int, nodes, i, x); i++)
+ FOR_EACH_VEC_ELT (int, nodes, i, x)
if (!already_processed_vertex_p (processed, x))
rdg_flag_vertex_and_dependent (rdg, x, partition, loops, processed,
part_has_writes);
edge e;
VEC (edge, heap) *exits = get_loop_exit_edges (loop);
- for (i = 0; VEC_iterate (edge, exits, i, e); i++)
+ FOR_EACH_VEC_ELT (edge, exits, i, e)
{
gimple cond = last_stmt (e->src);
/* Remove from OTHER_STORES the vertex that we flagged. */
if (RDG_MEM_WRITE_STMT (rdg, j))
- for (k = 0; VEC_iterate (int, *other_stores, k, kk); k++)
+ FOR_EACH_VEC_ELT (int, *other_stores, k, kk)
if (kk == j)
{
VEC_unordered_remove (int, *other_stores, k);
bitmap loops = BITMAP_ALLOC (NULL);
bitmap processed = BITMAP_ALLOC (NULL);
- for (i = 0; VEC_iterate (int, c->vertices, i, v); i++)
+ FOR_EACH_VEC_ELT (int, c->vertices, i, v)
if (!already_processed_vertex_p (processed, v))
rdg_flag_vertex_and_dependent (rdg, v, partition, loops, processed,
part_has_writes);
int i;
rdgc x;
- for (i = 0; VEC_iterate (rdgc, components, i, x); i++)
+ FOR_EACH_VEC_ELT (rdgc, components, i, x)
{
VEC_free (int, heap, x->vertices);
free (x);
for (i = 0; i < rdg->n_vertices; i++)
VEC_safe_push (int, heap, all_components[rdg->vertices[i].component], i);
- for (i = 0; VEC_iterate (int, starting_vertices, i, v); i++)
+ FOR_EACH_VEC_ELT (int, starting_vertices, i, v)
{
int c = rdg->vertices[v].component;
rdgc x;
bitmap partition = BITMAP_ALLOC (NULL);
- for (i = 0; VEC_iterate (rdgc, components, i, x); i++)
+ FOR_EACH_VEC_ELT (rdgc, components, i, x)
{
bitmap np;
bool part_has_writes = false;
int i;
bitmap partition;
- for (i = 0; VEC_iterate (bitmap, partitions, i, partition); i++)
+ FOR_EACH_VEC_ELT (bitmap, partitions, i, partition)
debug_bitmap_file (file, partition);
}
bitmap partition;
int nrw = number_of_rw_in_rdg (rdg);
- for (i = 0; VEC_iterate (bitmap, partitions, i, partition); i++)
+ FOR_EACH_VEC_ELT (bitmap, partitions, i, partition)
if (nrw == number_of_rw_in_partition (rdg, partition))
return true;
unsigned j;
bool found = false;
- for (j = 0; VEC_iterate (int, starting_vertices, j, v); j++)
+ FOR_EACH_VEC_ELT (int, starting_vertices, j, v)
if (i == v)
{
found = true;
if (dump_file && (dump_flags & TDF_DETAILS))
dump_rdg_partitions (dump_file, partitions);
- for (i = 0; VEC_iterate (bitmap, partitions, i, partition); i++)
+ FOR_EACH_VEC_ELT (bitmap, partitions, i, partition)
if (!generate_code_for_partition (loop, partition, i < nbp - 1))
goto ldist_done;
BITMAP_FREE (remaining_stmts);
BITMAP_FREE (upstream_mem_writes);
- for (i = 0; VEC_iterate (bitmap, partitions, i, partition); i++)
+ FOR_EACH_VEC_ELT (bitmap, partitions, i, partition)
BITMAP_FREE (partition);
VEC_free (int, heap, other_stores);
if (dump_file && (dump_flags & TDF_DETAILS))
dump_rdg (dump_file, rdg);
- for (i = 0; VEC_iterate (gimple, stmts, i, s); i++)
+ FOR_EACH_VEC_ELT (gimple, stmts, i, s)
{
int v = rdg_vertex_for_stmt (rdg, s);
*nb_deps_not_carried_by_loop = 0;
*access_strides = double_int_zero;
- for (i = 0; VEC_iterate (ddr_p, dependence_relations, i, ddr); i++)
+ FOR_EACH_VEC_ELT (ddr_p, dependence_relations, i, ddr)
{
/* If we don't know anything about this dependence, or the distance
vector is NULL, or there is no dependence, then there is no reuse of
}
/* Compute the access strides. */
- for (i = 0; VEC_iterate (data_reference_p, datarefs, i, dr); i++)
+ FOR_EACH_VEC_ELT (data_reference_p, datarefs, i, dr)
{
unsigned int it;
tree ref = DR_REF (dr);
VEC_free (loop_p, heap, nest);
}
- for (i = 0; VEC_iterate (gimple, remove_ivs, i, oldiv_stmt); i++)
+ FOR_EACH_VEC_ELT (gimple, remove_ivs, i, oldiv_stmt)
remove_iv (oldiv_stmt);
VEC_free (tree, heap, oldivs);
{
size_t i;
tree obj;
- for (i = 0; VEC_iterate (tree, deferred_static_decls, i, obj); i++)
+ FOR_EACH_VEC_ELT (tree, deferred_static_decls, i, obj)
{
gcc_assert (DECL_P (obj));
int x;
int t;
- for (x = 0; VEC_iterate (int, g->nodes, x, t); x++)
+ FOR_EACH_VEC_ELT (int, g->nodes, x, t)
if (t == node)
return;
VEC_safe_push (int, heap, g->nodes, node);
sbitmap_zero (g->visited);
VEC_truncate (int, g->stack, 0);
- for (x = 0; VEC_iterate (int, g->nodes, x, part); x++)
+ FOR_EACH_VEC_ELT (int, g->nodes, x, part)
{
if (!TEST_BIT (g->visited, part))
elim_forward (g, part);
gather_blocks_in_sese_region (entry_bb, exit_bb, &body);
- for (i = 0; VEC_iterate (basic_block, body, i, bb); i++)
+ FOR_EACH_VEC_ELT (basic_block, body, i, bb)
if (bb != entry_bb && bb != exit_bb)
for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
eliminate_local_variables_stmt (entry, gsi_stmt (gsi),
entry = single_succ_edge (entry_bb);
gather_blocks_in_sese_region (entry_bb, exit_bb, &body);
- for (i = 0; VEC_iterate (basic_block, body, i, bb); i++)
+ FOR_EACH_VEC_ELT (basic_block, body, i, bb)
{
if (bb != entry_bb && bb != exit_bb)
{
and discard those for which we know there's nothing we can
do. */
if (has_debug_stmt)
- for (i = 0; VEC_iterate (basic_block, body, i, bb); i++)
+ FOR_EACH_VEC_ELT (basic_block, body, i, bb)
if (bb != entry_bb && bb != exit_bb)
{
for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi);)
if (chain->vars)
{
fprintf (file, " vars");
- for (i = 0; VEC_iterate (tree, chain->vars, i, var); i++)
+ FOR_EACH_VEC_ELT (tree, chain->vars, i, var)
{
fprintf (file, " ");
print_generic_expr (file, var, TDF_SLIM);
if (chain->inits)
{
fprintf (file, " inits");
- for (i = 0; VEC_iterate (tree, chain->inits, i, var); i++)
+ FOR_EACH_VEC_ELT (tree, chain->inits, i, var)
{
fprintf (file, " ");
print_generic_expr (file, var, TDF_SLIM);
}
fprintf (file, " references:\n");
- for (i = 0; VEC_iterate (dref, chain->refs, i, a); i++)
+ FOR_EACH_VEC_ELT (dref, chain->refs, i, a)
dump_dref (file, a);
fprintf (file, "\n");
chain_p chain;
unsigned i;
- for (i = 0; VEC_iterate (chain_p, chains, i, chain); i++)
+ FOR_EACH_VEC_ELT (chain_p, chains, i, chain)
dump_chain (file, chain);
}
fprintf (file, "Component%s:\n",
comp->comp_step == RS_INVARIANT ? " (invariant)" : "");
- for (i = 0; VEC_iterate (dref, comp->refs, i, a); i++)
+ FOR_EACH_VEC_ELT (dref, comp->refs, i, a)
dump_dref (file, a);
fprintf (file, "\n");
}
if (chain == NULL)
return;
- for (i = 0; VEC_iterate (dref, chain->refs, i, ref); i++)
+ FOR_EACH_VEC_ELT (dref, chain->refs, i, ref)
free (ref);
VEC_free (dref, heap, chain->refs);
unsigned i;
chain_p chain;
- for (i = 0; VEC_iterate (chain_p, chains, i, chain); i++)
+ FOR_EACH_VEC_ELT (chain_p, chains, i, chain)
release_chain (chain);
VEC_free (chain_p, heap, chains);
}
edge ex;
basic_block last = loop->latch;
- for (i = 0; VEC_iterate (edge, exits, i, ex); i++)
+ FOR_EACH_VEC_ELT (edge, exits, i, ex)
last = nearest_common_dominator (CDI_DOMINATORS, last, ex->src);
VEC_free (edge, heap, exits);
dref dataref;
basic_block last_always_executed = last_always_executed_block (loop);
- for (i = 0; VEC_iterate (data_reference_p, datarefs, i, dr); i++)
+ FOR_EACH_VEC_ELT (data_reference_p, datarefs, i, dr)
{
if (!DR_REF (dr))
{
comp_father[n] = n;
comp_size[n] = 1;
- for (i = 0; VEC_iterate (data_reference_p, datarefs, i, dr); i++)
+ FOR_EACH_VEC_ELT (data_reference_p, datarefs, i, dr)
{
enum ref_step_type dummy;
}
}
- for (i = 0; VEC_iterate (ddr_p, depends, i, ddr); i++)
+ FOR_EACH_VEC_ELT (ddr_p, depends, i, ddr)
{
double_int dummy_off;
comps = XCNEWVEC (struct component *, n);
bad = component_of (comp_father, n);
- for (i = 0; VEC_iterate (data_reference_p, datarefs, i, dr); i++)
+ FOR_EACH_VEC_ELT (data_reference_p, datarefs, i, dr)
{
ia = (unsigned) (size_t) dr->aux;
ca = component_of (comp_father, ia);
basic_block ba, bp = loop->header;
bool ok, has_write = false;
- for (i = 0; VEC_iterate (dref, comp->refs, i, a); i++)
+ FOR_EACH_VEC_ELT (dref, comp->refs, i, a)
{
ba = gimple_bb (a->stmt);
unsigned i;
*comp = act->next;
- for (i = 0; VEC_iterate (dref, act->refs, i, ref); i++)
+ FOR_EACH_VEC_ELT (dref, act->refs, i, ref)
free (ref);
release_component (act);
}
chain->all_always_accessed = true;
- for (i = 0; VEC_iterate (dref, comp->refs, i, ref); i++)
+ FOR_EACH_VEC_ELT (dref, comp->refs, i, ref)
{
VEC_safe_push (dref, heap, chain->refs, ref);
chain->all_always_accessed &= ref->always_accessed;
nw->distance = ref->distance + 1;
nw->always_accessed = 1;
- for (i = 0; VEC_iterate (dref, chain->refs, i, aref); i++)
+ FOR_EACH_VEC_ELT (dref, chain->refs, i, aref)
if (aref->distance >= nw->distance)
break;
VEC_safe_insert (dref, heap, chain->refs, i, nw);
dref ref, root = get_chain_root (chain);
gimple phi;
- for (i = 0; VEC_iterate (dref, chain->refs, i, ref); i++)
+ FOR_EACH_VEC_ELT (dref, chain->refs, i, ref)
{
phi = find_looparound_phi (loop, ref, root);
if (!phi)
qsort (VEC_address (dref, comp->refs), VEC_length (dref, comp->refs),
sizeof (dref), order_drefs);
- for (i = 0; VEC_iterate (dref, comp->refs, i, a); i++)
+ FOR_EACH_VEC_ELT (dref, comp->refs, i, a)
{
if (!chain || !DR_IS_READ (a->ref)
|| double_int_ucmp (uhwi_to_double_int (MAX_DISTANCE),
if (reuse_first)
VEC_quick_push (tree, chain->vars, VEC_index (tree, chain->vars, 0));
- for (i = 0; VEC_iterate (tree, chain->vars, i, var); i++)
+ FOR_EACH_VEC_ELT (tree, chain->vars, i, var)
VEC_replace (tree, chain->vars, i, make_ssa_name (var, NULL));
for (i = 0; i < n; i++)
if (written)
VEC_quick_push (tree, *vars, VEC_index (tree, *vars, 0));
- for (i = 0; VEC_iterate (tree, *vars, i, var); i++)
+ FOR_EACH_VEC_ELT (tree, *vars, i, var)
VEC_replace (tree, *vars, i, make_ssa_name (var, NULL));
var = VEC_index (tree, *vars, 0);
gcc_assert (chain->type == CT_INVARIANT);
gcc_assert (!chain->combined);
- for (i = 0; VEC_iterate (dref, chain->refs, i, a); i++)
+ FOR_EACH_VEC_ELT (dref, chain->refs, i, a)
if (!DR_IS_READ (a->ref))
n_writes++;
&vars, chain->inits, tmp_vars);
ridx = 0;
- for (i = 0; VEC_iterate (dref, chain->refs, i, a); i++)
+ FOR_EACH_VEC_ELT (dref, chain->refs, i, a)
{
bool is_read = DR_IS_READ (a->ref);
mark_virtual_ops_for_renaming (a->stmt);
unsigned factor = 1, af, nfactor, i;
unsigned max = PARAM_VALUE (PARAM_MAX_UNROLL_TIMES);
- for (i = 0; VEC_iterate (chain_p, chains, i, chain); i++)
+ FOR_EACH_VEC_ELT (chain_p, chains, i, chain)
{
if (chain->type == CT_INVARIANT || chain->combined)
continue;
chain_p chain;
unsigned i;
- for (i = 0; VEC_iterate (chain_p, chains, i, chain); i++)
+ FOR_EACH_VEC_ELT (chain_p, chains, i, chain)
{
if (chain->type == CT_INVARIANT)
execute_load_motion (loop, chain, tmp_vars);
dref a;
unsigned i, j;
- for (i = 0; VEC_iterate (chain_p, chains, i, chain); i++)
- for (j = 0; VEC_iterate (dref, chain->refs, j, a); j++)
+ FOR_EACH_VEC_ELT (chain_p, chains, i, chain)
+ FOR_EACH_VEC_ELT (dref, chain->refs, j, a)
{
if (gimple_code (a->stmt) == GIMPLE_PHI)
{
dref a;
unsigned i, j;
- for (i = 0; VEC_iterate (chain_p, chains, i, chain); i++)
- for (j = 0; VEC_iterate (dref, chain->refs, j, a); j++)
+ FOR_EACH_VEC_ELT (chain_p, chains, i, chain)
+ FOR_EACH_VEC_ELT (dref, chain->refs, j, a)
if (a->stmt == NULL)
{
a->stmt = SSA_NAME_DEF_STMT (a->name_defined_by_phi);
chain_p ch1, ch2, cch;
VEC (chain_p, heap) *worklist = NULL;
- for (i = 0; VEC_iterate (chain_p, *chains, i, ch1); i++)
+ FOR_EACH_VEC_ELT (chain_p, *chains, i, ch1)
if (chain_can_be_combined_p (ch1))
VEC_safe_push (chain_p, heap, worklist, ch1);
if (!chain_can_be_combined_p (ch1))
continue;
- for (j = 0; VEC_iterate (chain_p, *chains, j, ch2); j++)
+ FOR_EACH_VEC_ELT (chain_p, *chains, j, ch2)
{
if (!chain_can_be_combined_p (ch2))
continue;
/* If we have replaced some looparound phi nodes, use their initializers
instead of creating our own. */
- for (i = 0; VEC_iterate (dref, chain->refs, i, laref); i++)
+ FOR_EACH_VEC_ELT (dref, chain->refs, i, laref)
{
if (gimple_code (laref->stmt) != GIMPLE_PHI)
continue;
VEC(tree,gc) *nlv = BLOCK_NONLOCALIZED_VARS (block);
pp_string (buffer, "NONLOCALIZED_VARS: ");
- for (i = 0; VEC_iterate (tree, nlv, i, t); i++)
+ FOR_EACH_VEC_ELT (tree, nlv, i, t)
{
dump_generic_node (buffer, t, 0, flags, false);
pp_string (buffer, " ");
unsigned nb_static_loops = 0;
gimple cond;
- for (i = 0; VEC_iterate (gimple, *exit_conditions, i, cond); i++)
+ FOR_EACH_VEC_ELT (gimple, *exit_conditions, i, cond)
{
tree res = number_of_latch_executions (loop_containing_stmt (cond));
if (chrec_contains_undetermined (res))
reset_chrecs_counters (&stats);
- for (i = 0; VEC_iterate (gimple, *exit_conditions, i, cond); i++)
+ FOR_EACH_VEC_ELT (gimple, *exit_conditions, i, cond)
{
struct loop *loop;
basic_block bb;
fprintf (file, "Declarations used by %s, sorted by DECL_UID:\n",
current_function_name ());
- for (ix = 0; VEC_iterate (numbered_tree, decl_list, ix, ntp); ix++)
+ FOR_EACH_VEC_ELT (numbered_tree, decl_list, ix, ntp)
{
if (ntp->t == last)
continue;
if (!accs)
return;
- for (i = 0; VEC_iterate (mem_ref_loc_p, accs->locs, i, loc); i++)
+ FOR_EACH_VEC_ELT (mem_ref_loc_p, accs->locs, i, loc)
free (loc);
VEC_free (mem_ref_loc_p, heap, accs->locs);
free (accs);
BITMAP_FREE (mem->indep_ref);
BITMAP_FREE (mem->dep_ref);
- for (i = 0; VEC_iterate (mem_ref_locs_p, mem->accesses_in_loop, i, accs); i++)
+ FOR_EACH_VEC_ELT (mem_ref_locs_p, mem->accesses_in_loop, i, accs)
free_mem_ref_locs (accs);
VEC_free (mem_ref_locs_p, heap, mem->accesses_in_loop);
accs = VEC_index (mem_ref_locs_p, ref->accesses_in_loop, loop->num);
if (accs)
{
- for (i = 0; VEC_iterate (mem_ref_loc_p, accs->locs, i, loc); i++)
+ FOR_EACH_VEC_ELT (mem_ref_loc_p, accs->locs, i, loc)
VEC_safe_push (mem_ref_loc_p, heap, *locs, loc);
}
}
VEC (mem_ref_loc_p, heap) *locs = NULL;
get_all_locs_in_loop (loop, ref, &locs);
- for (i = 0; VEC_iterate (mem_ref_loc_p, locs, i, loc); i++)
+ FOR_EACH_VEC_ELT (mem_ref_loc_p, locs, i, loc)
rewrite_mem_ref_loc (loc, tmp_var);
VEC_free (mem_ref_loc_p, heap, locs);
}
all dependencies. */
gsi_insert_on_edge (loop_latch_edge (loop), load);
- for (i = 0; VEC_iterate (edge, exits, i, ex); i++)
+ FOR_EACH_VEC_ELT (edge, exits, i, ex)
{
store = gimple_build_assign (unshare_expr (ref->mem), tmp_var);
gsi_insert_on_edge (ex, store);
base = TREE_OPERAND (base, 0);
get_all_locs_in_loop (loop, ref, &locs);
- for (i = 0; VEC_iterate (mem_ref_loc_p, locs, i, loc); i++)
+ FOR_EACH_VEC_ELT (mem_ref_loc_p, locs, i, loc)
{
if (!get_lim_data (loc->stmt))
continue;
unsigned i;
edge ex;
- for (i = 0; VEC_iterate (edge, exits, i, ex); i++)
+ FOR_EACH_VEC_ELT (edge, exits, i, ex)
if (ex->flags & EDGE_ABNORMAL)
return false;
VEC_free (mem_ref_p, heap, memory_accesses.refs_list);
htab_delete (memory_accesses.refs);
- for (i = 0; VEC_iterate (bitmap, memory_accesses.refs_in_loop, i, b); i++)
+ FOR_EACH_VEC_ELT (bitmap, memory_accesses.refs_in_loop, i, b)
BITMAP_FREE (b);
VEC_free (bitmap, heap, memory_accesses.refs_in_loop);
- for (i = 0; VEC_iterate (bitmap, memory_accesses.all_refs_in_loop, i, b); i++)
+ FOR_EACH_VEC_ELT (bitmap, memory_accesses.all_refs_in_loop, i, b)
BITMAP_FREE (b);
VEC_free (bitmap, heap, memory_accesses.all_refs_in_loop);
- for (i = 0; VEC_iterate (bitmap, memory_accesses.clobbered_vops, i, b); i++)
+ FOR_EACH_VEC_ELT (bitmap, memory_accesses.clobbered_vops, i, b)
BITMAP_FREE (b);
VEC_free (bitmap, heap, memory_accesses.clobbered_vops);
- for (i = 0; VEC_iterate (htab_t, memory_accesses.vop_ref_map, i, h); i++)
+ FOR_EACH_VEC_ELT (htab_t, memory_accesses.vop_ref_map, i, h)
htab_delete (h);
VEC_free (htab_t, heap, memory_accesses.vop_ref_map);
return false;
}
- for (i = 0; VEC_iterate (edge, to_remove, i, e); i++)
+ FOR_EACH_VEC_ELT (edge, to_remove, i, e)
{
bool ok = remove_path (e);
gcc_assert (ok);
data->max_inv_id = 0;
- for (i = 0; VEC_iterate (tree, decl_rtl_to_reset, i, obj); i++)
+ FOR_EACH_VEC_ELT (tree, decl_rtl_to_reset, i, obj)
SET_DECL_RTL (obj, NULL_RTX);
VEC_truncate (tree, decl_rtl_to_reset, 0);
free (wont_exit);
gcc_assert (ok);
- for (i = 0; VEC_iterate (edge, to_remove, i, e); i++)
+ FOR_EACH_VEC_ELT (edge, to_remove, i, e)
{
ok = remove_path (e);
gcc_assert (ok);
struct tree_niter_desc desc;
*exit = NULL;
- for (i = 0; VEC_iterate (edge, exits, i, ex); i++)
+ FOR_EACH_VEC_ELT (edge, exits, i, ex)
{
if (!just_once_each_iteration_p (loop, ex->src))
continue;
}
exits = get_loop_exit_edges (loop);
- for (i = 0; VEC_iterate (edge, exits, i, ex); i++)
+ FOR_EACH_VEC_ELT (edge, exits, i, ex)
{
if (!just_once_each_iteration_p (loop, ex->src))
continue;
&& VEC_length (edge, exits) > 1)
return chrec_dont_know;
- for (i = 0; VEC_iterate (edge, exits, i, ex); i++)
+ FOR_EACH_VEC_ELT (edge, exits, i, ex)
{
if (!just_once_each_iteration_p (loop, ex->src))
continue;
loop->any_estimate = false;
exits = get_loop_exit_edges (loop);
- for (i = 0; VEC_iterate (edge, exits, i, ex); i++)
+ FOR_EACH_VEC_ELT (edge, exits, i, ex)
{
if (!number_of_iterations_exit (loop, ex, &niter_desc, false))
continue;
gimple_stmt_iterator bsi;
unsigned i;
- for (i = 0; VEC_iterate (edge, exits, i, exit); i++)
+ FOR_EACH_VEC_ELT (edge, exits, i, exit)
{
call = gimple_build_call (FENCE_FOLLOWING_MOVNT, 0);
unsigned i;
edge exit;
- for (i = 0; VEC_iterate (edge, exits, i, exit); i++)
+ FOR_EACH_VEC_ELT (edge, exits, i, exit)
if ((exit->flags & EDGE_ABNORMAL)
&& exit->dest == EXIT_BLOCK_PTR)
ret = false;
strides = XCNEWVEC (HOST_WIDE_INT, n);
access_fns = DR_ACCESS_FNS (dr);
- for (i = 0; VEC_iterate (tree, access_fns, i, access_fn); i++)
+ FOR_EACH_VEC_ELT (tree, access_fns, i, access_fn)
{
/* Keep track of the reference corresponding to the subscript, so that we
know its stride. */
no_other_refs = false;
}
- for (i = 0; VEC_iterate (data_reference_p, datarefs, i, dr); i++)
+ FOR_EACH_VEC_ELT (data_reference_p, datarefs, i, dr)
{
dist = self_reuse_distance (dr, loop_data_size, n, loop);
ref = (struct mem_ref *) dr->aux;
compute_all_dependences (datarefs, &dependences, vloops, true);
- for (i = 0; VEC_iterate (ddr_p, dependences, i, dep); i++)
+ FOR_EACH_VEC_ELT (ddr_p, dependences, i, dep)
{
if (DDR_ARE_DEPENDENT (dep) == chrec_known)
continue;
/* Walk the dominator tree in preorder. */
bbs = get_all_dominated_blocks (CDI_DOMINATORS,
single_succ (ENTRY_BLOCK_PTR));
- for (i = 0; VEC_iterate (basic_block, bbs, i, bb); ++i)
+ FOR_EACH_VEC_ELT (basic_block, bbs, i, bb)
for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi))
did_something |= propagate_with_phi (bb, gsi_stmt (gsi), phivn, n);
}
exprs = sorted_array_from_bitmap_set (set);
- for (i = 0; VEC_iterate (pre_expr, exprs, i, expr); i++)
+ FOR_EACH_VEC_ELT (pre_expr, exprs, i, expr)
{
pre_expr translated;
translated = phi_translate (expr, set, NULL, pred, phiblock);
vn_reference_op_t vro;
unsigned int i;
- for (i = 0; VEC_iterate (vn_reference_op_s, ref->operands, i, vro); i++)
+ FOR_EACH_VEC_ELT (vn_reference_op_s, ref->operands, i, vro)
{
if (!vro_valid_in_sets (set1, set2, vro))
return false;
pre_expr expr;
int i;
- for (i = 0; VEC_iterate (pre_expr, exprs, i, expr); i++)
+ FOR_EACH_VEC_ELT (pre_expr, exprs, i, expr)
{
if (!valid_in_sets (set1, set2, expr, block))
bitmap_remove_from_set (set1, expr);
pre_expr expr;
int i;
- for (i = 0; VEC_iterate (pre_expr, exprs, i, expr); i++)
+ FOR_EACH_VEC_ELT (pre_expr, exprs, i, expr)
{
if (!valid_in_sets (set, NULL, expr, block))
bitmap_remove_from_set (set, expr);
else
bitmap_set_copy (ANTIC_OUT, ANTIC_IN (first));
- for (i = 0; VEC_iterate (basic_block, worklist, i, bprime); i++)
+ FOR_EACH_VEC_ELT (basic_block, worklist, i, bprime)
{
if (!gimple_seq_empty_p (phi_nodes (bprime)))
{
}
if (VEC_length (basic_block, worklist) > 0)
{
- for (i = 0; VEC_iterate (basic_block, worklist, i, bprime); i++)
+ FOR_EACH_VEC_ELT (basic_block, worklist, i, bprime)
{
unsigned int i;
bitmap_iterator bi;
memory reference is a simple induction variable. In other
cases the vectorizer won't do anything anyway (either it's
loop invariant or a complicated expression). */
- for (i = 0; VEC_iterate (vn_reference_op_s, ops, i, op); ++i)
+ FOR_EACH_VEC_ELT (vn_reference_op_s, ops, i, op)
{
switch (op->opcode)
{
pre_expr expr;
int i;
- for (i = 0; VEC_iterate (pre_expr, exprs, i, expr); i++)
+ FOR_EACH_VEC_ELT (pre_expr, exprs, i, expr)
{
if (expr->kind != NAME)
{
pre_expr expr;
int i;
- for (i = 0; VEC_iterate (pre_expr, exprs, i, expr); i++)
+ FOR_EACH_VEC_ELT (pre_expr, exprs, i, expr)
{
if (expr->kind != NAME)
{
/* We cannot remove stmts during BB walk, especially not release SSA
names there as this confuses the VN machinery. The stmts ending
up in to_remove are either stores or simple copies. */
- for (i = 0; VEC_iterate (gimple, to_remove, i, stmt); ++i)
+ FOR_EACH_VEC_ELT (gimple, to_remove, i, stmt)
{
tree lhs = gimple_assign_lhs (stmt);
tree rhs = gimple_assign_rhs1 (stmt);
candidates = sbitmap_alloc (length);
sbitmap_zero (candidates);
nr_candidates = 0;
- for (i = 0; VEC_iterate (operand_entry_t, *ops, i, oe1); ++i)
+ FOR_EACH_VEC_ELT (operand_entry_t, *ops, i, oe1)
{
enum tree_code dcode;
gimple oe1def;
linearize_expr_tree (&subops[i], oedef,
associative_tree_code (oecode), false);
- for (j = 0; VEC_iterate (operand_entry_t, subops[i], j, oe1); ++j)
+ FOR_EACH_VEC_ELT (operand_entry_t, subops[i], j, oe1)
{
oecount c;
void **slot;
{
oecount *c;
fprintf (dump_file, "Candidates:\n");
- for (j = 0; VEC_iterate (oecount, cvec, j, c); ++j)
+ FOR_EACH_VEC_ELT (oecount, cvec, j, c)
{
fprintf (dump_file, " %u %s: ", c->cnt,
c->oecode == MULT_EXPR
if (oecode != c->oecode)
continue;
- for (j = 0; VEC_iterate (operand_entry_t, subops[i], j, oe1); ++j)
+ FOR_EACH_VEC_ELT (operand_entry_t, subops[i], j, oe1)
{
if (oe1->op == c->op)
{
unsigned int i = 0;
tree negate;
- for (i = 0; VEC_iterate (tree, plus_negates, i, negate); i++)
+ FOR_EACH_VEC_ELT (tree, plus_negates, i, negate)
{
gimple user = get_single_immediate_use (negate);
operand_entry_t oe;
unsigned int i;
- for (i = 0; VEC_iterate (operand_entry_t, ops, i, oe); i++)
+ FOR_EACH_VEC_ELT (operand_entry_t, ops, i, oe)
{
fprintf (file, "Op %d -> rank: %d, tree: ", i, oe->rank);
print_generic_expr (file, oe->op, 0);
HOST_WIDE_INT off = -1;
bool deref = false;
- for (i = 0; VEC_iterate (vn_reference_op_s, vr1->operands, i, vro); i++)
+ FOR_EACH_VEC_ELT (vn_reference_op_s, vr1->operands, i, vro)
{
if (vro->opcode == MEM_REF)
deref = true;
/* Compute cumulative bit-offset for nested component-refs and array-refs,
and find the ultimate containing object. */
- for (i = 0; VEC_iterate (vn_reference_op_s, ops, i, op); ++i)
+ FOR_EACH_VEC_ELT (vn_reference_op_s, ops, i, op)
{
switch (op->opcode)
{
vn_reference_op_t vro;
unsigned int i;
- for (i = 0; VEC_iterate (vn_reference_op_s, orig, i, vro); i++)
+ FOR_EACH_VEC_ELT (vn_reference_op_s, orig, i, vro)
{
if (vro->opcode == SSA_NAME
|| (vro->op0 && TREE_CODE (vro->op0) == SSA_NAME))
else
VEC_truncate (vn_reference_op_s, vr->operands,
i + 1 + VEC_length (vn_reference_op_s, rhs));
- for (j = 0; VEC_iterate (vn_reference_op_s, rhs, j, vro); ++j)
+ FOR_EACH_VEC_ELT (vn_reference_op_s, rhs, j, vro)
VEC_replace (vn_reference_op_s, vr->operands, i + 1 + j, vro);
VEC_free (vn_reference_op_s, heap, rhs);
vr->hashcode = vn_reference_compute_hash (vr);
+ (INTEGRAL_TYPE_P (type)
? TYPE_PRECISION (type) + TYPE_UNSIGNED (type) : 0));
- for (i = 0; VEC_iterate (tree, vp1->phiargs, i, phi1op); i++)
+ FOR_EACH_VEC_ELT (tree, vp1->phiargs, i, phi1op)
{
if (phi1op == VN_TOP)
continue;
/* Any phi in the same block will have it's arguments in the
same edge order, because of how we store phi nodes. */
- for (i = 0; VEC_iterate (tree, vp1->phiargs, i, phi1op); i++)
+ FOR_EACH_VEC_ELT (tree, vp1->phiargs, i, phi1op)
{
tree phi2op = VEC_index (tree, vp2->phiargs, i);
if (phi1op == VN_TOP || phi2op == VN_TOP)
unsigned int i;
fprintf (out, "SCC consists of: ");
- for (i = 0; VEC_iterate (tree, scc, i, var); i++)
+ FOR_EACH_VEC_ELT (tree, scc, i, var)
{
print_generic_expr (out, var, 0);
fprintf (out, " ");
gcc_obstack_init (&optimistic_info->nary_obstack);
empty_alloc_pool (optimistic_info->phis_pool);
empty_alloc_pool (optimistic_info->references_pool);
- for (i = 0; VEC_iterate (tree, scc, i, var); i++)
+ FOR_EACH_VEC_ELT (tree, scc, i, var)
VN_INFO (var)->expr = NULL_TREE;
- for (i = 0; VEC_iterate (tree, scc, i, var); i++)
+ FOR_EACH_VEC_ELT (tree, scc, i, var)
changed |= visit_use (var);
}
/* Go over the list of constraints printing the edges in the constraint
graph. */
fprintf (file, "\n // The constraint edges:\n");
- for (i = 0; VEC_iterate (constraint_t, constraints, i, c); i++)
+ FOR_EACH_VEC_ELT (constraint_t, constraints, i, c)
if (c)
dump_constraint_edge (file, c);
int i;
constraint_t c;
- for (i = 0; VEC_iterate (constraint_t, *from, i, c); i++)
+ FOR_EACH_VEC_ELT (constraint_t, *from, i, c)
{
if (constraint_vec_find (*to, *c) == NULL)
{
gcc_assert (find (from) == to);
/* Move all complex constraints from src node into to node */
- for (i = 0; VEC_iterate (constraint_t, graph->complex[from], i, c); i++)
+ FOR_EACH_VEC_ELT (constraint_t, graph->complex[from], i, c)
{
/* In complex constraints for node src, we may have either
a = *src, and *src = a, or an offseted constraint which are
for (j = 0; j < VEC_length (varinfo_t, varmap); j++)
graph->indirect_cycles[j] = -1;
- for (i = 0; VEC_iterate (constraint_t, constraints, i, c); i++)
+ FOR_EACH_VEC_ELT (constraint_t, constraints, i, c)
{
struct constraint_expr lhs = c->lhs;
struct constraint_expr rhs = c->rhs;
unsigned i, t;
constraint_t c;
- for (i = 0; VEC_iterate (constraint_t, constraints, i, c); i++)
+ FOR_EACH_VEC_ELT (constraint_t, constraints, i, c)
{
struct constraint_expr lhs;
struct constraint_expr rhs;
int i;
constraint_t c;
- for (i = 0; VEC_iterate (constraint_t, constraints, i, c); i++)
+ FOR_EACH_VEC_ELT (constraint_t, constraints, i, c)
{
if (c)
{
for (j = 0; j < graph->size; j++)
gcc_assert (find (j) == j);
- for (i = 0; VEC_iterate (constraint_t, constraints, i, c); i++)
+ FOR_EACH_VEC_ELT (constraint_t, constraints, i, c)
{
struct constraint_expr lhs = c->lhs;
struct constraint_expr rhs = c->rhs;
solution_empty = bitmap_empty_p (solution);
/* Process the complex constraints */
- for (j = 0; VEC_iterate (constraint_t, complex, j, c); j++)
+ FOR_EACH_VEC_ELT (constraint_t, complex, j, c)
{
/* XXX: This is going to unsort the constraints in
some cases, which will occasionally add duplicate
struct constraint_expr *c;
unsigned int i = 0;
- for (i = 0; VEC_iterate (ce_s, *constraints, i, c); i++)
+ FOR_EACH_VEC_ELT (ce_s, *constraints, i, c)
{
if (c->type == SCALAR)
c->type = DEREF;
get_constraint_for_1 (t, results, true);
- for (i = 0; VEC_iterate (ce_s, *results, i, c); i++)
+ FOR_EACH_VEC_ELT (ce_s, *results, i, c)
{
if (c->type == DEREF)
c->type = SCALAR;
struct constraint_expr *rhsp;
unsigned j;
get_constraint_for_1 (val, &tmp, address_p);
- for (j = 0; VEC_iterate (ce_s, tmp, j, rhsp); ++j)
+ FOR_EACH_VEC_ELT (ce_s, tmp, j, rhsp)
VEC_safe_push (ce_s, heap, *results, rhsp);
VEC_truncate (ce_s, tmp, 0);
}
if (VEC_length (ce_s, lhsc) <= 1
|| VEC_length (ce_s, rhsc) <= 1)
{
- for (i = 0; VEC_iterate (ce_s, lhsc, i, lhsp); ++i)
- for (j = 0; VEC_iterate (ce_s, rhsc, j, rhsp); ++j)
+ FOR_EACH_VEC_ELT (ce_s, lhsc, i, lhsp)
+ FOR_EACH_VEC_ELT (ce_s, rhsc, j, rhsp)
process_constraint (new_constraint (*lhsp, *rhsp));
}
else
{
struct constraint_expr tmp;
tmp = new_scalar_tmp_constraint_exp ("allalltmp");
- for (i = 0; VEC_iterate (ce_s, rhsc, i, rhsp); ++i)
+ FOR_EACH_VEC_ELT (ce_s, rhsc, i, rhsp)
process_constraint (new_constraint (tmp, *rhsp));
- for (i = 0; VEC_iterate (ce_s, lhsc, i, lhsp); ++i)
+ FOR_EACH_VEC_ELT (ce_s, lhsc, i, lhsp)
process_constraint (new_constraint (*lhsp, tmp));
}
}
includes.type = SCALAR;
get_constraint_for (op, &rhsc);
- for (j = 0; VEC_iterate (ce_s, rhsc, j, c); j++)
+ FOR_EACH_VEC_ELT (ce_s, rhsc, j, c)
process_constraint (new_constraint (includes, *c));
VEC_free (ce_s, heap, rhsc);
}
lhsc.var = escaped_id;
lhsc.offset = 0;
lhsc.type = SCALAR;
- for (i = 0; VEC_iterate (ce_s, tmpc, i, c); ++i)
+ FOR_EACH_VEC_ELT (ce_s, tmpc, i, c)
process_constraint (new_constraint (lhsc, *c));
VEC_free(ce_s, heap, tmpc);
}
unsigned i;
struct constraint_expr *argp;
get_constraint_for (arg, &argc);
- for (i = 0; VEC_iterate (ce_s, argc, i, argp); ++i)
+ FOR_EACH_VEC_ELT (ce_s, argc, i, argp)
VEC_safe_push (ce_s, heap, *results, argp);
VEC_free(ce_s, heap, argc);
}
STRIP_NOPS (strippedrhs);
get_constraint_for (gimple_phi_arg_def (t, i), &rhsc);
- for (j = 0; VEC_iterate (ce_s, lhsc, j, c); j++)
+ FOR_EACH_VEC_ELT (ce_s, lhsc, j, c)
{
struct constraint_expr *c2;
while (VEC_length (ce_s, rhsc) > 0)
ac.var = integer_id;
}
ac.offset = 0;
- for (i = 0; VEC_iterate (ce_s, lhsc, i, lhsp); ++i)
+ FOR_EACH_VEC_ELT (ce_s, lhsc, i, lhsp)
process_constraint (new_constraint (*lhsp, ac));
VEC_free (ce_s, heap, lhsc);
return;
{
lhs = get_function_part_constraint (nfi, fi_static_chain);
get_constraint_for (frame, &rhsc);
- for (i = 0; VEC_iterate (ce_s, rhsc, i, rhsp); ++i)
+ FOR_EACH_VEC_ELT (ce_s, rhsc, i, rhsp)
process_constraint (new_constraint (lhs, *rhsp));
VEC_free (ce_s, heap, rhsc);
do_deref (&lhsc);
rhs = get_function_part_constraint (fi, ~0);
rhs.type = ADDRESSOF;
- for (i = 0; VEC_iterate (ce_s, lhsc, i, lhsp); ++i)
+ FOR_EACH_VEC_ELT (ce_s, lhsc, i, lhsp)
process_constraint (new_constraint (*lhsp, rhs));
VEC_free (ce_s, heap, lhsc);
/* va_list is clobbered. */
rhs = *VEC_index (ce_s, tem, 0);
VEC_free(ce_s, heap, tem);
}
- for (j = 0; VEC_iterate (ce_s, lhsc, j, lhsp); j++)
+ FOR_EACH_VEC_ELT (ce_s, lhsc, j, lhsp)
process_constraint (new_constraint (*lhsp, rhs));
}
get_constraint_for_address_of (lhsop, &rhsc);
lhs = get_function_part_constraint (fi, fi_result);
- for (j = 0; VEC_iterate (ce_s, rhsc, j, rhsp); j++)
+ FOR_EACH_VEC_ELT (ce_s, rhsc, j, rhsp)
process_constraint (new_constraint (lhs, *rhsp));
VEC_free (ce_s, heap, rhsc);
}
get_constraint_for (gimple_call_chain (t), &rhsc);
lhs = get_function_part_constraint (fi, fi_static_chain);
- for (j = 0; VEC_iterate (ce_s, rhsc, j, rhsp); j++)
+ FOR_EACH_VEC_ELT (ce_s, rhsc, j, rhsp)
process_constraint (new_constraint (lhs, *rhsp));
}
}
lhs = get_function_part_constraint (fi, fi_result);
get_constraint_for (gimple_return_retval (t), &rhsc);
- for (i = 0; VEC_iterate (ce_s, rhsc, i, rhsp); i++)
+ FOR_EACH_VEC_ELT (ce_s, rhsc, i, rhsp)
process_constraint (new_constraint (lhs, *rhsp));
}
}
rhsc.var = nonlocal_id;
rhsc.offset = 0;
rhsc.type = SCALAR;
- for (j = 0; VEC_iterate (ce_s, lhsc, j, lhsp); j++)
+ FOR_EACH_VEC_ELT (ce_s, lhsc, j, lhsp)
process_constraint (new_constraint (*lhsp, rhsc));
VEC_free (ce_s, heap, lhsc);
}
unsigned i;
get_constraint_for (ptr, &ptrc);
lhs = get_function_part_constraint (fi, fi_clobbers);
- for (i = 0; VEC_iterate (ce_s, ptrc, i, c); i++)
+ FOR_EACH_VEC_ELT (ce_s, ptrc, i, c)
process_constraint (new_constraint (lhs, *c));
VEC_free (ce_s, heap, ptrc);
}
unsigned i;
lhsc = get_function_part_constraint (fi, fi_clobbers);
get_constraint_for_address_of (lhs, &rhsc);
- for (i = 0; VEC_iterate (ce_s, rhsc, i, rhsp); i++)
+ FOR_EACH_VEC_ELT (ce_s, rhsc, i, rhsp)
process_constraint (new_constraint (lhsc, *rhsp));
VEC_free (ce_s, heap, rhsc);
}
unsigned i;
lhs = get_function_part_constraint (fi, fi_uses);
get_constraint_for_address_of (rhs, &rhsc);
- for (i = 0; VEC_iterate (ce_s, rhsc, i, rhsp); i++)
+ FOR_EACH_VEC_ELT (ce_s, rhsc, i, rhsp)
process_constraint (new_constraint (lhs, *rhsp));
VEC_free (ce_s, heap, rhsc);
}
struct constraint_expr *rhsp, *lhsp;
get_constraint_for_ptr_offset (dest, NULL_TREE, &lhsc);
lhs = get_function_part_constraint (fi, fi_clobbers);
- for (i = 0; VEC_iterate (ce_s, lhsc, i, lhsp); i++)
+ FOR_EACH_VEC_ELT (ce_s, lhsc, i, lhsp)
process_constraint (new_constraint (lhs, *lhsp));
VEC_free (ce_s, heap, lhsc);
get_constraint_for_ptr_offset (src, NULL_TREE, &rhsc);
lhs = get_function_part_constraint (fi, fi_uses);
- for (i = 0; VEC_iterate (ce_s, rhsc, i, rhsp); i++)
+ FOR_EACH_VEC_ELT (ce_s, rhsc, i, rhsp)
process_constraint (new_constraint (lhs, *rhsp));
VEC_free (ce_s, heap, rhsc);
return;
ce_s *lhsp;
get_constraint_for_ptr_offset (dest, NULL_TREE, &lhsc);
&nbs