Commit 53e86aeb authored by Matthias Braun's avatar Matthias Braun
Browse files

make it possible to not lower bitfields

[r16942]
parent 3b5b9f7c
......@@ -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 */
......
......@@ -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 */
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment