X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fir%2Firopt_t.h;h=eb3bdff80e70e42f0d849cb29fc2ccd1bdb42884;hb=8399216d8aebc713bbda04b6e3e250a1d52b20bf;hp=5c7a7a70d6e3b191fea7a3c9f0baca66bc83da24;hpb=3619d43beb322bc550e0a9d17a0d6037490410a2;p=libfirm diff --git a/ir/ir/iropt_t.h b/ir/ir/iropt_t.h index 5c7a7a70d..eb3bdff80 100644 --- a/ir/ir/iropt_t.h +++ b/ir/ir/iropt_t.h @@ -41,5 +41,20 @@ ir_node *optimize_in_place_2 (ir_node *n); /* Calculate a hash value of a node. */ unsigned ir_node_hash (ir_node *node); +/** + * Returns the tarval of a Const node or tarval_bad for all other nodes. + */ +static INLINE tarval * +value_of(ir_node *n) { + if ((n != NULL) && (get_irn_op(n) == op_Const)) + return get_Const_tarval(n); /* might return tarval_bad */ + else + return tarval_bad; +} + +/** + * set the default ir op operations + */ +ir_op *firm_set_default_operations(ir_op *op); # endif /* _IROPT_T_H_ */