*** empty log message ***
[libfirm] / testprograms / array-heap_example.c
index 9750b78..a635b32 100644 (file)
@@ -74,7 +74,7 @@ main(void)
      32 bit integer value.  */
   prim_t_int = new_type_primitive(id_from_str ("int", 3), mode_i);
 
-  printf("creating an IR graph: ARRAY-HEAP_EXAMPLE...\n");
+  printf("\nCreating an IR graph: ARRAY-HEAP_EXAMPLE...\n");
 
   /* first build procedure main */
   owner = get_glob_type();
@@ -135,22 +135,23 @@ main(void)
 
      x = new_Return (get_store (), 1, in);
   }
-  mature_block (main_irg->current_block);
+  mature_block (get_irg_current_block(main_irg));
 
   /* complete the end_block */
-  add_in_edge (main_irg->end_block, x);
-  mature_block (main_irg->end_block);
+  add_in_edge (get_irg_end_block(main_irg), x);
+  mature_block (get_irg_end_block(main_irg));
+
+  printf("Optimizing ...\n");
+  dead_node_elimination(main_irg);
 
   /* verify the graph */
   irg_vrfy(main_irg);
 
-  printf("\nDone building the graph.\n");
   printf("Dumping the graph and a type graph.\n");
   dump_ir_block_graph (main_irg);
   dump_type_graph(main_irg);
-
-  printf("\nuse xvcg to view these graphs:\n");
-  printf("/ben/goetz/bin/xvcg GRAPHNAME\n");
+  printf("use xvcg to view these graphs:\n");
+  printf("/ben/goetz/bin/xvcg GRAPHNAME\n\n");
 
   return (1);
 }