X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fir%2Firopt_t.h;h=eb3bdff80e70e42f0d849cb29fc2ccd1bdb42884;hb=8399216d8aebc713bbda04b6e3e250a1d52b20bf;hp=3bee1f3a09e88611eb841b2129bed406d68d3305;hpb=6023590e8c7b401803f9b805886277de002efa19;p=libfirm diff --git a/ir/ir/iropt_t.h b/ir/ir/iropt_t.h index 3bee1f3a0..eb3bdff80 100644 --- a/ir/ir/iropt_t.h +++ b/ir/ir/iropt_t.h @@ -1,6 +1,14 @@ -/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe -* All rights reserved. -*/ +/* + * Project: libFIRM + * File name: ir/ir/iropt_t.h + * Purpose: iropt --- optimizations intertwined with IR construction -- private header. + * Author: Martin Trapp, Christian Schaefer + * Modified by: Goetz Lindenmaier + * Created: + * CVS-ID: $Id$ + * Copyright: (c) 1998-2003 Universität Karlsruhe + * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE. + */ /** * @file iropt_t.h @@ -10,8 +18,6 @@ * @author Martin Trapp, Christian Schaefer */ -/* $Id$ */ - # ifndef _IROPT_T_H_ # define _IROPT_T_H_ @@ -32,5 +38,23 @@ ir_node *optimize_node (ir_node *n); 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_ */