dump the node index and estimated node count
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Fri, 7 Apr 2006 12:38:47 +0000 (12:38 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Fri, 7 Apr 2006 12:38:47 +0000 (12:38 +0000)
[r7597]

ir/ir/irdumptxt.c
ir/ir/irgraph.c
ir/ir/irgraph.h

index 319747b..e1193fb 100644 (file)
@@ -92,6 +92,7 @@ int dump_irnode_to_file(FILE *F, ir_node *n) {
   dump_node_opcode(F, n);
   fprintf(F, " %ld\n", get_irn_node_nr(n));
 
+  fprintf(F, "  index: %u\n", get_irn_idx(n));
   if (opt_dump_pointer_values_to_info)
     fprintf (F, "  addr:    %p \n", (void *)n);
   fprintf (F, "  mode:    %s\n", get_mode_name(get_irn_mode(n)));
@@ -544,6 +545,12 @@ void    dump_entity_to_file_prefix (FILE *F, entity *ent, char *prefix, unsigned
     if (is_Method_type(get_entity_type(ent))) {
       unsigned mask = get_entity_additional_properties(ent);
       unsigned cc   = get_method_calling_convention(get_entity_type(ent));
+      ir_graph *irg = get_entity_irg(ent);
+
+      if (irg) {
+        fprintf(F, "\n%s  estimated node count: %u", prefix, get_irg_estimated_node_cnt(irg));
+        fprintf(F, "\n%s  maximum node index:   %u", prefix, get_irg_last_idx(irg));
+      }
 
       if (mask) {
         fprintf(F, "\n%s  additional prop: ", prefix);
index 00fa687..f9454a1 100644 (file)
@@ -834,6 +834,11 @@ unsigned (get_irg_estimated_node_cnt)(const ir_graph *irg) {
   return _get_irg_estimated_node_cnt(irg);
 }
 
+/* Returns the last irn index for this graph. */
+unsigned get_irg_last_idx(const ir_graph *irg) {
+  return irg->last_node_idx;
+}
+
 /* register additional space in an IR graph */
 size_t register_additional_graph_data(size_t size)
 {
index 181b3b0..1bbe4bb 100644 (file)
@@ -475,6 +475,9 @@ void *get_irg_loc_description(ir_graph *irg, int n);
  */
 unsigned get_irg_estimated_node_cnt(const ir_graph *irg);
 
+/** Returns the last irn index for this graph. */
+unsigned get_irg_last_idx(const ir_graph *irg);
+
 /**
  * Access custom graph data.
  * The data must have been registered with