From 32277076cb0d3e89849b42ce37536c300c30c0c7 Mon Sep 17 00:00:00 2001 From: Daniel Grund Date: Wed, 14 Dec 2005 13:38:43 +0000 Subject: [PATCH] be_liveness_dumpto --- ir/be/belive.c | 11 +++++++++++ ir/be/belive.h | 7 +++++++ 2 files changed, 18 insertions(+) diff --git a/ir/be/belive.c b/ir/be/belive.c index ae17a6338..bce020659 100644 --- a/ir/be/belive.c +++ b/ir/be/belive.c @@ -190,6 +190,17 @@ void be_liveness_dump(ir_graph *irg, FILE *f) irg_block_walk_graph(irg, dump_liveness_walker, NULL, f); } +void be_liveness_dumpto(ir_graph *irg, const char *cls_name) +{ + FILE *f; + char buf[128]; + ir_snprintf(buf, sizeof(buf), "%F_%s-live.txt", irg, cls_name); + if((f = fopen(buf, "wt")) != NULL) { + be_liveness_dump(irg, f); + fclose(f); + } +} + static void dom_check(ir_node *irn, void *data) { if(!is_Block(irn) && irn != get_irg_end(get_irn_irg(irn))) { diff --git a/ir/be/belive.h b/ir/be/belive.h index c1e58fa0d..8f2ee6a4b 100644 --- a/ir/be/belive.h +++ b/ir/be/belive.h @@ -22,6 +22,13 @@ void be_liveness(ir_graph *irg); */ void be_liveness_dump(ir_graph *irg, FILE *f); +/** + * Dump the liveness information for a graph. + * @param irg The graph. + * @param cls_name A string used as substing in the filename. + */ +void be_liveness_dumpto(ir_graph *irg, const char *cls_name); + /** * Check, if a node is live in at a block. * @param block The block. -- 2.20.1