X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=testprograms%2Fglobal_cse.c;h=1d15440665ba0b2467bbc9b04dfc5d230e613f62;hb=67067849894a6b5e0f87253ede8539331e3bdc3d;hp=4f2772d21e5b08b12c816ae9d2633df4ca98df87;hpb=8a828c064c24643f30d68b67808a62e8a7ae1d80;p=libfirm diff --git a/testprograms/global_cse.c b/testprograms/global_cse.c index 4f2772d21..1d1544066 100644 --- a/testprograms/global_cse.c +++ b/testprograms/global_cse.c @@ -43,7 +43,7 @@ main(void) printf("\nCreating an IR graph: GLOBAL_CSE_EXAMPLE...\n"); - init_firm (); + init_firm (NULL); set_optimize(1); set_opt_constant_folding(1); @@ -89,15 +89,15 @@ main(void) set_value (a_pos, new_Proj (get_irg_args(irg), mode_Is, 0)); /* Generate the constant and assign it to b. The assignment is resovled to a dataflow edge. */ - set_value (b_pos, new_Const (mode_Is, tarval_from_long (mode_Is, 2))); + set_value (b_pos, new_Const (mode_Is, new_tarval_from_long (2, mode_Is))); /* We know all predecessors of the block and all set_values and set_stores are preformed. We can mature the block. */ mature_block (get_irg_current_block(irg)); /* Generate a conditional branch */ cmp = new_Cmp(get_value(a_pos, mode_Is), get_value(b_pos, mode_Is)); /* - cmp = new_Cmp(new_Const (mode_Is, tarval_from_long (mode_Is, 2)), - new_Const (mode_Is, tarval_from_long (mode_Is, 2)));*/ + cmp = new_Cmp(new_Const (mode_Is, new_tarval_from_long (2, mode_Is)), + new_Const (mode_Is, new_tarval_from_long (2, mode_Is)));*/ x = new_Cond (new_Proj(cmp, mode_b, Eq)); f = new_Proj (x, mode_X, 0); t = new_Proj (x, mode_X, 1); @@ -106,7 +106,7 @@ main(void) r = new_immBlock (); add_in_edge (r, t); a = new_Sub(get_value(a_pos, mode_Is), - new_Const (mode_Is, tarval_from_long (mode_Is, 3)), + new_Const (mode_Is, new_tarval_from_long (3, mode_Is)), mode_Is); set_value (a_pos, a); @@ -117,9 +117,9 @@ main(void) r = new_immBlock (); add_in_edge (r, f); a = new_Sub(get_value(a_pos, mode_Is), - new_Const (mode_Is, tarval_from_long (mode_Is, 3)), + new_Const (mode_Is, new_tarval_from_long (3, mode_Is)), mode_Is); - a = new_Add(a, new_Const (mode_Is, tarval_from_long (mode_Is, 5)), mode_Is); + a = new_Add(a, new_Const (mode_Is, new_tarval_from_long (5, mode_Is)), mode_Is); set_value (a_pos, a); mature_block (r);