X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;ds=sidebyside;f=ir%2Fir%2Firnode.c;h=e32e06694162379af37bd5be9834da667723b02a;hb=8eba666265da97ca53dc7b81bb1ee981833e435e;hp=10813eeecd6c74c4e57e6a0d6f35b01fd92fc94e;hpb=eb08138c6b80c169945568e4414f491a9bc20388;p=libfirm diff --git a/ir/ir/irnode.c b/ir/ir/irnode.c index 10813eeec..e32e06694 100644 --- a/ir/ir/irnode.c +++ b/ir/ir/irnode.c @@ -17,17 +17,12 @@ * PURPOSE. */ -/* - * Project: libFIRM - * File name: ir/ir/irnode.c - * Purpose: Representation of an intermediate operation. - * Author: Martin Trapp, Christian Schaefer - * Modified by: Goetz Lindenmaier, Michael Beck - * Created: - * CVS-ID: $Id$ - * Copyright: (c) 1998-2006 Universität Karlsruhe +/** + * @file + * @brief Representation of an intermediate operation. + * @author Martin Trapp, Christian Schaefer, Goetz Lindenmaier, Michael Beck + * @version $Id$ */ - #ifdef HAVE_CONFIG_H # include "config.h" #endif @@ -623,7 +618,7 @@ get_irn_except_attr(ir_node *node) { } void * -get_irn_generic_attr(ir_node *node) { +get_irn_generic_attr(const ir_node *node) { return &node->attr; } @@ -1103,7 +1098,7 @@ set_SymConst_type(ir_node *node, ir_type *tp) { } ident * -get_SymConst_name(ir_node *node) { +get_SymConst_name(const ir_node *node) { assert(node->op == op_SymConst && SYMCONST_HAS_ID(get_SymConst_kind(node))); return node->attr.symc.sym.ident_p; } @@ -1116,7 +1111,7 @@ set_SymConst_name(ir_node *node, ident *name) { /* Only to access SymConst of kind symconst_addr_ent. Else assertion: */ -ir_entity *get_SymConst_entity(ir_node *node) { +ir_entity *get_SymConst_entity(const ir_node *node) { assert(node->op == op_SymConst && SYMCONST_HAS_ENT(get_SymConst_kind(node))); return node->attr.symc.sym.entity_p; } @@ -1126,7 +1121,7 @@ void set_SymConst_entity(ir_node *node, ir_entity *ent) { node->attr.symc.sym.entity_p = ent; } -ir_enum_const *get_SymConst_enum(ir_node *node) { +ir_enum_const *get_SymConst_enum(const ir_node *node) { assert(node->op == op_SymConst && SYMCONST_HAS_ENUM(get_SymConst_kind(node))); return node->attr.symc.sym.enum_p; } @@ -1137,7 +1132,7 @@ void set_SymConst_enum(ir_node *node, ir_enum_const *ec) { } union symconst_symbol -get_SymConst_symbol(ir_node *node) { +get_SymConst_symbol(const ir_node *node) { assert(node->op == op_SymConst); return node->attr.symc.sym; } @@ -1357,7 +1352,7 @@ void set_CallBegin_call(ir_node *node, ir_node *call) { #define BINOP(OP) \ -ir_node * get_##OP##_left(ir_node *node) { \ +ir_node * get_##OP##_left(const ir_node *node) { \ assert(node->op == op_##OP); \ return get_irn_n(node, node->op->op_index); \ } \ @@ -1365,7 +1360,7 @@ void set_##OP##_left(ir_node *node, ir_node *left) { \ assert(node->op == op_##OP); \ set_irn_n(node, node->op->op_index, left); \ } \ -ir_node *get_##OP##_right(ir_node *node) { \ +ir_node *get_##OP##_right(const ir_node *node) { \ assert(node->op == op_##OP); \ return get_irn_n(node, node->op->op_index + 1); \ } \ @@ -1375,7 +1370,7 @@ void set_##OP##_right(ir_node *node, ir_node *right) { \ } #define UNOP(OP) \ -ir_node *get_##OP##_op(ir_node *node) { \ +ir_node *get_##OP##_op(const ir_node *node) { \ assert(node->op == op_##OP); \ return get_irn_n(node, node->op->op_index); \ } \ @@ -1494,7 +1489,7 @@ int } ir_node * -get_unop_op(ir_node *node) { +get_unop_op(const ir_node *node) { if (node->op->opar == oparity_unary) return get_irn_n(node, node->op->op_index); @@ -1516,7 +1511,7 @@ int } ir_node * -get_binop_left(ir_node *node) { +get_binop_left(const ir_node *node) { assert(node->op->opar == oparity_binary); return get_irn_n(node, node->op->op_index); } @@ -1528,7 +1523,7 @@ set_binop_left(ir_node *node, ir_node *left) { } ir_node * -get_binop_right(ir_node *node) { +get_binop_right(const ir_node *node) { assert(node->op->opar == oparity_binary); return get_irn_n(node, node->op->op_index + 1); } @@ -2311,7 +2306,7 @@ void set_Bound_upper(ir_node *bound, ir_node *upper) { } /* Return the operand of a Pin node. */ -ir_node *get_Pin_op(ir_node *pin) { +ir_node *get_Pin_op(const ir_node *pin) { assert(pin->op == op_Pin); return get_irn_n(pin, 0); } @@ -2503,6 +2498,16 @@ int return _is_Quot(node); } +int +(is_Add)(const ir_node *node) { + return _is_Add(node); +} + +int +(is_Sub)(const ir_node *node) { + return _is_Sub(node); +} + int (is_Start)(const ir_node *node) { return _is_Start(node); @@ -2518,6 +2523,11 @@ int return _is_Const(node); } +int +(is_Conv)(const ir_node *node) { + return _is_Conv(node); +} + int (is_no_Block)(const ir_node *node) { return _is_no_Block(node);