/** Sets the Block of a node. */
void set_nodes_block (ir_node *node, ir_node *block);
+/**
+ * Return the MacroBlock the node belongs to. This is only
+ * possible for pinned nodes or if the graph is in pinned state.
+ * Otherwise the MacroBlock may be incorrect. This condition is
+ * now checked by an assertion.
+ *
+ * This works for all except Block. It can return Blocks or the Bad node.
+ *
+ * To express the difference to access routines that work for all
+ * nodes we use infix "nodes" and do not name this function
+ * get_irn_MacroBlock(). */
+ir_node *get_nodes_MacroBlock(const ir_node *node);
+
/**
* @function get_irn_block()
* @see get_nodes_block()
set_irn_n(node, -1, block);
}
+/* this works for all except Block */
+ir_node *
+get_nodes_MacroBlock(const ir_node *node) {
+ assert(node->op != op_Block);
+ return get_Block_MacroBlock(get_irn_n(node, -1));
+}
+
/* Test whether arbitrary node is frame pointer, i.e. Proj(pn_Start_P_frame_base)
* from Start. If so returns frame type, else Null. */
ir_type *is_frame_pointer(ir_node *n) {