lower_dw: add support for Bad nodes
authorMatthias Braun <matze@braunis.de>
Tue, 10 May 2011 17:09:58 +0000 (19:09 +0200)
committerMatthias Braun <matze@braunis.de>
Mon, 23 May 2011 12:20:55 +0000 (14:20 +0200)
ir/lower/lower_dw.c

index 7a748a5..94c3f37 100644 (file)
@@ -1810,6 +1810,18 @@ static void lower_Unknown(ir_node *node, ir_mode *mode, lower_env_t *env)
        set_lowered(env, node, res_low, res_high);
 }
 
+/**
+ * Translate a Bad into two.
+ */
+static void lower_Bad(ir_node *node, ir_mode *mode, lower_env_t *env)
+{
+       ir_mode  *low_mode = env->low_unsigned;
+       ir_graph *irg      = get_irn_irg(node);
+       ir_node  *res_low  = new_r_Bad(irg, low_mode);
+       ir_node  *res_high = new_r_Bad(irg, mode);
+       set_lowered(env, node, res_low, res_high);
+}
+
 /**
  * Translate a Phi.
  *
@@ -2416,6 +2428,7 @@ void lower_dw_ops(const lwrdw_param_t *param)
        enter_lower_func(op_ASM,     lower_ASM);
        enter_lower_func(op_Add,     lower_binop);
        enter_lower_func(op_And,     lower_And);
+       enter_lower_func(op_Bad,     lower_Bad);
        enter_lower_func(op_Call,    lower_Call);
        enter_lower_func(op_Cmp,     lower_Cmp);
        enter_lower_func(op_Cond,    lower_Cond);