- Phi nodes are now collected by collect_phiprojs() and stored into a phi-list attrib...
[libfirm] / ir / lower / lower_hl.c
index 90c1e67..0f93df7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1995-2007 University of Karlsruhe.  All right reserved.
+ * Copyright (C) 1995-2008 University of Karlsruhe.  All right reserved.
  *
  * This file is part of libFirm.
  *
@@ -97,7 +97,7 @@ static void lower_sel(ir_node *sel) {
                                basemode = mode_P_data;
 
                        assert(basemode && "no mode for lowering Sel");
-                       assert((get_mode_size_bytes(basemode) != -1) && "can not deal with unorthodox modes");
+                       assert((get_mode_size_bits(basemode) % 8 == 0) && "can not deal with unorthodox modes");
                        index = get_Sel_index(sel, 0);
 
                        if (is_Array_type(owner)) {
@@ -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 */