*** empty log message ***
[libfirm] / testprograms / dead_block_example.c
index 2ff7b31..ad6c8cc 100644 (file)
@@ -46,15 +46,13 @@ int main(int argc, char **argv)
 {
   ir_graph *irg;          /* this variable contains the irgraph */
   type_class *owner;      /* the class in which this method is defined */
-  type_method *proc_main; /* typeinformation for the method main */
+  type_method *proc_main; /* type information for the method main */
   entity *ent;            /* represents this method as entity of owner */
   ir_node *c1, *c2, *cond, *f, *t, *endBlock, *Block1, *jmp, *Block2,
           *deadBlock, *x;
 
-
   /* init library */
   init_firm ();
-  set_opt_constant_folding (1);
 
   /* FIRM was designed for oo languages where all methods belong to a class.
    * For imperative languages like C we view a file as a large class containing
@@ -123,13 +121,23 @@ int main(int argc, char **argv)
   add_in_edge (irg->end_block, x);
   mature_block (irg->end_block);
 
+  /* verify the graph */
+  irg_vrfy(irg);
+
   printf("\nDone building the graph.\n");
+  local_optimize_graph (irg);
+  printf("\nDone local optimization.\n");
+  set_opt_constant_folding (1);
+  set_optimize(0);
+  set_opt_cse(1);
+  dead_node_elimination (irg);
   printf("Dumping the graph and a control flow graph.\n");
+
   dump_ir_block_graph (irg);
   dump_cfg (irg);
 
   printf("use xvcg to view these graphs:\n");
-  printf("/ben/trapp/bin/i486/xvcg GRAPHNAME\n");
+  printf("/ben/goetz/bin/xvcg GRAPHNAME\n");
 
   return (0);
 }