Commit 806e4c72 authored by Christoph Mallon's avatar Christoph Mallon
Browse files

Use foreach_ir_nodeset() instead of reimplementing it.

parent 406d820e
......@@ -43,8 +43,7 @@ static ir_node *random_select(void *block_env, ir_nodeset_t *ready_set)
(void)block_env;
/* assure that branches and constants are executed last */
ir_nodeset_iterator_init(&iter, ready_set);
while ( (irn = ir_nodeset_iterator_next(&iter)) != NULL) {
foreach_ir_nodeset(ready_set, irn, iter) {
if (!is_cfop(irn)) {
only_branches_left = 0;
break;
......@@ -60,8 +59,7 @@ static ir_node *random_select(void *block_env, ir_nodeset_t *ready_set)
/* take 1 random node */
int n = rand() % ir_nodeset_size(ready_set);
int i = 0;
ir_nodeset_iterator_init(&iter, ready_set);
while ((irn = ir_nodeset_iterator_next(&iter)) != NULL) {
foreach_ir_nodeset(ready_set, irn, iter) {
if (i == n) {
break;
}
......
......@@ -266,8 +266,7 @@ static ir_node *reg_pressure_select(void *block_env, ir_nodeset_t *ready_set)
assert(ir_nodeset_size(ready_set) > 0);
ir_nodeset_iterator_init(&iter, ready_set);
while ( (irn = ir_nodeset_iterator_next(&iter)) != NULL) {
foreach_ir_nodeset(ready_set, irn, iter) {
/*
Ignore branch instructions for the time being.
They should only be scheduled if there is nothing else.
......
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