+/* handler handling for Blocks * /
+void
+set_Block_handler (ir_node *block, ir_node *handler) {
+ assert ((block->op == op_Block));
+ assert ((handler->op == op_Block));
+ block->attr.block.handler_entry = handler;
+}
+
+ir_node *
+get_Block_handler (ir_node *block) {
+ assert ((block->op == op_Block));
+ return (block->attr.block.handler_entry);
+}
+
+/ * handler handling for Nodes * /
+void
+set_Node_handler (ir_node *node, ir_node *handler) {
+ set_Block_handler (get_nodes_block (node), handler);
+}
+
+ir_node *
+get_Node_handler (ir_node *node) {
+ return (get_Block_handler (get_nodes_block (node)));
+}
+
+/ * exc_t handling for Blocks * /
+void set_Block_exc (ir_node *block, exc_t exc) {
+ assert ((block->op == op_Block));
+ block->attr.block.exc = exc;
+}
+
+exc_t get_Block_exc (ir_node *block) {
+ assert ((block->op == op_Block));
+ return (block->attr.block.exc);
+}
+
+/ * exc_t handling for Nodes * /
+void set_Node_exc (ir_node *node, exc_t exc) {
+ set_Block_exc (get_nodes_block (node), exc);
+}
+
+exc_t get_Node_exc (ir_node *node) {
+ return (get_Block_exc (get_nodes_block (node)));
+}
+*/
+
+void set_Block_cg_cfgpred_arr(ir_node * node, int arity, ir_node ** in) {
+ assert(node->op == op_Block);
+ if (node->attr.block.in_cg == NULL || arity != ARR_LEN(node->attr.block.in_cg) - 1) {
+ node->attr.block.in_cg = NEW_ARR_D(ir_node *, current_ir_graph->obst, arity + 1);
+ node->attr.block.in_cg[0] = NULL;
+ node->attr.block.cg_backedge = new_backedge_arr(current_ir_graph->obst, arity);
+ {
+ /* Fix backedge array. fix_backedges operates depending on
+ interprocedural_view. */
+ bool ipv = interprocedural_view;
+ interprocedural_view = true;
+ fix_backedges(current_ir_graph->obst, node);
+ interprocedural_view = ipv;
+ }
+ }
+ memcpy(node->attr.block.in_cg + 1, in, sizeof(ir_node *) * arity);
+}
+
+void set_Block_cg_cfgpred(ir_node * node, int pos, ir_node * pred) {
+ assert(node->op == op_Block &&
+ node->attr.block.in_cg &&
+ 0 <= pos && pos < ARR_LEN(node->attr.block.in_cg) - 1);
+ node->attr.block.in_cg[pos + 1] = pred;
+}
+
+ir_node ** get_Block_cg_cfgpred_arr(ir_node * node) {
+ assert(node->op == op_Block);
+ return node->attr.block.in_cg == NULL ? NULL : node->attr.block.in_cg + 1;
+}
+
+int get_Block_cg_n_cfgpreds(ir_node * node) {
+ assert(node->op == op_Block);
+ return node->attr.block.in_cg == NULL ? 0 : ARR_LEN(node->attr.block.in_cg) - 1;
+}
+
+ir_node * get_Block_cg_cfgpred(ir_node * node, int pos) {
+ assert(node->op == op_Block && node->attr.block.in_cg);
+ return node->attr.block.in_cg[pos + 1];
+}
+
+void remove_Block_cg_cfgpred_arr(ir_node * node) {
+ assert(node->op == op_Block);
+ node->attr.block.in_cg = NULL;
+}
+
+void
+set_Start_irg(ir_node *node, ir_graph *irg) {
+ assert(node->op == op_Start);
+ assert(is_ir_graph(irg));
+ assert(0 && " Why set irg? -- use set_irn_irg");
+}
+
+int
+get_End_n_keepalives(ir_node *end) {
+ assert (end->op == op_End);
+ return (get_irn_arity(end) - END_KEEPALIVE_OFFSET);
+}
+
+ir_node *
+get_End_keepalive(ir_node *end, int pos) {
+ assert (end->op == op_End);
+ return get_irn_n(end, pos + END_KEEPALIVE_OFFSET);
+}
+
+void
+add_End_keepalive (ir_node *end, ir_node *ka) {
+ assert (end->op == op_End);
+ ARR_APP1 (ir_node *, end->in, ka);
+}
+
+void
+set_End_keepalive(ir_node *end, int pos, ir_node *ka) {
+ assert (end->op == op_End);
+ set_irn_n(end, pos + END_KEEPALIVE_OFFSET, ka);
+}
+
+void
+free_End (ir_node *end) {
+ assert (end->op == op_End);
+ end->kind = k_BAD;
+ DEL_ARR_F(end->in); /* GL @@@ tut nicht ! */
+ end->in = NULL; /* @@@ make sure we get an error if we use the
+ in array afterwards ... */
+}
+
+
+/*
+> Implementing the case construct (which is where the constant Proj node is
+> important) involves far more than simply determining the constant values.
+> We could argue that this is more properly a function of the translator from
+> Firm to the target machine. That could be done if there was some way of
+> projecting "default" out of the Cond node.
+I know it's complicated.
+Basically there are two proglems:
+ - determining the gaps between the projs
+ - determining the biggest case constant to know the proj number for
+ the default node.
+I see several solutions:
+1. Introduce a ProjDefault node. Solves both problems.
+ This means to extend all optimizations executed during construction.
+2. Give the Cond node for switch two flavors:
+ a) there are no gaps in the projs (existing flavor)
+ b) gaps may exist, default proj is still the Proj with the largest
+ projection number. This covers also the gaps.
+3. Fix the semantic of the Cond to that of 2b)
+
+Solution 2 seems to be the best:
+Computing the gaps in the Firm representation is not too hard, i.e.,
+libFIRM can implement a routine that transforms between the two
+flavours. This is also possible for 1) but 2) does not require to
+change any existing optimization.
+Further it should be far simpler to determine the biggest constant than
+to compute all gaps.
+I don't want to choose 3) as 2a) seems to have advantages for
+dataflow analysis and 3) does not allow to convert the representation to
+2a).
+*/
+ir_node *