X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;ds=sidebyside;f=ir%2Fir%2Firphase_t.h;h=ae30de23389adbbb83bd3d53917d15d84e782f22;hb=2763e57ac1a5a9bd20d50064658a1d20f0be77ca;hp=9329ab595999c43c5902d5ec1b0da112395baa21;hpb=93ec9eb45d1630e73ed4932d66683adcc9c28d71;p=libfirm diff --git a/ir/ir/irphase_t.h b/ir/ir/irphase_t.h index 9329ab595..ae30de233 100644 --- a/ir/ir/irphase_t.h +++ b/ir/ir/irphase_t.h @@ -85,6 +85,28 @@ void phase_reinit_irn_data(phase_t *phase); */ void phase_reinit_single_irn_data(phase_t *phase, ir_node *irn); +/** + * Returns the first node of the phase having some data assigned. + * @param phase The phase. + * @return The first irn having some data assigned, NULL otherwise + */ +ir_node *phase_get_first_node(phase_t *phase); + +/** + * Returns the next node after @p start having some data assigned. + * @param phase The phase. + * @param start The node to start from + * @return The next node after start having some data assigned, NULL otherwise + */ +ir_node *phase_get_next_node(phase_t *phase, ir_node *start); + +/** + * Convenience macro to iterate over all nodes of a phase + * having some data assigned. + */ +#define foreach_phase_irn(phase, irn) \ + for (irn = phase_get_first_node(phase); irn; irn = phase_get_next_node(phase, irn)) + /** * Get the name of the phase. */ @@ -202,5 +224,4 @@ static INLINE void *_phase_get_or_set_irn_data(phase_t *ph, ir_node *irn) return res; } - #endif /* _FIRM_IR_PHASE_T_H */