Add arch_get_register_req_out().
[libfirm] / ir / be / beutil.c
index 1f54d65..1637c4d 100644 (file)
@@ -23,9 +23,7 @@
  * @author      Sebastian Hack
  * @version     $Id$
  */
-#ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
 
 #include <stdio.h>
 
@@ -58,64 +56,6 @@ pset *be_empty_set(void)
        return empty_set;
 }
 
-static void dump_allocated_block(ir_node *block, void *data)
-{
-       FILE          *f = data;
-       const ir_node *irn;
-       int            n;
-       int            i;
-
-       ir_fprintf(f, "node:{title:\"b%N\"\nlabel:\"", block);
-       sched_foreach(block, irn) {
-               const char *prefix = "";
-
-               const arch_register_t *reg = arch_get_irn_register(irn);
-
-               ir_fprintf(f, "\n");
-               if(reg)
-                       ir_fprintf(f, "%s = ", arch_register_get_name(reg));
-
-               ir_fprintf(f, "%n(", irn);
-
-               if(block != get_irg_start_block(get_irn_irg(block))) {
-                       for(i = 0, n = get_irn_arity(irn); i < n; ++i) {
-                               ir_node *op = get_irn_n(irn, i);
-                               if (arch_is_register_operand(op, -1)) {
-                                       ir_fprintf(f, "%s%s", prefix,
-                                               arch_register_get_name(arch_get_irn_register(op)));
-                                       prefix = ", ";
-                               }
-                       }
-               }
-
-               ir_fprintf(f, ")");
-       }
-       ir_fprintf(f, "\"}\n");
-
-       if(get_irg_start_block(get_irn_irg(block)) != block) {
-               for(i = 0, n = get_irn_arity(block); i < n; ++i) {
-                       ir_node *pred_bl = get_nodes_block(get_irn_n(block, i));
-                       ir_fprintf(f, "edge:{sourcename:\"b%N\" targetname:\"b%N\"}\n", block, pred_bl);
-               }
-       }
-}
-
-void dump_allocated_irg(ir_graph *irg, char *suffix)
-{
-       char  buf[1024];
-       FILE *f;
-
-       ir_snprintf(buf, sizeof(buf), "%F-alloc%s.vcg", irg, suffix);
-
-       f = fopen(buf, "wt");
-       if (f != NULL) {
-               fprintf(f, "graph:{title:\"prg\"\n");
-               irg_block_walk_graph(irg, dump_allocated_block, NULL, f);
-               fprintf(f, "}\n");
-               fclose(f);
-       }
-}
-
 /**
  * Edge hook to dump the schedule edges.
  */
@@ -175,18 +115,6 @@ void be_dump(ir_graph *irg, const char *suffix, void (*dumper)(ir_graph *, const
        dumper(irg, buf);
 }
 
-
-
-static void collect_phis(ir_node *irn, void *data)
-{
-       (void) data;
-       if(is_Phi(irn)) {
-               ir_node *bl = get_nodes_block(irn);
-               set_irn_link(irn, get_irn_link(bl));
-               set_irn_link(bl, irn);
-       }
-}
-
 void be_clear_links(ir_graph *irg)
 {
        ir_reserve_resources(irg, IR_RESOURCE_IRN_LINK);
@@ -194,11 +122,6 @@ void be_clear_links(ir_graph *irg)
        ir_free_resources(irg, IR_RESOURCE_IRN_LINK);
 }
 
-void be_collect_phis(ir_graph *irg)
-{
-       irg_walk_graph(irg, collect_phis, NULL, NULL);
-}
-
 static void count_num_reachable_nodes(ir_node *irn, void *env)
 {
        int *num = env;