From 454c54d88ceecbccf88aa6f8801cc9be6cb0ec74 Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Tue, 20 Nov 2007 16:23:33 +0000 Subject: [PATCH] lower_highlevel_graph() added [r16812] --- include/libfirm/lowering.h | 13 +++++++++++++ ir/lower/lower_hl.c | 18 ++++++++++++++++-- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/include/libfirm/lowering.h b/include/libfirm/lowering.h index d4ee10ccd..47bede5d5 100644 --- a/include/libfirm/lowering.h +++ b/include/libfirm/lowering.h @@ -190,6 +190,19 @@ ir_entity *def_create_intrinsic_fkt(ir_type *method, const ir_op *op, * Replace Sel nodes by address computation. Also resolves array access. * Handle bit fields by added And/Or calculations. * + * @param irg the graph to lower + * + * @note: There is NO lowering ob objects oriented types. This is highly compiler + * and ABI specific and should be placed directly in the compiler. + */ +void lower_highlevel_graph(ir_graph *irg); + +/** + * Replaces SymConsts by a real constant if possible. + * Replace Sel nodes by address computation. Also resolves array access. + * Handle bit fields by added And/Or calculations. + * Lowers all graphs. + * * @Note: There is NO lowering ob objects oriented types. This is highly compiler * and ABI specific and should be placed directly in the compiler. */ diff --git a/ir/lower/lower_hl.c b/ir/lower/lower_hl.c index c6282a50c..29aa1d020 100644 --- a/ir/lower/lower_hl.c +++ b/ir/lower/lower_hl.c @@ -580,7 +580,7 @@ static void lower_bf_access(ir_node *irn, void *env) { * Replace Sel nodes by address computation. Also resolves array access. * Handle Bitfields by added And/Or calculations. */ -void lower_highlevel(void) { +void lower_highlevel_graph(ir_graph *irg) { int i, n; n = get_irp_n_irgs(); @@ -592,7 +592,21 @@ void lower_highlevel(void) { /* Finally: lower SymConst-Size and Sel nodes, Casts, unaligned Load/Stores. */ irg_walk_graph(irg, NULL, lower_irnode, NULL); - set_irg_phase_low(irg); } } /* lower_highlevel */ + +/* + * Replaces SymConsts by a real constant if possible. + * Replace Sel nodes by address computation. Also resolves array access. + * Handle Bitfields by added And/Or calculations. + */ +void lower_highlevel(void) { + int i, n; + + n = get_irp_n_irgs(); + for (i = 0; i < n; ++i) { + ir_graph *irg = get_irp_irg(i); + lower_highlevel_graph(irg); + } +} /* lower_highlevel */ -- 2.20.1