};
-/** Returns the array with the ins. The content of the array may not be
- changed. */
+/**
+ * Returns the array with the ins. The content of the array may not be
+ * changed.
+ * Note that this function returns the whole in array including the
+ * block predecessor. So, it is NOT symmetric with set_irn_in().
+ */
ir_node **get_irn_in (const ir_node *node);
/** @{ */
return node->op;
}
+static INLINE void
+_set_irn_op (ir_node *node, ir_op *op) {
+ assert (node);
+ node->op = op;
+}
+
/** Copies all attributes stored in the old node to the new node.
Assumes both have the same opcode and sufficient size. */
static INLINE void
return (node && _get_irn_op(node) == op_Unknown);
}
+static INLINE int
+_is_Return (const ir_node *node) {
+ assert(node);
+ return (node && _get_irn_op(node) == op_Return);
+}
+
+static INLINE int
+_is_Call (const ir_node *node) {
+ assert(node);
+ return (node && _get_irn_op(node) == op_Call);
+}
+
+static INLINE int
+_is_Sel (const ir_node *node) {
+ assert(node);
+ return (node && _get_irn_op(node) == op_Sel);
+}
+
+static INLINE int
+_is_Mux (const ir_node *node) {
+ assert(node);
+ if (node) {
+ ir_op *op = _get_irn_op(node);
+ return (op == op_Mux || ((op == op_Psi) && _get_irn_arity(node) == 3));
+ }
+ return 0;
+}
+
static INLINE int
_is_no_Block(const ir_node *node) {
assert(node && _is_ir_node(node));
node->attr.c.pred = pred;
}
+static INLINE int _get_Psi_n_conds(ir_node *node) {
+ assert(_get_irn_op(node) == op_Psi);
+ return _get_irn_arity(node) >> 1;
+}
+
/* this section MUST contain all inline functions */
#define is_ir_node(thing) _is_ir_node(thing)
#define get_irn_intra_arity(node) _get_irn_intra_arity(node)
#define get_irn_mode(node) _get_irn_mode(node)
#define set_irn_mode(node, mode) _set_irn_mode(node, mode)
#define get_irn_op(node) _get_irn_op(node)
+#define set_irn_op(node, op) _set_irn_op(node, op)
#define get_irn_opcode(node) _get_irn_opcode(node)
#define get_irn_visited(node) _get_irn_visited(node)
#define set_irn_visited(node, v) _set_irn_visited(node, v)
#define is_binop(node) _is_binop(node)
#define is_Const(node) _is_Const(node)
#define is_Unknown(node) _is_Unknown(node)
+#define is_Return(node) _is_Return(node)
+#define is_Call(node) _is_Call(node)
+#define is_Sel(node) _is_Sel(node)
+#define is_Mux(node) _is_Mux(node)
#define is_Bad(node) _is_Bad(node)
#define is_no_Block(node) _is_no_Block(node)
#define is_Block(node) _is_Block(node)
#define is_irn_keep(node) _is_irn_keep(node)
#define get_Cond_jmp_pred(node) _get_Cond_jmp_pred(node)
#define set_Cond_jmp_pred(node, pred) _set_Cond_jmp_pred(node, pred)
+#define get_Psi_n_conds(node) _get_Psi_n_conds(node)
# endif /* _IRNODE_T_H_ */