X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fir%2Firphase.h;h=965d9c710300b258805b8bdff66d79fc11db7e30;hb=357886575cb0becb5bd9be376fde49b57edd5385;hp=3b5ba50200e15992955dcbeaa79c2ce7be1acbbb;hpb=7c36344d22a7c306a4e216f135c974bdb9f6b943;p=libfirm diff --git a/ir/ir/irphase.h b/ir/ir/irphase.h index 3b5ba5020..965d9c710 100644 --- a/ir/ir/irphase.h +++ b/ir/ir/irphase.h @@ -29,7 +29,9 @@ #include "firm_types.h" typedef struct ir_phase ir_phase; -typedef void *(phase_irn_init)(ir_phase *phase, const ir_node *irn, void *old); +typedef void *(phase_irn_init)(ir_phase *phase, const ir_node *irn); +typedef void *(phase_irn_reinit)(ir_phase *phase, const ir_node *irn, + void *old_data); /** * Allocate and initialize a new phase object @@ -37,6 +39,7 @@ typedef void *(phase_irn_init)(ir_phase *phase, const ir_node *irn, void *old); * @param irg The graph the phase will run on. * @param irn_data_init A callback that is called to initialize newly created * node data. Must be non-null. You could use + * phase_irn_init_default * @return A new phase object. */ ir_phase *new_phase(ir_graph *irg, phase_irn_init *data_init); @@ -44,7 +47,7 @@ ir_phase *new_phase(ir_graph *irg, phase_irn_init *data_init); /** * Variant for custom memory-management/classes. Just initialize given phase * structure (performs no allocation, you do not need to call this for phases - * allocated wiht new_phase) + * allocated with new_phase) */ void phase_init(ir_phase *phase, ir_graph *irg, phase_irn_init *data_init); @@ -60,21 +63,15 @@ void phase_deinit(ir_phase *phase); void phase_free(ir_phase *phase); /** - * Re-initialize the irn data for all nodes in the node => data map using the given callback. + * Re-initialize the irn data for all nodes in the node => data map using the + * given callback. + * This is mainly used for reusing already allocated memory which could speed + * things up a little bit. * - * @param phase The phase. + * @param phase The phase. + * @param called to reinitialize phase data. */ -void phase_reinit_irn_data(ir_phase *phase); - -/** - * Re-initialize the irn data for all nodes having phase data in the given block. - * - * @param phase The phase. - * @param block The block. - * - * @note Beware: iterates over all nodes in the graph to find the nodes of the given block. - */ -void phase_reinit_block_irn_data(ir_phase *phase, ir_node *block); +void phase_reinit_irn_data(ir_phase *phase, phase_irn_reinit *data_reinit); /** * A default node initializer.