X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=testprograms%2Foo_program_example.c;h=e2c823bb0002ed533e15a89459616e4f42862279;hb=7fe7a673936552cc45d7ffeb03ecaa511844e337;hp=7365d53c4174722c4340128e47125ed93d13afe1;hpb=4ea1df63a99fe3e9bf8f0395cdf33c39d4a2c677;p=libfirm diff --git a/testprograms/oo_program_example.c b/testprograms/oo_program_example.c index 7365d53c4..e2c823bb0 100644 --- a/testprograms/oo_program_example.c +++ b/testprograms/oo_program_example.c @@ -50,6 +50,8 @@ main(void) ir_node *self, *par1, *a_ptr; ir_node *a_val; + int i; + init_firm (); set_opt_constant_folding(0); @@ -67,6 +69,8 @@ main(void) proc_main_e = new_entity ((type *)owner, id_from_str ("main", 4), (type *)proc_main); main_irg = new_ir_graph (proc_main_e, 4); + /* Remark that this irg is the main routine of the program. */ + set_irp_main_irg(main_irg); /* There is only one block in main, it contains the constants and the calls. */ c2 = new_Const (mode_i, tarval_from_long (mode_i, 2)); @@ -137,9 +141,7 @@ main(void) mature_block (main_irg->end_block); 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); + irg_vrfy(main_irg); /****************************************************************************/ @@ -167,9 +169,7 @@ main(void) mature_block (set_a_irg->end_block); printf("\nDone building the graph.\n"); - printf("Dumping the graph and a type graph.\n"); - dump_ir_block_graph (set_a_irg); - dump_type_graph(set_a_irg); + irg_vrfy(set_a_irg); /****************************************************************************/ @@ -201,12 +201,16 @@ main(void) mature_block (c_irg->end_block); /* verify the graph */ - vrfy_graph(main_irg); + irg_vrfy(main_irg); printf("\nDone building the graph.\n"); - printf("Dumping the graph and a type graph.\n"); - dump_ir_block_graph (c_irg); - dump_type_graph(c_irg); + + printf("Dumping graphs of all procedures.\n"); + + for (i = 0; i < get_irp_n_irgs(); i++) { + dump_ir_block_graph (get_irp_irg(i)); + dump_type_graph(get_irp_irg(i)); + } /****************************************************************************/