From: Michael Beck Date: Wed, 14 Sep 2005 11:08:14 +0000 (+0000) Subject: is_irn_constlike() added X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=7af00ed62779dab5ca6f68ccb99e93cac0efe0ab;p=libfirm is_irn_constlike() added renamed is_forking_op() to is_irn_forking() [r6616] --- diff --git a/ir/ir/irnode.c b/ir/ir/irnode.c index fe3421ecb..304765941 100644 --- a/ir/ir/irnode.c +++ b/ir/ir/irnode.c @@ -2251,15 +2251,19 @@ ir_node *get_fragile_op_mem(ir_node *node) { } /* Returns true if the operation is a forking control flow operation. */ -int -is_forking_op(const ir_node *node) { - return is_op_forking(get_irn_op(node)); +int (is_irn_forking)(const ir_node *node) { + return _is_irn_forking(node); } type *(get_irn_type)(ir_node *node) { return _get_irn_type(node); } +/* Returns non-zero for constant-like nodes. */ +int (is_irn_constlike)(const ir_node *node) { + return _is_irn_constlike(node); +} + /** the get_type operation must be always implemented */ static type *get_Null_type(ir_node *n) { return NULL; diff --git a/ir/ir/irnode.h b/ir/ir/irnode.h index fcb79fb7a..24573e1ad 100644 --- a/ir/ir/irnode.h +++ b/ir/ir/irnode.h @@ -987,13 +987,16 @@ ir_node *get_fragile_op_mem(ir_node *node); /** Returns true if the operation is a forking control flow * operation: Cond. */ -int is_forking_op(const ir_node *node); +int is_irn_forking(const ir_node *node); /** Return the type associated with the value produced by n * if the node remarks this type as it is the case for * Cast, Const, SymConst and some Proj nodes. */ type *get_irn_type(ir_node *n); +/** Returns non-zero for constant-like nodes. */ +int is_irn_constlike(const ir_node *node); + /** * Access custom node data. * The data must have been registered with diff --git a/ir/ir/irnode_t.h b/ir/ir/irnode_t.h index 0a58755ad..842a3eab3 100644 --- a/ir/ir/irnode_t.h +++ b/ir/ir/irnode_t.h @@ -660,10 +660,18 @@ static INLINE cnst_classify_t _classify_Const(ir_node *node) { return CNST_NO_CONST; } +static INLINE int _is_irn_forking(const ir_node *node) { + return is_op_forking(_get_irn_op(node)); +} + static INLINE type *_get_irn_type(ir_node *node) { return _get_irn_op(node)->get_type(node); } +static INLINE int _is_irn_constlike(const ir_node *node) { + return is_op_constlike(_get_irn_op(node)); +} + /* 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) @@ -703,6 +711,8 @@ static INLINE type *_get_irn_type(ir_node *node) { #define is_Block_dead(block) _is_Block_dead(block) #define get_Const_tarval(node) _get_Const_tarval(node) #define classify_Const(node) _classify_Const(node) +#define is_irn_forking(node) _is_irn_forking(node) #define get_irn_type(node) _get_irn_type(node) +#define is_irn_constlike(node) _is_irn_constlike(node) # endif /* _IRNODE_T_H_ */