X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fopt%2Freturn.c;h=55bde8a9a774d27b6381fa261bfa91a6af52897f;hb=52d1c7c57180cdb6aa12be48a1d41a961dc85174;hp=796baeb35353953b072e297ab25f62e52279d6ff;hpb=e1397b01aceb38b6bb62c319007146af3b922f39;p=libfirm diff --git a/ir/opt/return.c b/ir/opt/return.c index 796baeb35..55bde8a9a 100644 --- a/ir/opt/return.c +++ b/ir/opt/return.c @@ -30,6 +30,7 @@ #include "ircons_t.h" #include "irnode_t.h" #include "irgmod.h" +#include "irpass.h" #define set_bit(n) (returns[(n) >> 3] |= 1 << ((n) & 7)) #define get_bit(n) (returns[(n) >> 3] & (1 << ((n) & 7))) @@ -166,6 +167,12 @@ void normalize_one_return(ir_graph *irg) { set_irg_loopinfo_inconsistent(irg); } +/* Create a graph pass. */ +ir_graph_pass_t *normalize_one_return_pass(const char *name) +{ + return def_graph_pass(name ? name : "one_ret", normalize_one_return); +} + /** * Check, whether a Return can be moved on block upwards. * @@ -373,3 +380,9 @@ void normalize_n_returns(ir_graph *irg) { set_irg_outs_inconsistent(irg); set_irg_loopinfo_inconsistent(current_ir_graph); } + +/* Create a graph pass. */ +ir_graph_pass_t *normalize_n_returns_pass(const char *name) +{ + return def_graph_pass(name ? name : "n_rets", normalize_n_returns); +}