/*
- * 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
- * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
+ * Copyright (C) 1995-2007 University of Karlsruhe. All right reserved.
+ *
+ * This file is part of libFirm.
+ *
+ * This file may be distributed and/or modified under the terms of the
+ * GNU General Public License version 2 as published by the Free Software
+ * Foundation and appearing in the file LICENSE.GPL included in the
+ * packaging of this file.
+ *
+ * Licensees holding valid libFirm Professional Edition licenses may use
+ * this file in accordance with the libFirm Commercial License.
+ * Agreement provided with the Software.
+ *
+ * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+ * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE.
*/
+/**
+ * @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
}
load_attr
-get_irn_load_attr(ir_node *node)
-{
- assert(node->op == op_Load);
- return node->attr.load;
+get_irn_load_attr(ir_node *node) {
+ assert(node->op == op_Load);
+ return node->attr.load;
}
store_attr
-get_irn_store_attr(ir_node *node)
-{
- assert(node->op == op_Store);
- return node->attr.store;
+get_irn_store_attr(ir_node *node) {
+ assert(node->op == op_Store);
+ return node->attr.store;
}
except_attr
return node->attr.except;
}
-void *
-get_irn_generic_attr(ir_node *node) {
- return &node->attr;
+void *(get_irn_generic_attr)(ir_node *node) {
+ assert(is_ir_node(node));
+ return _get_irn_generic_attr(node);
+}
+
+const void *(get_irn_generic_attr_const)(const ir_node *node) {
+ assert(is_ir_node(node));
+ return _get_irn_generic_attr_const(node);
}
unsigned (get_irn_idx)(const ir_node *node) {
}
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;
}
/* 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;
}
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;
}
}
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;
}
#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); \
} \
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); \
} \
}
#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); \
} \
}
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);
}
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);
}
}
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);
}
}
/* 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);
}
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);
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);