add dumping hook
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Wed, 23 Jul 2008 16:18:33 +0000 (16:18 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Wed, 23 Jul 2008 16:18:33 +0000 (16:18 +0000)
[r20631]

ir/opt/combo.c

index f60c484..a8b5871 100644 (file)
@@ -1123,6 +1123,14 @@ static void set_compute_functions(void) {
        SET(End);
 }  /* set_compute_functions */
 
+static int dump_partition_hook(FILE *F, ir_node *n, ir_node *local) {
+       ir_node *irn = local != NULL ? local : n;
+       node_t *node = get_irn_node(n);
+
+       ir_fprintf(F, "info2 : \"partition %u type %+F\"\n", node->part->nr, node->type);
+       return 1;
+}
+
 void combo(ir_graph *irg) {
        environment_t env;
        ir_node       *start_bl, *initial_X;
@@ -1180,6 +1188,10 @@ void combo(ir_graph *irg) {
 
        dump_all_partitions(&env);
 
+       set_dump_node_vcgattr_hook(dump_partition_hook);
+       dump_ir_block_graph(irg, "-partition");
+
+
        /* apply the result */
        irg_walk_graph(irg, NULL, apply_result, &env);