X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fcommon%2Firtools.c;h=37eae69fb1038b226a5ecca503039086d38f42e3;hb=20742ebed71c0e1c703185128afb18d986ad5db9;hp=1962b52e80f343dcd3e3a92ec84d011a145f20bf;hpb=c9d6913e69c2f9274055b846d25a7707fa326c49;p=libfirm diff --git a/ir/common/irtools.c b/ir/common/irtools.c index 1962b52e8..37eae69fb 100644 --- a/ir/common/irtools.c +++ b/ir/common/irtools.c @@ -13,10 +13,13 @@ # include "config.h" #endif +#include "pset.h" + #include #include "irnode_t.h" #include "irbackedge_t.h" #include "irtools.h" +#include "irprintf.h" /* the famous clear_link implementation. */ void firm_clear_link(ir_node *n, void *env) { @@ -96,14 +99,14 @@ copy_irn_to_irg(ir_node *n, ir_graph *irg) /* * Creates an exact copy of a node. - * The copy resists on the sane graph in the same block. + * The copy resides in the same graph in the same block. */ -ir_node *exact_copy(ir_node *n) { +ir_node *exact_copy(const ir_node *n) { ir_graph *irg = get_irn_irg(n); ir_node *res, *block = NULL; if (is_no_Block(n)) - block = get_irn_n(n, -1); + block = get_nodes_block(n); res = new_ir_node(get_irn_dbg_info(n), irg, @@ -121,3 +124,12 @@ ir_node *exact_copy(ir_node *n) { new_backedge_info(res); return res; } + +void firm_pset_dump(pset *set) +{ + void *obj; + + foreach_pset(set, obj) { + ir_fprintf(stderr, "%+F\n", obj); + } +}