+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 */
+ }
+
+}