X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=include%2Flibfirm%2Flowering.h;h=f54ce72c0e0bc2ef6e9dac46a3d298c948d0ee04;hb=94f6c873ed355ad4480e62d1b3aa47899148c436;hp=51cf0eef3ee9b347c0e7b4b6ca1b493ea0082bc4;hpb=c06a58401a4cde698aa098d52321ad9ed6f96563;p=libfirm diff --git a/include/libfirm/lowering.h b/include/libfirm/lowering.h index 51cf0eef3..f54ce72c0 100644 --- a/include/libfirm/lowering.h +++ b/include/libfirm/lowering.h @@ -254,8 +254,8 @@ ir_graph_pass_t *lower_highlevel_graph_pass(const char *name, int lower_bitfield * Handle bit fields by added And/Or calculations. * Lowers all graphs. * - * @Note: There is NO lowering of objects oriented types. This is highly compiler - * and ABI specific and should be placed directly in the compiler. + * @note There is NO lowering of objects oriented types. This is highly compiler + * and ABI specific and should be placed directly in the compiler. */ void lower_highlevel(int lower_bitfields); @@ -305,6 +305,37 @@ void ir_lower_mode_b(ir_graph *irg, const lower_mode_b_config_t *config); ir_graph_pass_t *ir_lower_mode_b_pass( const char *name, const lower_mode_b_config_t *config); +/** + * Used as callback, whenever a lowerable mux is found. The return value + * indicates, whether the mux should be lowered. This may be used, to lower + * floating point muxes, while keeping mux nodes for integers, for example. + * + * @param mux The mux node that may be lowered. + * @return A non-zero value indicates that the mux should be lowered. + */ +typedef int lower_mux_callback(ir_node* mux); + +/** + * Lowers all mux nodes in the given graph. A callback function may be + * given, to select the mux nodes to lower. + * + * @param irg The graph to lower mux nodes in. + * @param cb_func The callback function for mux selection. Can be NULL, + * to lower all mux nodes. + */ +void lower_mux(ir_graph *irg, lower_mux_callback *cb_func); + +/** + * Creates an ir_graph pass for lower_mux(). + * + * @param name the name of this pass or NULL + * @param cb_func The callback function for mux selection. Can be NULL, + * to lower all mux nodes. + * + * @return the newly created ir_graph pass + */ +ir_graph_pass_t *lower_mux_pass(const char *name, lower_mux_callback *cb_func); + /** * An intrinsic mapper function. *