* Intern version for libFirm.
*/
static INLINE ir_op *
-__get_irn_op (const ir_node *node)
-{
+__get_irn_op (const ir_node *node) {
assert (node);
return node->op;
}
* Intern version for libFirm.
*/
static INLINE opcode
-__get_irn_opcode (const ir_node *node)
-{
+__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_intra_n (ir_node *node, int n) {
- assert(node); assert(-1 <= n && n < __get_irn_arity(node));
+ assert(node); assert(-1 <= n && n < __get_irn_intra_arity(node));
return (node->in[n + 1] = skip_Id(node->in[n + 1]));
}
*/
static INLINE ir_node*
__get_irn_inter_n (ir_node *node, int n) {
- assert(node); assert(-1 <= n && n < __get_irn_arity(node));
+ assert(node); assert(-1 <= n && n < __get_irn_inter_arity(node));
/* handle Filter and Block specially */
if (__get_irn_opcode(node) == iro_Filter) {
static INLINE op_pin_state
__get_irn_pinned(const ir_node *node) {
op_pin_state state = __get_op_pinned(__get_irn_op(node));
- if (state == op_pin_state_exc_pinned)
+ if (state >= op_pin_state_exc_pinned)
return get_opt_fragile_ops() ? node->attr.except.pin_state : op_pin_state_pinned;
return state;
}
+static INLINE int
+__is_unop(const ir_node *node) {
+ return (node->op->opar == oparity_unary);
+}
+
+static INLINE int
+__is_binop(const ir_node *node) {
+ return (node->op->opar == oparity_binary);
+}
+
+static INLINE int
+__is_Bad(const ir_node *node) {
+ assert(node);
+ return (node && __get_irn_op(node) == op_Bad);
+}
+
+static INLINE int
+__is_no_Block(const ir_node *node) {
+ assert(node);
+ return (__get_irn_op(node) != op_Block);
+}
+
+static INLINE int
+__is_Block(const ir_node *node) {
+ assert(node);
+ return (__get_irn_op(node) == op_Block);
+}
+
/* 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 irn_not_visited(node) __irn_not_visited(node)
#define set_irn_link(node, link) __set_irn_link(node, link)
#define get_irn_link(node) __get_irn_link(node)
+#define is_unop(node) __is_unop(node)
+#define is_binop(node) __is_binop(node)
+#define is_Bad(node) __is_Bad(node)
+#define is_no_Block(node) __is_no_Block(node)
+#define is_Block(node) __is_Block(node)
# endif /* _IRNODE_T_H_ */