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

Add the * for the type in foreach_set() automatically.

parent de2ab604
......@@ -197,7 +197,7 @@ FIRM_API void set_break(set *set);
* @param type type of iterator variable
* @param entry the iterator
*/
#define foreach_set(set, type, entry) for (entry = (type) set_first(set); entry; entry = (type) set_next(set))
#define foreach_set(set, type, entry) for (entry = (type*)set_first(set); entry; entry = (type*)set_next(set))
/** @cond PRIVATE */
......
......@@ -119,7 +119,7 @@ static void classify_edges(dfs_t *dfs)
stat_ev_cnt_decl(fwd);
stat_ev_cnt_decl(cross);
foreach_set (dfs->edges, dfs_edge_t*, edge) {
foreach_set (dfs->edges, dfs_edge_t, edge) {
dfs_node_t *src = edge->s;
dfs_node_t *tgt = edge->t;
......@@ -192,7 +192,7 @@ dfs_t *dfs_new(const absgraph_t *graph_impl, void *graph_self)
assert(res->pre_num == res->post_num);
res->pre_order = XMALLOCN(dfs_node_t*, res->pre_num);
res->post_order = XMALLOCN(dfs_node_t*, res->post_num);
foreach_set (res->nodes, dfs_node_t*, node) {
foreach_set (res->nodes, dfs_node_t, node) {
assert(node->pre_num < res->pre_num);
assert(node->post_num < res->post_num);
......@@ -255,7 +255,7 @@ void dfs_dump(const dfs_t *dfs, FILE *file)
int i, n = 0;
ir_fprintf(file, "digraph G {\nranksep=0.5\n");
foreach_set (dfs->nodes, dfs_node_t*, node) {
foreach_set (dfs->nodes, dfs_node_t, node) {
nodes[n++] = node;
}
......@@ -283,7 +283,7 @@ void dfs_dump(const dfs_t *dfs, FILE *file)
#endif
}
foreach_set (dfs->edges, dfs_edge_t*, edge)
foreach_set (dfs->edges, dfs_edge_t, edge)
dfs_dump_edge(edge, file);
ir_fprintf(file, "}\n");
......
......@@ -957,7 +957,7 @@ void arm_gen_routine(ir_graph *irg)
be_emit_cstring("\t.align 2\n");
foreach_set(sym_or_tv, sym_or_tv_t*, entry) {
foreach_set(sym_or_tv, sym_or_tv_t, entry) {
emit_constant_name(entry);
be_emit_cstring(":\n");
be_emit_write_line();
......
......@@ -642,7 +642,7 @@ static void create_memperms(be_fec_env_t *env)
{
memperm_t *memperm;
foreach_set(env->memperms, memperm_t*, memperm) {
foreach_set(env->memperms, memperm_t, memperm) {
ir_node **nodes = ALLOCAN(ir_node*, memperm->entrycount);
memperm_entry_t *entry;
ir_node *blockend;
......
......@@ -890,7 +890,7 @@ void be_insert_spills_reloads(spill_env_t *env)
}
/* process each spilled node */
foreach_set(env->spills, spill_info_t*, si) {
foreach_set(env->spills, spill_info_t, si) {
ir_node *to_spill = si->to_spill;
ir_node **copies = NEW_ARR_F(ir_node*, 0);
double all_remat_costs = 0; /** costs when we would remat all nodes */
......
......@@ -152,7 +152,7 @@ static void insert_all_perms_walker(ir_node *bl, void *data)
* above in the arg_set and insert it into the schedule.
*/
in = XMALLOCN(ir_node*, n_projs);
foreach_set(arg_set, perm_proj_t*, pp) {
foreach_set(arg_set, perm_proj_t, pp) {
in[pp->pos] = pp->arg;
}
......@@ -171,7 +171,7 @@ static void insert_all_perms_walker(ir_node *bl, void *data)
* arguments to the projs (new phi arguments).
*/
insert_after = perm;
foreach_set(arg_set, perm_proj_t*, pp) {
foreach_set(arg_set, perm_proj_t, pp) {
ir_node *proj = new_r_Proj(perm, get_irn_mode(pp->arg), pp->pos);
pp->proj = proj;
assert(arch_get_irn_register(pp->arg));
......
......@@ -520,7 +520,7 @@ static void check_spillslot_interference(be_verify_spillslots_env_t *env)
int i;
i = 0;
foreach_set(env->spills, spill_t*, spill) {
foreach_set(env->spills, spill_t, spill) {
spills[i++] = spill;
}
......
......@@ -749,7 +749,7 @@ void scalar_replacement_opt(ir_graph *irg)
if (nvals > 0) {
do_scalar_replacements(irg, sels, nvals, modes);
foreach_set(set_ent, scalars_t*, value) {
foreach_set(set_ent, scalars_t, value) {
free_entity(value->ent);
}
......
Supports Markdown
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