This makes the arguments match the (thing, container) pattern used in
other nir_foreach macros and also renames it to make that a bit more
clear.
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
init_block(block, worklist);
}
- nir_instr *instr = NULL;
- nir_instr_worklist_foreach(worklist, instr)
+ nir_foreach_instr_in_worklist(instr, worklist)
nir_foreach_src(instr, mark_live_cb, worklist);
nir_instr_worklist_destroy(worklist);
return *vec_instr;
}
-#define nir_instr_worklist_foreach(wl, instr) \
- while ((instr = nir_instr_worklist_pop_head(wl)))
+#define nir_foreach_instr_in_worklist(instr, wl) \
+ for (nir_instr *instr; (instr = nir_instr_worklist_pop_head(wl));)
#ifdef __cplusplus
} /* extern "C" */