new dumper for partial graph
[libfirm] / ir / ir / irdumptxt.c
index 8a79d24..03288b7 100644 (file)
@@ -125,7 +125,7 @@ int dump_irnode_to_file(FILE *F, ir_node *n) {
 
   if ((get_irp_ip_view_state() != ip_view_no)
       && (get_irn_opcode(n) == iro_Filter || get_irn_opcode(n) == iro_Block)) {
-    fprintf(F, "  inter arity: %d", get_irn_inter_arity(n));
+    fprintf(F, "  inter arity: %d\n", get_irn_inter_arity(n));
     fprintf(F, "  inter pred nodes: \n");
     for ( i = 0; i < get_irn_inter_arity(n); ++i) {
       fprintf(F, "     %d: %s ", i, is_intra_backedge(n, i) ? "be" : "  ");
@@ -150,20 +150,20 @@ int dump_irnode_to_file(FILE *F, ir_node *n) {
     fprintf(F, "\n");
   }
 
-  /* Loop node   Someone else please tell me what's wrong ...
+  /* Loop node.   Someone else please tell me what's wrong ... */
   if (get_irn_loop(n)) {
     ir_loop *loop = get_irn_loop(n);
     assert(loop);
-    fprintf(F, " in loop %d with depth %d\n",
+    fprintf(F, "  in loop %d with depth %d\n",
         get_loop_loop_nr(loop), get_loop_depth(loop));
   }
-  */
+
 
   /* Source types */
   switch (get_irn_opcode(n)) {
   case iro_Block: {
-    fprintf(F, "  block visited: %ld", get_Block_block_visited(n));
-    fprintf(F, "  dominator info: not implemented\n");
+    fprintf(F, "  block visited: %ld\n", get_Block_block_visited(n));
+    fprintf(F, "  dominator info: output not implemented\n");
     /* not dumped: graph_arr */
     /* not dumped: mature    */
   }  break;
@@ -526,8 +526,7 @@ void    dump_entity_to_file_prefix (FILE *F, entity *ent, char *prefix, unsigned
       max_depth = (depth > max_depth) ? depth : max_depth ;
     }
 
-    L_freq = xmalloc(sizeof(*L_freq) * 4 * max_depth);
-    memset(L_freq, 0, sizeof(*L_freq) * 4 * max_depth);
+    L_freq = xcalloc(4 * max_depth, sizeof(L_freq[0]));
 
     S_freq  = L_freq + 1*max_depth;
     LA_freq = L_freq + 2*max_depth;
@@ -643,8 +642,7 @@ void    dump_entitycsv_to_file_prefix (FILE *F, entity *ent, char *prefix, unsig
     max_depth = (depth > max_depth) ? depth : max_depth ;
   }
 
-  L_freq = xmalloc(sizeof(*L_freq) * 4 * max_depth);
-  memset(L_freq, 0, sizeof(*L_freq) * 4 * max_depth);
+  L_freq = xcalloc(4 * max_depth, sizeof(L_freq[0]));
 
   S_freq  = L_freq + 1*max_depth;
   LA_freq = L_freq + 2*max_depth;
@@ -721,8 +719,7 @@ void dump_typecsv_to_file(FILE *F, type *tp, dump_verbosity verbosity, const cha
       max_depth = (depth > max_depth) ? depth : max_depth ;
     }
 
-    freq = xmalloc(sizeof(*freq) * 2 * max_depth);
-    memset(freq, 0, sizeof(*freq) * 2 * max_depth);
+    freq = xcalloc(2 * max_depth, sizeof(freq[0]));
 
     disp = freq + max_depth;
 
@@ -848,8 +845,7 @@ void dump_type_to_file (FILE *F, type *tp, dump_verbosity verbosity) {
       max_depth = (depth > max_depth) ? depth : max_depth ;
     }
 
-    freq = xmalloc(sizeof(*freq) * max_depth);
-    memset(freq, 0, sizeof(*freq) * max_depth);
+    freq = xcalloc(max_depth, sizeof(freq[0]));
 
     for (i = 0; i < n_all; ++i) {
       ir_node *all = get_type_allocation(tp, i);