+ /* -- Decide how to handle exception control flow: Is there a handler
+ for the Call node, or do we branch directly to End on an exception?
+ exc_handling: 0 There is a handler.
+ 1 Branches to End.
+ 2 Exception handling not represented in Firm. -- */
+ exc_handling = 2;
+ for (proj = (ir_node *)get_irn_link(call); proj; proj = (ir_node *)get_irn_link(proj)) {
+ assert(get_irn_op(proj) == op_Proj);
+ if (get_Proj_proj(proj) == pn_Call_M_except) { exc_handling = 0; break;}
+ if (get_Proj_proj(proj) == pn_Call_X_except) { exc_handling = 1; }
+ }
+
+ {
+ ir_node *proj, *Mproj = NULL, *Xproj = NULL;
+ for (proj = (ir_node *)get_irn_link(call); proj; proj = (ir_node *)get_irn_link(proj)) {
+ assert(get_irn_op(proj) == op_Proj);
+ if (get_Proj_proj(proj) == pn_Call_X_except) Xproj = proj;
+ if (get_Proj_proj(proj) == pn_Call_M_except) Mproj = proj;
+ }
+ if (Mproj) { assert(Xproj); exc_handling = 0; }
+ else if (Xproj) { exc_handling = 1; }
+ else { exc_handling = 2; }
+ }
+
+