+ block = get_cur_block (); /* remember this so we can put the ProjXs into it */
+
+ /* jump based on an unknown condition so all values are possible */
+ unknown = new_Unknown (mode_Iu);
+ cond = new_Cond (unknown);
+
+ c_block = new_immBlock (); /* for the Phi after the branch(es) */
+
+ ins = (ir_node**) xmalloc (n_ins * sizeof (ir_node*));
+ for (i = 0; i < n_ins; i ++) {
+ ir_node *projX = NULL;
+ ir_node *s_block = NULL;
+ ir_node *jmp = NULL;
+ eff_t *in_eff;
+
+ /* make sure the projX is in the 'switch' block */
+ set_cur_block (block);
+ projX = new_Proj (cond, mode_X, (long) i);
+
+ /* this also sets current_block, so the rest of the code ends up there: */
+ s_block = new_immBlock ();
+
+ add_immBlock_pred (s_block, projX);
+ mature_immBlock (s_block);
+
+ in_eff = find_valueid_in_proc_effects (eff->effect.join.ins [i], proc);
+
+ ins [i] = in_eff->firmnode;
+
+ /* need to find a suitable mode for the Phi node */
+ if (mode_ANY != get_irn_mode (ins [i])) {
+ join_md = get_irn_mode (ins [i]);
+ }
+
+ jmp = new_Jmp ();
+ add_immBlock_pred (c_block, jmp);
+ }
+
+ set_cur_block (c_block);
+
+ phi = new_Phi (n_ins, ins, join_md);
+
+ mature_immBlock (c_block);
+ memset (ins, 0x00, n_ins * sizeof (ir_node*));
+ free (ins);
+
+ eff->firmnode = phi;
+
+ add_value_to_proc (proc, eff);
+}
+
+static void create_abstract_raise (ir_graph *irg, proc_t *proc, eff_t *eff)
+{
+ ir_node *block = NULL;
+ ir_node *unknown = NULL;
+ ir_node *cond = NULL;
+
+ /* seems like current_block is not always mature at this point */
+ mature_immBlock (get_cur_block ());
+ block = get_cur_block (); /* remember this so we can put the ProjXs into it */
+
+ /* jump based on an unknown condition so both values are possible */
+ unknown = new_Unknown (mode_Iu);
+ cond = new_Cond (unknown);
+
+ /* one branch for 'throw-exception' case */
+ {
+ ir_node *projX = new_Proj (cond, mode_X, 1L);
+ ir_node *b_exc = new_immBlock ();
+ ir_node *obj = NULL;
+ ir_node *thrw = NULL;
+ eff_t *thrw_eff = NULL;
+
+ add_immBlock_pred (b_exc, projX);
+
+ thrw_eff = find_valueid_in_proc_effects (eff->effect.raise.valref, proc);
+ obj = thrw_eff->firmnode;
+
+ thrw = new_Raise (get_store (), obj);
+ /* exc-jump to end block */
+ thrw = new_Proj (thrw, mode_X, 0L);
+
+ add_immBlock_pred (get_irg_end_block (irg), thrw);
+ mature_immBlock (get_cur_block ());
+ }
+
+ set_cur_block (block); /* back to the first block */
+
+ /* one branch for 'non-exception' case */
+ {
+ ir_node *projX = new_Proj (cond, mode_X, 0);
+ new_immBlock (); /* also sets current_block */
+ add_immBlock_pred (get_cur_block (), projX);
+ mature_immBlock (get_cur_block ());
+ /* continue building in current_block */
+ }
+
+}
+
+static void create_abstract_firm(module_t *module, proc_t *proc, ir_entity *fent)