Add is_Conv().
[libfirm] / ir / ir / irnode.h
index 43a3bb7..14449e3 100644 (file)
@@ -1,16 +1,30 @@
 /*
- * Project:     libFIRM
- * File name:   ir/ir/irnode.h
- * 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.
  */
-#ifndef _FIRM_IR_IRNODE_H_
-#define _FIRM_IR_IRNODE_H_
+
+/**
+ * @file
+ * @brief   Representation of an intermediate operation.
+ * @author  Martin Trapp, Christian Schaefer, Goetz Lindenmaier, Michael Beck
+ * @version $Id$
+ */
+#ifndef FIRM_IR_IRNODE_H
+#define FIRM_IR_IRNODE_H
 
 #include <stddef.h>
 
@@ -159,6 +173,12 @@ ir_node *get_irn_inter_n(const ir_node *node, int n);
 
 /** Replace the n-th predecessor of a node with a new one. */
 void set_irn_n(ir_node *node, int n, ir_node *in);
+/**
+ * Appends a new predecessor to a node. This only works for nodes with
+ * variable arity!
+ * @returns   the number of the new input
+ */
+int add_irn_n(ir_node *node, ir_node *in);
 /* Sets the mode struct of node.  */
 void set_irn_mode(ir_node *node, ir_mode *mode);
 /** Gets the mode struct of a node.  */
@@ -339,7 +359,7 @@ void      set_Block_matured(ir_node *node, int matured);
 
 /** A visited flag only for block nodes.
  *  @see also: get_irn_visited() inc_irg_visited() inc_irg_block_visited()*/
-unsigned long get_Block_block_visited(ir_node *node);
+unsigned long get_Block_block_visited(const ir_node *node);
 void      set_Block_block_visited(ir_node *node, unsigned long visit);
 
 /**
@@ -351,7 +371,8 @@ int       is_Block_dead(const ir_node *block);
 
 /* For this current_ir_graph must be set. */
 void      mark_Block_block_visited(ir_node *node);
-int       Block_not_block_visited(ir_node *node);
+int       Block_not_block_visited(const ir_node *node);
+int       Block_block_visited(const ir_node *node);
 
 /* Set and remove interprocedural predecessors. If the interprocedural
  * predecessors are removed, the node has the same predecessors in
@@ -980,6 +1001,9 @@ void      set_Proj_pred(ir_node *node, ir_node *pred);
 /** Return the projection number of a Proj node. */
 long      get_Proj_proj(const ir_node *node);
 void      set_Proj_proj(ir_node *node, long proj);
+long     get_VProj_proj(const ir_node *node);
+void     set_VProj_proj(ir_node *node, long value);
+
 
 ir_node **get_Tuple_preds_arr(ir_node *node);
 int       get_Tuple_n_preds(ir_node *node);
@@ -1130,6 +1154,8 @@ ir_node *skip_Confirm(ir_node *node);
 ir_node *skip_HighLevel(ir_node *node);
 /** returns true if irn is a Const node. */
 int      is_Const(const ir_node *node);
+/** returns true if a node is a Conv node */
+int      is_Conv(const ir_node *node);
 /** returns true if node is a Bad node. */
 int      is_Bad(const ir_node *node);
 /** returns true if node is a NoMem node. */
@@ -1142,6 +1168,12 @@ int      is_Mod(const ir_node *node);
 int      is_Div(const ir_node *node);
 /** return true if node is a DivMod node. */
 int      is_DivMod(const ir_node *node);
+/** return true if node is a Quot node. */
+int      is_Quot(const ir_node *node);
+/** return true if node is an Add node. */
+int      is_Add(const ir_node *node);
+/** return true if node is a Sub node. */
+int      is_Sub(const ir_node *node);
 /** returns true if the node is not a Block */
 int      is_no_Block(const ir_node *node);
 /** returns true if the node is a Block */
@@ -1370,4 +1402,4 @@ int dump_node_opcode(FILE *F, ir_node *n);
 }
 #endif
 
-#endif /* _FIRM_IR_IRNODE_H_ */
+#endif