Create a new node with the right mode instead of changing the mode.
[libfirm] / include / libfirm / ircons.h
index 2d59dc7..adfa04d 100644 (file)
@@ -1270,7 +1270,8 @@ ir_node *new_rd_Const_type(dbg_info *db, ir_graph *irg,
  */
 ir_node *new_rd_Const(dbg_info *db, ir_graph *irg, tarval *con);
 
-/** Constructor for a Const node.
+/**
+ * Constructor for a Const node.
  *
  * Adds the node to the start block.
  *
@@ -1807,25 +1808,21 @@ ir_node *new_rd_Sync(dbg_info *db, ir_node *block, int arity, ir_node *in[]);
  * position of the value within the tuple.
  *
  * @param *db    A pointer for debug information.
- * @param *block The IR block the node belongs to.
  * @param arg    A node producing a tuple.  The node must have mode_T.
  * @param *mode  The mode of the value to project.
  * @param proj   The position of the value in the tuple.
  */
-ir_node *new_rd_Proj(dbg_info *db, ir_node *block, ir_node *arg,
-                     ir_mode *mode, long proj);
+ir_node *new_rd_Proj(dbg_info *db, ir_node *arg, ir_mode *mode, long proj);
 
 /** Constructor for a defaultProj node.
  *
  * Represents the default control flow of a Switch-Cond node.
  *
  * @param *db       A pointer for debug information.
- * @param *block    The IR block the node belongs to.
  * @param arg       A node producing a tuple.
  * @param max_proj  The end position of the value in the tuple.
  */
-ir_node *new_rd_defaultProj(dbg_info *db, ir_node *block,
-                            ir_node *arg, long max_proj);
+ir_node *new_rd_defaultProj(dbg_info *db, ir_node *arg, long max_proj);
 
 /** Constructor for a Tuple node.
  *
@@ -1889,7 +1886,8 @@ ir_node *new_rd_Unknown(dbg_info *db, ir_graph *irg, ir_mode *m);
  *
  * @param *db     A pointer for debug information.
  * @param *block  The block the node belong to.
- * @param *callee The call node visible in the intra procedural view.
+ * @param *ptr    pointer to the called function
+ * @param *call   associated call operation
  */
 ir_node *new_rd_CallBegin(dbg_info *db, ir_node *block, ir_node *ptr, ir_node *call);
 
@@ -2560,23 +2558,20 @@ ir_node *new_r_Sync(ir_node *block, int arity, ir_node *in[]);
  * Projects a single value out of a tuple.  The parameter proj gives the
  * position of the value within the tuple.
  *
- * @param *block The IR block the node belongs to.
  * @param arg    A node producing a tuple.
- * @param *mode  The mode of the value to project.
+ * @param mode   The mode of the value to project.
  * @param proj   The position of the value in the tuple.
  */
-ir_node *new_r_Proj(ir_node *block, ir_node *arg,
-                    ir_mode *mode, long proj);
+ir_node *new_r_Proj(ir_node *arg, ir_mode *mode, long proj);
 
 /** Constructor for a defaultProj node.
  *
  * Represents the default control flow of a Switch-Cond node.
  *
- * @param *block    The IR block the node belongs to.
  * @param arg       A node producing a tuple.
  * @param max_proj  The end  position of the value in the tuple.
  */
-ir_node *new_r_defaultProj(ir_node *block, ir_node *arg, long max_proj);
+ir_node *new_r_defaultProj(ir_node *arg, long max_proj);
 
 
 /** Constructor for a Tuple node.
@@ -2643,7 +2638,8 @@ ir_node *new_r_Unknown(ir_graph *irg, ir_mode *m);
  * node.
  *
  * @param *block  The block the node belong to.
- * @param *callee The call node visible in the  intra procedural view.
+ * @param *ptr    pointer to the called function
+ * @param *call   associated call operation
  */
 ir_node *new_r_CallBegin(ir_node *block, ir_node *ptr, ir_node *call);
 
@@ -2907,6 +2903,15 @@ ir_node *new_d_Const_type(dbg_info *db, tarval *con, ir_type *tp);
  */
 ir_node *new_d_Const(dbg_info *db, tarval *con);
 
+/**
+ * @see new_rd_Const_long()
+ *
+ * @param *db    A pointer for debug information.
+ * @param *mode  The mode of the operands and results.
+ * @param value  A value from which the tarval is made.
+ */
+ir_node *new_d_Const_long(dbg_info *db, ir_mode *mode, long value);
+
 /** Constructor for a SymConst_type node.
  *
  *  This is the constructor for a symbolic constant.
@@ -3456,7 +3461,8 @@ ir_node *new_d_Unknown(dbg_info *db, ir_mode *m);
  * node.Adds the node to the block in current_ir_block.
  *
  * @param *db     A pointer for debug information.
- * @param *callee The call node visible in the  intra procedural view.
+ * @param *ptr    pointer to the called function
+ * @param *call   associated call operation
  */
 ir_node *new_d_CallBegin(dbg_info *db, ir_node *ptr, ir_node *call);
 
@@ -3851,7 +3857,8 @@ ir_node *new_Builtin(ir_node *store, int arity, ir_node *in[],
  * constructor copies the method pointer input from the passed Call
  * node. Adds the node to the block in current_ir_block.
  *
- * @param   *callee A pointer to the called procedure.
+ * @param *ptr    pointer to the called function
+ * @param *call   associated call operation
  */
 ir_node *new_CallBegin(ir_node *ptr, ir_node *call);
 
@@ -4346,15 +4353,41 @@ ir_node *new_ASM(int arity, ir_node *in[], ir_asm_constraint *inputs,
                  int n_outs, ir_asm_constraint *outputs,
                  int n_clobber, ident *clobber[], ident *asm_text);
 
-/** Constructor for a Dummy node.
+/**
+ * @brief Constructor for a Dummy node.
  *
+ * @param *db       debug info for the node
  * @param *mode     The mode of the node.
+ * @param *irg      the graph to put the node into
+ * @returns         the newly created note
  */
-ir_node *new_Dummy(ir_mode *mode);
+ir_node *new_rd_Dummy(dbg_info *db, ir_graph *irg, ir_mode *mode);
 
+/**
+ * @copybrief new_rd_Dummy()
+ *
+ * @param *mode     The mode of the node.
+ * @param *irg      the graph to put the node into
+ * @returns         the newly created note
+ */
 ir_node *new_r_Dummy(ir_graph *irg, ir_mode *mode);
 
-ir_node *new_rd_Dummy(dbg_info *db, ir_graph *irg, ir_mode *mode);
+/**
+ * @copybrief new_rd_Dummy()
+ *
+ * @param *db       debug info for the node
+ * @param *mode     The mode of the node.
+ * @returns         the newly created note
+ */
+ir_node *new_d_Dummy(dbg_info *db, ir_mode *mode);
+
+/**
+ * @copybrief new_rd_Dummy()
+ *
+ * @param *mode     The mode of the node.
+ * @returns         the newly created note
+ */
+ir_node *new_Dummy(ir_mode *mode);
 
 /*---------------------------------------------------------------------*/
 /* The comfortable interface.                                          */
@@ -4423,6 +4456,16 @@ ir_node *get_value(int pos, ir_mode *mode);
  */
 void set_value(int pos, ir_node *value);
 
+/**
+ * Find the value number for a node in the current block.
+ *
+ * @param value  the searched value
+ *
+ * @return the value number of the value or -1 if this value has
+ * no value number in the current block.
+ */
+int find_value(ir_node *value);
+
 /** Get the current memory state.
  *
  * Use this function to obtain the last definition of the memory