/*
- * Project: libFIRM
- * File name: ir/ir/irnode_t.h
- * Purpose: Representation of an intermediate operation -- private header.
- * Author: Martin Trapp, Christian Schaefer
- * Modified by: Goetz Lindenmaier, Michael Beck
- * Created:
- * CVS-ID: $Id$
- * Copyright: (c) 1998-2003 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 irnode_t.h
- *
- * Declarations of an ir node.
- *
- * @author Martin Trapp, Christian Schaefer
+ * @file
+ * @brief Representation of an intermediate operation -- private header.
+ * @author Martin Trapp, Christian Schaefer, Goetz Lindenmaier, Michael Beck
+ * @version $Id$
*/
-#ifndef _FIRM_IRNODE_T_H_
-#define _FIRM_IRNODE_T_H_
+#ifndef FIRM_IR_IRNODE_T_H
+#define FIRM_IR_IRNODE_T_H
#include "firm_config.h"
#include "irnode.h"
assert(-1 <= n && n < _get_irn_intra_arity(node));
nn = node->in[n + 1];
- assert(nn != NULL);
- if (!nn || (nn->op != op_Id)) return nn;
+ if (nn == NULL) {
+ /* only block inputs are allowed to be NULL */
+ assert(n == -1 && "NULL input of a node");
+ return NULL;
+ }
+ if (nn->op != op_Id) return nn;
return (node->in[n + 1] = skip_Id(nn));
}
return (_get_irn_op(node) == op_Quot);
}
+static INLINE int
+_is_Add(const ir_node *node) {
+ assert(node);
+ return (_get_irn_op(node) == op_Add);
+}
+
+static INLINE int
+_is_Sub(const ir_node *node) {
+ assert(node);
+ return (_get_irn_op(node) == op_Sub);
+}
+
static INLINE int
_is_Start(const ir_node *node) {
assert(node);
return (_get_irn_op(node) == op_Const);
}
+static INLINE int
+_is_Conv(const ir_node *node) {
+ assert(node);
+ return (_get_irn_op(node) == op_Conv);
+}
+
static INLINE int
_is_CopyB(const ir_node *node) {
assert(node);
#define is_unop(node) _is_unop(node)
#define is_binop(node) _is_binop(node)
#define is_Const(node) _is_Const(node)
+#define is_Conv(node) _is_Conv(node)
#define is_Unknown(node) _is_Unknown(node)
#define is_Return(node) _is_Return(node)
#define is_Call(node) _is_Call(node)
#define is_Div(node) _is_Div(node)
#define is_DivMod(node) _is_DivMod(node)
#define is_Quot(node) _is_Quot(node)
+#define is_Add(node) _is_Add(node)
+#define is_Sub(node) _is_Sub(node)
#define is_no_Block(node) _is_no_Block(node)
#define is_Block(node) _is_Block(node)
#define get_Block_n_cfgpreds(node) _get_Block_n_cfgpreds(node)
#define get_irn_ins_or_deps(node) _get_irn_ins_or_deps(node)
#define get_irn_in_or_dep(node, pos) _get_irn_in_or_dep(node, pos)
-#endif /* _FIRM_IRNODE_T_H_ */
+#endif