+/* Returns the macro block header of a block.*/
+ir_node *get_Block_MacroBlock(const ir_node *block) {
+ ir_node *mbh;
+ assert(is_Block(block));
+ mbh = get_irn_n(block, -1);
+ /* once macro block header is respected by all optimizations,
+ this assert can be removed */
+ assert(mbh != NULL);
+ return mbh;
+}
+
+/* Sets the macro block header of a block. */
+void set_Block_MacroBlock(ir_node *block, ir_node *mbh) {
+ assert(is_Block(block));
+ mbh = skip_Id(mbh);
+ assert(is_Block(mbh));
+ set_irn_n(block, -1, mbh);
+}
+
+/* returns the macro block header of a node. */
+ir_node *get_irn_MacroBlock(const ir_node *n) {
+ if (! is_Block(n)) {
+ n = get_nodes_block(n);
+ /* if the Block is Bad, do NOT try to get it's MB, it will fail. */
+ if (is_Bad(n))
+ return (ir_node *)n;
+ }
+ return get_Block_MacroBlock(n);
+}
+
+/* returns the graph of a Block. */
+ir_graph *(get_Block_irg)(const ir_node *block) {
+ return _get_Block_irg(block);
+}
+
+ir_entity *create_Block_entity(ir_node *block) {
+ ir_entity *entity;
+ assert(is_Block(block));
+
+ entity = block->attr.block.entity;
+ if (entity == NULL) {
+ ir_label_t nr;
+ ir_type *glob;
+
+ glob = get_glob_type();
+ entity = new_entity(glob, id_unique("block_%u"), get_code_type());
+ set_entity_visibility(entity, ir_visibility_local);
+ set_entity_linkage(entity, IR_LINKAGE_CONSTANT);
+ nr = get_irp_next_label_nr();
+ set_entity_label(entity, nr);
+ set_entity_compiler_generated(entity, 1);
+
+ block->attr.block.entity = entity;
+ }
+ return entity;
+}
+
+ir_entity *get_Block_entity(const ir_node *block) {
+ assert(is_Block(block));
+ return block->attr.block.entity;
+}
+
+void set_Block_entity(ir_node *block, ir_entity *entity)
+{
+ assert(is_Block(block));
+ assert(get_entity_type(entity) == get_code_type());
+ block->attr.block.entity = entity;
+}
+
+int has_Block_entity(const ir_node *block)
+{
+ return block->attr.block.entity != NULL;
+}
+
+ir_node *(get_Block_phis)(const ir_node *block) {
+ return _get_Block_phis(block);
+}
+
+void (set_Block_phis)(ir_node *block, ir_node *phi) {
+ _set_Block_phis(block, phi);
+}
+
+void (add_Block_phi)(ir_node *block, ir_node *phi) {
+ _add_Block_phi(block, phi);
+}
+
+/* Get the Block mark (single bit). */
+unsigned (get_Block_mark)(const ir_node *block) {
+ return _get_Block_mark(block);
+}
+
+/* Set the Block mark (single bit). */
+void (set_Block_mark)(ir_node *block, unsigned mark) {
+ _set_Block_mark(block, mark);
+}
+
+int get_End_n_keepalives(const ir_node *end) {
+ assert(is_End(end));