outputs the layout type for yComp, makes nicer yComp dumps
[libfirm] / ir / ana / interval_analysis.c
index 5070200..9db46b6 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1995-2007 University of Karlsruhe.  All right reserved.
+ * Copyright (C) 1995-2008 University of Karlsruhe.  All right reserved.
  *
  * This file is part of libFirm.
  *
@@ -30,6 +30,7 @@
 #include <string.h>
 #endif
 
+#include "debug.h"
 #include "interval_analysis.h"
 #include "execution_frequency.h"
 #include "firm_common_t.h"
@@ -44,6 +45,8 @@
 #include "irprintf.h"
 #include "hashptr.h"
 
+DEBUG_ONLY(static firm_dbg_module_t *dbg);
+
 /*------------------------------------------------------------------*/
 /* A new in array via a hashmap. */
 /* The in array refers to the loop the block is contained in if the */
@@ -249,9 +252,7 @@ static void construct_interval_block(ir_node *b, ir_loop *l) {
 
     if (is_backedge(b, i)) {
       if (b != get_loop_element(l, 0).node) {
-        if (get_firm_verbosity()) {
-               ir_printf("Loophead not at loop position 0. %+F\n", b);
-        }
+       DB((dbg, LEVEL_1, "Loophead not at loop position 0. %+F\n", b));
       }
       /* There are no backedges in the interval decomposition. */
       add_region_in(b, NULL);
@@ -280,9 +281,7 @@ static void construct_interval_block(ir_node *b, ir_loop *l) {
       int found = find_inner_loop(b, l, pred, cfop);
       if (!found) {
            if (b != get_loop_element(l, 0).node) {
-             if (get_firm_verbosity()) {
-               ir_printf("Loop entry not at loop position 0. %+F\n", b);
-             }
+             DB((dbg, LEVEL_1, "Loop entry not at loop position 0. %+F\n", b));
            }
            found = find_outer_loop(l, pred_l, pred, cfop);
            if (found) add_region_in(b, NULL);  /* placeholder */
@@ -326,6 +325,8 @@ void construct_intervals(ir_graph *irg) {
   ir_graph *rem = current_ir_graph;
   current_ir_graph = irg;
 
+  FIRM_DBG_REGISTER(dbg, "firm.ana.interval");
+
   if (!region_attr_set)
     region_attr_set = new_set(region_attr_cmp, 256);
 
@@ -498,11 +499,12 @@ void dump_interval_graph(ir_graph *irg, const char *suffix) {
     return;
 
   f = vcg_open(irg, suffix, "-intervals");
-  dump_vcg_header(f, get_irg_dump_name(irg), NULL);
+  dump_vcg_header(f, get_irg_dump_name(irg), NULL, NULL);
 
   current_ir_graph = irg;
 
   dump_interval_loop(f, get_irg_loop(current_ir_graph));
 
-  vcg_close(f);
+  dump_vcg_footer(f);
+  fclose(f);
 }