out edges for entities and types
[libfirm] / ir / ir / irdump.c
index ccb134a..8d5227b 100644 (file)
@@ -564,7 +564,7 @@ static int dump_node_typeinfo(FILE *F, ir_node *n) {
   if (opt_dump_analysed_type_info) {
     if (get_irg_typeinfo_state(current_ir_graph) == irg_typeinfo_consistent  ||
         get_irg_typeinfo_state(current_ir_graph) == irg_typeinfo_inconsistent) {
-      type *tp = get_irn_type(n);
+      type *tp = get_irn_typeinfo_type(n);
       if (tp != none_type)
         fprintf(F, " [%s]", get_type_name_ex(tp, &bad));
       else
@@ -715,9 +715,9 @@ static INLINE int dump_node_info(FILE *F, ir_node *n)
       int i, n_cfgpreds = get_Block_cg_n_cfgpreds(sbl);
       fprintf(F, "graph has %d interprocedural predecessors:\n", n_cfgpreds);
       for (i = 0; i < n_cfgpreds; ++i) {
-       ir_node *cfgpred = get_Block_cg_cfgpred(sbl, i);
-       fprintf(F, "  %d: Call %ld in graph %s\n", i, get_irn_node_nr(cfgpred),
-               get_irg_dump_name(get_irn_irg(cfgpred)));
+    ir_node *cfgpred = get_Block_cg_cfgpred(sbl, i);
+    fprintf(F, "  %d: Call %ld in graph %s\n", i, get_irn_node_nr(cfgpred),
+        get_irg_dump_name(get_irn_irg(cfgpred)));
       }
     }
   } break;
@@ -742,10 +742,12 @@ static INLINE int dump_node_info(FILE *F, ir_node *n)
   case iro_Call: {
     type *tp = get_Call_type(n);
     fprintf(F, "calling method of type %s \n", get_type_name_ex(tp, &bad));
-    for (i = 0; i < get_method_n_params(tp); ++i)
-      fprintf(F, "  param %d type: %s \n", i, get_type_name_ex(get_method_param_type(tp, i), &bad));
-    for (i = 0; i < get_method_n_ress(tp); ++i)
-      fprintf(F, "  resul %d type: %s \n", i, get_type_name_ex(get_method_res_type(tp, i), &bad));
+    if(get_unknown_type() != tp) {
+      for (i = 0; i < get_method_n_params(tp); ++i)
+       fprintf(F, "  param %d type: %s \n", i, get_type_name_ex(get_method_param_type(tp, i), &bad));
+      for (i = 0; i < get_method_n_ress(tp); ++i)
+       fprintf(F, "  resul %d type: %s \n", i, get_type_name_ex(get_method_res_type(tp, i), &bad));
+    }
     if (Call_has_callees(n)) {
       fprintf(F, "possible callees: \n");
       for (i = 0; i < get_Call_n_callees(n); i++) {
@@ -799,6 +801,7 @@ static INLINE int dump_node_info(FILE *F, ir_node *n)
       fprintf(F, "kind size\n");
       break;
     }
+    fprintf(F, "SymConst of type %s \n", get_type_name_ex(get_SymConst_value_type(n), &bad));
   } break;
   case iro_Filter: {
     int i;
@@ -829,8 +832,8 @@ static INLINE int dump_node_info(FILE *F, ir_node *n)
 
   if (get_irg_typeinfo_state(get_irn_irg(n)) == irg_typeinfo_consistent  ||
       get_irg_typeinfo_state(get_irn_irg(n)) == irg_typeinfo_inconsistent  )
-    if (get_irn_type(n) != none_type)
-      fprintf (F, "\nAnalysed type: %s", get_type_name_ex(get_irn_type(n), &bad));
+    if (get_irn_typeinfo_type(n) != none_type)
+      fprintf (F, "\nAnalysed type: %s", get_type_name_ex(get_irn_typeinfo_type(n), &bad));
 
   fprintf (F, "\"");
 
@@ -1762,7 +1765,7 @@ dump_vcg_header(FILE *F, const char *name, const char *orientation) {
        "colorentry 123:  255 220  220\n"
        "colorentry 124:  255 240  240\n"
        "colorentry 125:  255 250  250\n"
-          );
+       );
 
   fprintf (F, "\n");        /* a separator */
 }
@@ -2037,10 +2040,10 @@ dump_block_to_cfg(ir_node *block, void *env) {
     for (fl = i = 0; i < get_Block_n_cfgpreds(block); ++i) {
       ir_node *pred = get_Block_cfgpred(block, i);
       if (is_Bad(pred)) {
-       if (! fl)
-         fprintf(F, "Bad pred at pos: ");
-       fprintf(F, "%d ", i);
-       fl = 1;
+    if (! fl)
+      fprintf(F, "Bad pred at pos: ");
+    fprintf(F, "%d ", i);
+    fl = 1;
       }
     }
     if (fl)
@@ -2049,7 +2052,7 @@ dump_block_to_cfg(ir_node *block, void *env) {
     fprintf (F, "\"");  /* closing quote of info */
 
     if ((block == get_irg_start_block(get_irn_irg(block))) ||
-       (block == get_irg_end_block(get_irn_irg(block)))     )
+    (block == get_irg_end_block(get_irn_irg(block)))     )
       fprintf(F, " color:blue ");
     else if (fl)
       fprintf(F, " color:yellow ");
@@ -2145,8 +2148,8 @@ static int get_entity_color(entity *ent) {
   int max_loop_depth    = irp->max_callgraph_loop_depth;
   int max_overall_depth = weight_overall(max_rec_depth, max_loop_depth);
 
-  int my_rec_color     = compute_color(rec_depth, max_rec_depth);
-  int my_loop_color    = compute_color(loop_depth, max_loop_depth);
+  /* int my_rec_color     = compute_color(rec_depth, max_rec_depth); */
+  /* int my_loop_color    = compute_color(loop_depth, max_loop_depth); */
   int my_overall_color = compute_color(overall_depth, max_overall_depth);;
 
   return my_overall_color;
@@ -2329,15 +2332,15 @@ void dump_loops_standalone(FILE *F, ir_loop *loop) {
       int bad = 0;
 
       if (!loop_node_started) {
-       /* Start a new node which contains all firm nodes of the current loop */
-       fprintf (F, "node: { title: \"");
-       PRINT_LOOPID(loop);
-       fprintf (F, "-%d-nodes\" color: lightyellow label: \"", i);
-       loop_node_started = 1;
-       first = i;
+    /* Start a new node which contains all firm nodes of the current loop */
+    fprintf (F, "node: { title: \"");
+    PRINT_LOOPID(loop);
+    fprintf (F, "-%d-nodes\" color: lightyellow label: \"", i);
+    loop_node_started = 1;
+    first = i;
       }
       else
-       fprintf(F, "\n");
+    fprintf(F, "\n");
 
       bad |= dump_node_opcode(F, n);
       bad |= dump_node_mode(F, n);
@@ -2346,20 +2349,21 @@ void dump_loops_standalone(FILE *F, ir_loop *loop) {
       bad |= dump_node_nodeattr(F, n);
       fprintf (F, " %ld", get_irn_node_nr(n));
       if (is_Block(n)) fprintf (F, "\t ->%d", (int)get_irn_link(n));
+      if (has_backedges(n)) fprintf(F, "\t loop head!");
     } else { /* for callgraph loop tree */
       assert(get_kind(son) == k_ir_graph);
       /* We are a loop node -> Collect firm graphs */
       ir_graph *n = (ir_graph *)le.node;
       if (!loop_node_started) {
-       /* Start a new node which contains all firm nodes of the current loop */
-       fprintf (F, "node: { title: \"");
-       PRINT_LOOPID(loop);
-       fprintf (F, "-%d-nodes\" color: lightyellow label: \"", i);
-       loop_node_started = 1;
-       first = i;
+    /* Start a new node which contains all firm nodes of the current loop */
+    fprintf (F, "node: { title: \"");
+    PRINT_LOOPID(loop);
+    fprintf (F, "-%d-nodes\" color: lightyellow label: \"", i);
+    loop_node_started = 1;
+    first = i;
       }
       else
-       fprintf(F, "\n");
+    fprintf(F, "\n");
       fprintf (F, " %s", get_irg_dump_name(n));
       /* fprintf (F, " %s (depth %d)", get_irg_dump_name(n), n->callgraph_weighted_loop_depth); */
     }