X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=testprograms%2Firr_loop_example.c;h=3129af8b2b314e4508b9c3676d37c671b5e784ac;hb=7023ae0df14b6797bdb6fa22050cf7c1c12ab9df;hp=43c1d00fdf282729642e4347cad89f3509da0b44;hpb=a3a4f27fa76972a5aa4773b34ad83796eaf1fcfc;p=libfirm diff --git a/testprograms/irr_loop_example.c b/testprograms/irr_loop_example.c index 43c1d00fd..3129af8b2 100644 --- a/testprograms/irr_loop_example.c +++ b/testprograms/irr_loop_example.c @@ -1,13 +1,15 @@ /* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe -** All rights reserved. -** -** Authors: Christian Schaefer, Goetz Lindenmaier -** -** testprogram. +* All rights reserved. +* +* Authors: Christian Schaefer, Goetz Lindenmaier +* +* testprogram. */ # include +# include +# include "irvrfy.h" # include "irdump.h" # include "firm.h" @@ -16,22 +18,22 @@ */ /** -*** This file constructs a control flow of following shape: -*** -*** -*** firstBlock -*** / \ -*** / \ -*** |/_ _\| -*** ----> -*** LoopBlock1 LoopBlock2 -*** <---- -*** \ / -*** \ / -*** _\| |/_ -*** nextBlock -*** -*** +* This file constructs a control flow of following shape: +* +* +* firstBlock +* / \ +* / \ +* |/_ _\| +* ----> +* LoopBlock1 LoopBlock2 +* <---- +* \ / +* \ / +* _\| |/_ +* nextBlock +* +* **/ int main(int argc, char **argv) @@ -68,16 +70,17 @@ int main(int argc, char **argv) ent = new_entity (owner, id_from_str (METHODNAME, strlen(METHODNAME)), proc_main); + get_entity_ld_name(ent); /* To enforce name mangling for vcg graph name */ #define NUM_OF_LOCAL_VARS 0 irg = new_ir_graph (ent, NUM_OF_LOCAL_VARS); /* to make three conditionals */ - expr = new_Const (mode_i, tarval_from_long (mode_i, 0)); - c1 = new_Const (mode_i, tarval_from_long (mode_i, 1)); - c2 = new_Const (mode_i, tarval_from_long (mode_i, 2)); - c3 = new_Const (mode_i, tarval_from_long (mode_i, 2)); + expr = new_Const (mode_Is, tarval_from_long (mode_Is, 0)); + c1 = new_Const (mode_Is, tarval_from_long (mode_Is, 1)); + c2 = new_Const (mode_Is, tarval_from_long (mode_Is, 2)); + c3 = new_Const (mode_Is, tarval_from_long (mode_Is, 2)); cond = new_Cond(new_Proj(new_Cmp(expr, c1), mode_b, Eq)); f = new_Proj(cond, mode_X, 0); @@ -113,6 +116,8 @@ int main(int argc, char **argv) add_in_edge (get_irg_end_block(irg), x); mature_block (get_irg_end_block(irg)); + finalize_cons (irg); + printf("Optimizing ...\n"); dead_node_elimination(irg);