X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=testprograms%2Foo_program_example.c;h=0c2de25ac71ef976770498d11870d8a94cc26c5b;hb=95730664ee5ec63be34b1142222b6704300666f5;hp=73ae9c907978749b0a18997da4171776b4018691;hpb=8a828c064c24643f30d68b67808a62e8a7ae1d80;p=libfirm diff --git a/testprograms/oo_program_example.c b/testprograms/oo_program_example.c index 73ae9c907..0c2de25ac 100644 --- a/testprograms/oo_program_example.c +++ b/testprograms/oo_program_example.c @@ -1,10 +1,14 @@ -/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe -* All rights reserved. -* -* Authors: Goetz Lindenmaier -* -* testprogram. -*/ +/* + * Project: libFIRM + * File name: testprograms/oo_program_example.c + * Purpose: A complex example. + * Author: Goetz Lindenmaier + * Modified by: + * Created: + * CVS-ID: $Id$ + * Copyright: (c) 1999-2003 Universität Karlsruhe + * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE. + */ # include # include @@ -55,7 +59,7 @@ main(void) int i; - init_firm (); + init_firm (NULL); set_opt_constant_folding(1); set_opt_cse(1); @@ -110,8 +114,8 @@ main(void) set_irp_main_irg(main_irg); /* Make the constants. They are independent of a block. */ - c2 = new_Const (mode_Is, tarval_from_long (mode_Is, 2)); - c5 = new_Const (mode_Is, tarval_from_long (mode_Is, 5)); + c2 = new_Const (mode_Is, new_tarval_from_long (2, mode_Is)); + c5 = new_Const (mode_Is, new_tarval_from_long (5, mode_Is)); /* There is only one block in main, it contains the allocation and the calls. */ /* Allocate the defined object and generate the type information. */ @@ -240,9 +244,32 @@ main(void) } printf("Dumping graphs of all procedures and a type graph.\n"); + /* Touch ld names to distinguish names from oo_inline names. */ + get_entity_ld_ident(proc_set_a_e); + get_entity_ld_ident(proc_c_e); + + dump_consts_local(1); + turn_off_edge_labels(); + + dump_all_ir_graphs(dump_ir_graph); dump_all_ir_graphs(dump_ir_block_graph); + dump_all_ir_graphs(dump_ir_graph_w_types); dump_all_ir_graphs(dump_ir_block_graph_w_types); + dump_all_ir_graphs(dump_type_graph); dump_all_types(); + dump_class_hierarchy (true); + + entity **free_methods; + int arr_len; + cgana(&arr_len, &free_methods); + cg_construct(arr_len, free_methods); + + interprocedural_view = 1; + dump_ir_graph(main_irg); + dump_ir_block_graph(main_irg); + dump_ir_graph_w_types(main_irg); + dump_ir_block_graph_w_types(main_irg); + dump_all_cg_block_graph(); printf("Use xvcg to view these graphs:\n"); printf("/ben/goetz/bin/xvcg GRAPHNAME\n\n");