X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fir%2Firnode_t.h;h=1ec1f16529e4f7456c22ff4f639a0391e36b6a0a;hb=fed1bdc07c9ec7b4d07a9243ad093c9fdd239fbd;hp=bc2e5266badbd4b43b0f536fe2fc751b870d7a52;hpb=4b7fd8907ceb5c5255814d2578450cddc4ae8048;p=libfirm diff --git a/ir/ir/irnode_t.h b/ir/ir/irnode_t.h index bc2e5266b..1ec1f1652 100644 --- a/ir/ir/irnode_t.h +++ b/ir/ir/irnode_t.h @@ -240,18 +240,19 @@ struct ir_node { ir_mode *mode; /**< Mode of this node. */ struct ir_node **in; /**< array with predecessors / operands */ unsigned long visited; /**< visited counter for walks of the graph */ + unsigned node_idx; /**< the node index of this node in its graph */ void *link; /**< to attach additional information to the node, e.g. used while construction to link Phi0 nodes and - during optimization to link to nodes that - shall replace a node. */ + during optimization to link to nodes that + shall replace a node. */ /* ------- Fields for optimizations / analysis information ------- */ struct ir_node **out; /**< @deprecated array of out edges. */ struct dbg_info* dbi; /**< A pointer to information for debug support. */ /* ------- For debugging ------- */ #ifdef DEBUG_libfirm - int out_valid; + int out_valid; long node_nr; /**< a unique node number for each node to make output - readable. */ + readable. */ #endif /* ------- For analyses -------- */ ir_loop *loop; /**< the loop the node is in. Access routines in irloop.h */ @@ -769,6 +770,18 @@ static INLINE int _is_irn_keep(const ir_node *node) { return is_op_keep(_get_irn_op(node)); } +static INLINE int _is_irn_machine_op(const ir_node *node) { + return is_op_machine(_get_irn_op(node)); +} + +static INLINE int _is_irn_machine_operand(const ir_node *node) { + return is_op_machine_operand(_get_irn_op(node)); +} + +static INLINE int _is_irn_machine_user(const ir_node *node, unsigned n) { + return is_op_machine_user(_get_irn_op(node), n); +} + static INLINE cond_jmp_predicate _get_Cond_jmp_pred(ir_node *node) { assert (_get_irn_op(node) == op_Cond); return node->attr.c.pred; @@ -784,6 +797,10 @@ static INLINE int _get_Psi_n_conds(ir_node *node) { return _get_irn_arity(node) >> 1; } +static INLINE unsigned _get_irn_idx(const ir_node *node) { + return node->node_idx; +} + /* 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) @@ -834,8 +851,12 @@ static INLINE int _get_Psi_n_conds(ir_node *node) { #define get_irn_entity_attr(node) _get_irn_entity_attr(node) #define is_irn_constlike(node) _is_irn_constlike(node) #define is_irn_keep(node) _is_irn_keep(node) +#define is_irn_machine_op(node) _is_irn_machine_op(node) +#define is_irn_machine_operand(node) _is_irn_machine_operand(node) +#define is_irn_machine_user(node, n) _is_irn_machine_user(node, n) #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) +#define get_irn_idx(node) _get_irn_idx(node) # endif /* _IRNODE_T_H_ */