From 53e86aeba2bc9c4192cbf1fe1c98028307981cd2 Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Tue, 11 Dec 2007 11:08:51 +0000 Subject: [PATCH] make it possible to not lower bitfields [r16942] --- include/libfirm/lowering.h | 4 ++-- ir/lower/lower_hl.c | 14 +++++++++----- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/include/libfirm/lowering.h b/include/libfirm/lowering.h index d583d3e84..96944d4f1 100644 --- a/include/libfirm/lowering.h +++ b/include/libfirm/lowering.h @@ -195,7 +195,7 @@ ir_entity *def_create_intrinsic_fkt(ir_type *method, const ir_op *op, * @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); +void lower_highlevel_graph(ir_graph *irg, int lower_bitfields); /** * Replaces SymConsts by a real constant if possible. @@ -206,7 +206,7 @@ void lower_highlevel_graph(ir_graph *irg); * @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(void); +void lower_highlevel(int lower_bitfields); typedef struct lower_mode_b_config_t { /* mode that is used to transport 0/1 values */ diff --git a/ir/lower/lower_hl.c b/ir/lower/lower_hl.c index 90c1e6779..97812a9e0 100644 --- a/ir/lower/lower_hl.c +++ b/ir/lower/lower_hl.c @@ -580,9 +580,13 @@ 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_graph(ir_graph *irg) { - /* First step: lower bitfield access: must be run as long as Sels still exists. */ - irg_walk_graph(irg, NULL, lower_bf_access, NULL); +void lower_highlevel_graph(ir_graph *irg, int lower_bitfields) { + + if(lower_bitfields) { + /* First step: lower bitfield access: must be run as long as Sels still + * exists. */ + irg_walk_graph(irg, NULL, lower_bf_access, NULL); + } /* Finally: lower SymConst-Size and Sel nodes, Casts, unaligned Load/Stores. */ irg_walk_graph(irg, NULL, lower_irnode, NULL); @@ -594,12 +598,12 @@ void lower_highlevel_graph(ir_graph *irg) { * Replace Sel nodes by address computation. Also resolves array access. * Handle Bitfields by added And/Or calculations. */ -void lower_highlevel(void) { +void lower_highlevel(int lower_bitfields) { 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_graph(irg, lower_bitfields); } } /* lower_highlevel */ -- 2.20.1