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