be_liveness_dumpto
authorDaniel Grund <grund@cs.uni-saarland.de>
Wed, 14 Dec 2005 13:38:43 +0000 (13:38 +0000)
committerDaniel Grund <grund@cs.uni-saarland.de>
Wed, 14 Dec 2005 13:38:43 +0000 (13:38 +0000)
ir/be/belive.c
ir/be/belive.h

index ae17a63..bce0206 100644 (file)
@@ -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))) {
index c1e58fa..8f2ee6a 100644 (file)
@@ -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.