Commit a12363c5 authored by Michael Beck's avatar Michael Beck
Browse files

added get_nodes_MacroBlock()

[r16060]
parent 60d329a2
......@@ -283,6 +283,19 @@ ir_node *get_nodes_block (const ir_node *node);
/** 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()
......
......@@ -664,6 +664,13 @@ set_nodes_block(ir_node *node, ir_node *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) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment