From 69294dc3d63c3475637a5486a640eefc50378d36 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Christian=20W=C3=BCrdig?= Date: Mon, 4 Sep 2006 12:06:58 +0000 Subject: [PATCH] fixed C99 style return init irg --- ir/be/beprofile.c | 18 +++++++++++------- ir/be/beprofile.h | 13 ++++++++++++- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/ir/be/beprofile.c b/ir/be/beprofile.c index d0ff4fb5f..03bb66982 100644 --- a/ir/be/beprofile.c +++ b/ir/be/beprofile.c @@ -2,6 +2,7 @@ * @file beprofile.c * @date 2006-04-06 * @author Adam M. Szalkowski + * @cvs-id $Id$ * * Code instrumentation and execution count profiling * @@ -116,24 +117,27 @@ gen_initializer_irg(entity * bblock_id, entity * bblock_counts, int n_blocks) ident *init_name = new_id_from_str("__init_firmprof"); ir_type *init_type = new_type_method(init_name, 3, 0); ir_type *uint, *uintptr; + entity *init_ent; + ir_graph *irg; + ir_node *bb; - uint = new_type_primitive(new_id_from_str("__uint"), mode_Iu); + uint = new_type_primitive(new_id_from_str("__uint"), mode_Iu); uintptr = new_type_pointer(new_id_from_str("__uintptr"), uint, mode_P); set_method_param_type(init_type, 0, uintptr); set_method_param_type(init_type, 1, uintptr); set_method_param_type(init_type, 2, uint); - entity *init_ent = new_entity(get_glob_type(), init_name, init_type); + init_ent = new_entity(get_glob_type(), init_name, init_type); - ir_graph *irg = new_ir_graph(ent, 0); + irg = new_ir_graph(ent, 0); set_current_ir_graph(irg); - ir_node *bb = get_cur_block(); + bb = get_cur_block(); start_block = get_irg_start_block(irg); sym.entity_p = init_ent; - symconst = new_r_SymConst(irg, start_block, sym, symconst_addr_ent); + symconst = new_r_SymConst(irg, start_block, sym, symconst_addr_ent); sym.entity_p = bblock_id; ins[0] = new_r_SymConst(irg, start_block, sym, symconst_addr_ent); @@ -177,7 +181,7 @@ block_id_walker(ir_node * bb, void * data) ++wd->id; } -void +ir_graph * be_profile_instrument(void) { ir_graph *const_irg = get_const_code_irg(); @@ -232,7 +236,7 @@ be_profile_instrument(void) } set_array_entity_values(bblock_id, tarval_array, n_blocks); - gen_initializer_irg(bblock_id, bblock_counts, n_blocks); + return gen_initializer_irg(bblock_id, bblock_counts, n_blocks); } diff --git a/ir/be/beprofile.h b/ir/be/beprofile.h index aba585c3b..f72014d6b 100644 --- a/ir/be/beprofile.h +++ b/ir/be/beprofile.h @@ -2,6 +2,7 @@ * @file beprofile.h * @date 2006-04-06 * @author Adam M. Szalkowski + * @cvs-id $Id$ * * Code instrumentation and execution count profiling * @@ -9,5 +10,15 @@ * Released under the GPL */ -void be_profile_instrument(void); +#ifndef _BEPROFILE_H_ +#define _BEPROFILE_H_ + +/** + * Instruments irgs with profile code. + * @return The irg doing the profile initialization. + */ +ir_graph *be_profile_instrument(void); + void be_profile_read(void); + +#endif /* _BEPROFILE_H_ */ -- 2.20.1