X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=testprograms%2Fplace_with_dead_block_example.c;h=110c4750c884bd42954c90167aeee20fba7ce81a;hb=eba5516120eb38bcae5464e628aa0d2cb8708866;hp=ee3574e3e64d4f8e0bb4f78f8e4463eee3692c21;hpb=b29be0767a1fd82929f7dce37381d2e66550be29;p=libfirm diff --git a/testprograms/place_with_dead_block_example.c b/testprograms/place_with_dead_block_example.c index ee3574e3e..110c4750c 100644 --- a/testprograms/place_with_dead_block_example.c +++ b/testprograms/place_with_dead_block_example.c @@ -10,12 +10,12 @@ * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE. */ -# include -# include +#include +#include + + +#include -# include "irvrfy.h" -# include "firm.h" -# include "irdump.h" /** This file constructs the ir to test a problem with code placement. @@ -59,13 +59,13 @@ #define PROGNAME "PLACE_WITH_DEAD" -int main(int argc, char **argv) +int main(void) { - type *prim_t_int; + ir_type *prim_t_int; ir_graph *irg; /* this variable contains the irgraph */ - type *owner; /* the class in which this method is defined */ - type *method; /* the type of this method */ - entity *ent; /* represents this method as entity of owner */ + ir_type *owner; /* the class in which this method is defined */ + ir_type *method; /* the ir_type of this method */ + ir_entity *ent; /* represents this method as ir_entity of owner */ ir_node *a, *b, *x; symconst_symbol sym; @@ -74,10 +74,10 @@ int main(int argc, char **argv) /* init library */ init_firm (NULL); - /* Make basic type information for primitive type int. */ + /* Make basic ir_type information for primitive ir_type int. */ prim_t_int = new_type_primitive(new_id_from_chars ("int", 3), mode_Ls); - /* Make the method type and entity */ + /* Make the method ir_type and ir_entity */ owner = get_glob_type(); method = new_type_method (new_id_from_str(PROGNAME"_main_tp"), 0, 1); set_method_res_type(method, 0, prim_t_int); @@ -90,7 +90,7 @@ int main(int argc, char **argv) /* Generate the two constants. A SymConst can not be constant evaluated. */ sym.type_p = new_type_class(new_id_from_str("SomeClass")); a = new_Const (mode_Is, new_tarval_from_long (0, mode_Is)); - b = new_SymConst (sym, symconst_size); + b = new_SymConst (mode_Iu, sym, symconst_type_size); /* Generate the Conv with Bad as block */ a = new_Conv(b, mode_Ls); @@ -103,7 +103,7 @@ int main(int argc, char **argv) mature_immBlock (get_irg_current_block(irg)); add_immBlock_pred (get_irg_end_block(irg), x); mature_immBlock (get_irg_end_block(irg)); - finalize_cons (irg); + irg_finalize_cons (irg); irg_vrfy(irg); printf("Done building the graph. Dumping it.\n"); @@ -111,14 +111,15 @@ int main(int argc, char **argv) dump_ir_graph (irg, 0); printf("Code placement ...\n"); + set_opt_global_cse(1); /* need this option for code placement */ place_code(irg); dump_ir_block_graph (irg, "-placed"); dump_ir_graph (irg, "-placed"); irg_vrfy(irg); - printf("use xvcg to view this graph:\n"); - printf("/ben/goetz/bin/xvcg GRAPHNAME\n\n"); + printf("Use ycomp to view this graph:\n"); + printf("ycomp GRAPHNAME\n\n"); return (0); }