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

Use foreach_set() instead of reimplementing it.

parent b402f0c1
......@@ -621,8 +621,7 @@ static void ou_optimize(unit_t *ou)
}
/* set color of all changed nodes */
for (ns = (node_stat_t*)set_first(curr->changed_nodes); ns != NULL;
ns = (node_stat_t*)set_next(curr->changed_nodes)) {
foreach_set(curr->changed_nodes, node_stat_t, ns) {
/* NO_COLOR is possible, if we had an undo */
if (ns->new_color != NO_COLOR) {
DBG((dbg, LEVEL_1, "\t color(%+F) := %d\n", ns->irn, ns->new_color));
......
......@@ -149,10 +149,7 @@ static inline affinity_node_t *get_affinity_info(const copy_opt_t *co, const ir_
return (affinity_node_t*)set_find(co->nodes, &find, sizeof(find), hash_irn(irn));
}
#define co_gs_nodes_begin(co) set_first((co)->nodes)
#define co_gs_nodes_next(co) set_next((co)->nodes)
#define co_gs_foreach_aff_node(co, aff_node) for (aff_node = (affinity_node_t*)co_gs_nodes_begin(co); aff_node != NULL; aff_node = (affinity_node_t*)co_gs_nodes_next(co))
#define co_gs_foreach_aff_node(co, aff_node) foreach_set((co)->nodes, affinity_node_t, (aff_node))
#define co_gs_foreach_neighb(aff_node, neighb) for (neighb = aff_node->neighbours; neighb != NULL; neighb = neighb->next)
#endif /* FIRM_BE_BECOPYOPT_T_H */
......@@ -397,8 +397,7 @@ void free_inh_transitive_closure(void)
{
if (tr_inh_trans_set) {
tr_inh_trans_tp *elt;
for (elt = (tr_inh_trans_tp*)set_first(tr_inh_trans_set); elt != NULL;
elt = (tr_inh_trans_tp*)set_next(tr_inh_trans_set)) {
foreach_set(tr_inh_trans_set, tr_inh_trans_tp, elt) {
del_pset(elt->directions[d_up]);
del_pset(elt->directions[d_down]);
}
......
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