lower_highlevel_graph() added
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Tue, 20 Nov 2007 16:23:33 +0000 (16:23 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Tue, 20 Nov 2007 16:23:33 +0000 (16:23 +0000)
[r16812]

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

index d4ee10c..47bede5 100644 (file)
@@ -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.
  */
index c6282a5..29aa1d0 100644 (file)
@@ -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 */