*/
static inline ir_op *get_irn_op_(const ir_node *node)
{
- assert(node);
return node->op;
}
static inline void set_irn_op_(ir_node *node, ir_op *op)
{
- assert(node);
node->op = op;
}
static inline unsigned get_irn_opcode_(const ir_node *node)
{
assert(k_ir_node == get_kind(node));
- assert(node->op);
return node->op->code;
}
static inline ir_node *get_irn_dep_(const ir_node *node, int pos)
{
- assert(node->deps && "dependency array node yet allocated. use add_irn_dep()");
assert(pos >= 0 && pos < (int)ARR_LEN(node->deps) && "dependency index out of range");
return node->deps[pos];
}
*/
static inline ir_mode *get_irn_mode_(const ir_node *node)
{
- assert(node);
return node->mode;
}
*/
static inline void set_irn_mode_(ir_node *node, ir_mode *mode)
{
- assert(node);
node->mode = mode;
}
*/
static inline ir_visited_t get_irn_visited_(const ir_node *node)
{
- assert(node);
return node->visited;
}
*/
static inline void set_irn_visited_(ir_node *node, ir_visited_t visited)
{
- assert(node);
node->visited = visited;
}
*/
static inline void set_irn_link_(ir_node *node, void *link)
{
- assert(node);
node->link = link;
}
*/
static inline void *get_irn_link_(const ir_node *node)
{
- assert(node && is_ir_node_(node));
+ assert(is_ir_node_(node));
return node->link;
}
static inline op_pin_state get_irn_pinned_(const ir_node *node)
{
op_pin_state state;
- assert(node && is_ir_node_(node));
+ assert(is_ir_node_(node));
/* Check opcode */
state = get_op_pinned_(get_irn_op_(node));
static inline int is_unop_(const ir_node *node)
{
- assert(node && is_ir_node_(node));
+ assert(is_ir_node_(node));
return (node->op->opar == oparity_unary);
}
static inline int is_binop_(const ir_node *node)
{
- assert(node && is_ir_node_(node));
+ assert(is_ir_node_(node));
return (node->op->opar == oparity_binary);
}
return get_irn_n_(node, pos);
}
-/* Get the predecessor block.
+/**
+ * Get the predecessor block.
*
- * Returns the block corresponding to the predecessor pos.
+ * Returns the block corresponding to the predecessor pos.
*
- * There are several ambiguities we resolve with this function:
- * - The direct predecessor can be a Proj, which is not pinned.
- * We walk from the predecessor to the next pinned node
- * (skip_Proj) and return the block that node is in.
- * - If we encounter the Bad node, this function does not return
- * the Start block, but the Bad node.
+ * If we encounter the Bad node, this function does not return the Start block,
+ * but the Bad node.
*/
static inline ir_node *get_Block_cfgpred_block_(const ir_node *node, int pos)
{
ir_graph *irg = get_irn_irg(node);
return new_r_Bad(irg, mode_BB);
} else {
- return get_nodes_block(skip_Proj(res));
+ return get_nodes_block(res);
}
}