Commit c908d078 authored by Christoph Mallon's avatar Christoph Mallon
Browse files

Let bitset_foreach() and bitset_foreach_clear() declare their iterator variables.

parent 2d59e46c
......@@ -225,12 +225,12 @@ static inline size_t bitset_next_set(const bitset_t *bs, size_t pos)
* @param bitset The bitset.
* @param elm A size_t variable.
*/
#define bitset_foreach(bitset,elm) \
for(elm = bitset_next_set(bitset,0); elm != (size_t)-1; elm = bitset_next_set(bitset,elm+1))
#define bitset_foreach(bitset, elm) \
for (size_t elm = 0; (elm = bitset_next_set((bitset), elm)) != (size_t)-1; ++elm)
#define bitset_foreach_clear(bitset,elm) \
for(elm = bitset_next_clear(bitset,0); elm != (size_t) -1; elm = bitset_next_clear(bitset,elm+1))
#define bitset_foreach_clear(bitset, elm) \
for (size_t elm = 0; (elm = bitset_next_clear((bitset), elm)) != (size_t)-1; ++elm)
/**
* Count the bits set.
......
......@@ -166,8 +166,6 @@ static void compute_back_edge_chain(lv_chk_t *lv, const ir_node *bl)
bitset_t *tmp = bitset_alloca(lv->n_blocks);
bl_info_t *bi = get_block_info(lv, bl);
size_t elm;
DBG((lv->dbg, LEVEL_2, "computing T_%d\n", bi->id));
/* put all back edge sources reachable (reduced) from here in tmp */
......@@ -202,7 +200,6 @@ static void compute_back_edge_chain(lv_chk_t *lv, const ir_node *bl)
static inline void compute_back_edge_chains(lv_chk_t *lv)
{
size_t elm;
int i, n;
DBG((lv->dbg, LEVEL_2, "back edge sources: %B\n", lv->back_edge_src));
......
......@@ -176,7 +176,6 @@ static ir_node *handle_constraints(be_chordal_alloc_env_t *alloc_env,
int *assignment;
pmap *partners;
int i, n_alloc;
size_t col;
ir_node *perm = NULL;
//int match_res, cost;
be_chordal_env_t *env = alloc_env->chordal_env;
......@@ -360,7 +359,7 @@ static ir_node *handle_constraints(be_chordal_alloc_env_t *alloc_env,
DBG((dbg, LEVEL_2, "\tchecking reg of %+F: %s\n", proj, reg ? reg->name : "<none>"));
if (reg == NULL) {
col = get_next_free_reg(alloc_env, bs);
size_t const col = get_next_free_reg(alloc_env, bs);
reg = arch_register_for_index(env->cls, col);
bitset_set(bs, reg->index);
arch_set_irn_register(proj, reg);
......
......@@ -117,7 +117,6 @@ void create_borders(ir_node *block, void *env_ptr)
be_lv_t *lv = be_get_irg_liveness(env->irg);
int i, n;
size_t elm;
unsigned step = 0;
unsigned pressure = 0;
struct list_head *head;
......
......@@ -399,7 +399,6 @@ static inline void qnode_max_ind_set(qnode_t *qn, const unit_t *ou)
ir_node **safe, **unsafe;
int i, o, safe_count, safe_costs, unsafe_count, *unsafe_costs;
bitset_t *curr, *best;
size_t pos;
int next, curr_weight, best_weight = 0;
/* assign the nodes into two groups.
......
......@@ -337,7 +337,6 @@ static void determine_color_costs(co2_t *env, co2_irn_t *ci, col_cost_pair_t *co
bitset_t *forb = bitset_alloca(n_regs);
affinity_node_t *a = ci->aff;
size_t elm;
const ir_node *pos;
neighbours_iter_t it;
int i;
......@@ -620,7 +619,6 @@ static void node_color_badness(co2_cloud_irn_t *ci, int *badness)
be_ifg_t *ifg = env->co->cenv->ifg;
bitset_t *bs = bitset_alloca(n_regs);
size_t elm;
const ir_node *irn;
neighbours_iter_t it;
......
......@@ -235,7 +235,6 @@ static void dbg_aff_chunk(const co_mst_env_t *env, const aff_chunk_t *c)
*/
static void dbg_admissible_colors(const co_mst_env_t *env, const co_mst_irn_t *node)
{
size_t idx;
(void) env;
if (bitset_popcount(node->adm_colors) < 1)
......@@ -583,7 +582,6 @@ static void aff_chunk_assure_weight(co_mst_env_t *env, aff_chunk_t *c)
node->chunk = c;
if (node->constr_factor > REAL(0.0)) {
size_t col;
bitset_foreach (node->adm_colors, col)
c->color_affinity[col].cost += node->constr_factor;
}
......
......@@ -331,7 +331,6 @@ static int ou_max_ind_set_costs(unit_t *ou)
ir_node **safe, **unsafe;
int i, o, safe_count, safe_costs, unsafe_count, *unsafe_costs;
bitset_t *curr;
size_t pos;
int curr_weight, best_weight = 0;
/* assign the nodes into two groups.
......
......@@ -66,7 +66,6 @@ static int bitset_emit(lc_appendable_t *app,
{
int res = 2;
bitset_t *b = (bitset_t*)arg->v_ptr;
size_t p;
char buf[32];
const char *prefix = "";
......
......@@ -795,7 +795,6 @@ static void verify_edge_counter(ir_node *irn, void *env)
int list_cnt;
int ref_cnt;
int edge_cnt;
size_t idx;
const struct list_head *head;
const struct list_head *pos;
ir_graph *irg;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment