make it possible to not lower bitfields
authorMatthias Braun <matze@braunis.de>
Tue, 11 Dec 2007 11:08:51 +0000 (11:08 +0000)
committerMatthias Braun <matze@braunis.de>
Tue, 11 Dec 2007 11:08:51 +0000 (11:08 +0000)
[r16942]

include/libfirm/lowering.h
ir/lower/lower_hl.c

index d583d3e..96944d4 100644 (file)
@@ -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 */
index 90c1e67..97812a9 100644 (file)
@@ -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 */