Removed the arch_register_type_is() macro.
[libfirm] / include / libfirm / ircons.h
index dc3982e..64e9706 100644 (file)
  *    ir_node *new_IJmp     (ir_node *tgt);
  *    ir_node *new_Cond     (ir_node *c);
  *    ir_node *new_Return   (ir_node *store, int arity, ir_node **in);
- *    ir_node *new_Const    (tarval *con);
+ *    ir_node *new_Const    (ir_tarval *con);
  *    ir_node *new_SymConst (ir_mode *mode, symconst_symbol value, symconst_kind kind);
  *    ir_node *new_simpleSel (ir_node *store, ir_node *objptr, ir_entity *ent);
  *    ir_node *new_Sel    (ir_node *store, ir_node *objptr, int arity,
  *      Control flow to the end block.
  *
  *
- *    ir_node *new_Const (tarval *con)
+ *    ir_node *new_Const (ir_tarval *con)
  *    -----------------------------------------------
  *
  *    Creates a constant in the constant table and adds a Const node
@@ -1127,6 +1127,7 @@ typedef enum ir_cons_flags {
        cons_unaligned = 1U << 1,  /**< Memory operation is unaligned. */
        cons_floats    = 1U << 2   /**< Memory operation can float. */
 } ir_cons_flags;
+ENUM_BITSET(ir_cons_flags)
 
 /*-------------------------------------------------------------------------*/
 /* The raw interface                                                       */
@@ -1148,17 +1149,15 @@ FIRM_API ir_node *new_rd_Block(dbg_info *db, ir_graph *irg, int arity, ir_node *
  *
  * @param *db    A pointer for debug information.
  * @param *irg   The IR graph the node belongs to.
- * @param *block The IR block the node belongs to.
  */
-FIRM_API ir_node *new_rd_Start(dbg_info *db, ir_graph *irg, ir_node *block);
+FIRM_API ir_node *new_rd_Start(dbg_info *db, ir_graph *irg);
 
 /** Constructor for a End node.
  *
  * @param *db    A pointer for  debug information.
  * @param *irg   The IR graph the node  belongs to.
- * @param *block The IR block the node belongs to.
  */
-FIRM_API ir_node *new_rd_End(dbg_info *db, ir_graph *irg, ir_node *block);
+FIRM_API ir_node *new_rd_End(dbg_info *db, ir_graph *irg, int arity, ir_node *in[]);
 
 /** Constructor for a Jmp node.
  *
@@ -1209,22 +1208,6 @@ FIRM_API ir_node *new_rd_Cond(dbg_info *db, ir_node *block, ir_node *c);
 FIRM_API ir_node *new_rd_Return(dbg_info *db, ir_node *block,
                                 ir_node *store, int arity, ir_node *in[]);
 
-/** Constructor for a Const_type node.
- *
- * Adds the node to the start block.
- *
- * The constant represents a target value.  This constructor sets high
- * level type information for the constant value.
- * Derives mode from passed tarval.
- *
- * @param *db    A pointer for debug information.
- * @param *irg   The IR graph the node  belongs to.
- * @param *con   Points to an entry in the constant table.
- * @param *tp    The type of the constant.
- */
-FIRM_API ir_node *new_rd_Const_type(dbg_info *db, ir_graph *irg,
-                                    tarval *con, ir_type *tp);
-
 /** Constructor for a Const node.
  *
  * Adds the node to the start block.
@@ -1238,7 +1221,7 @@ FIRM_API ir_node *new_rd_Const_type(dbg_info *db, ir_graph *irg,
  * @param *irg   The IR graph the node  belongs to.
  * @param *con   Points to an entry in the constant table.
  */
-FIRM_API ir_node *new_rd_Const(dbg_info *db, ir_graph *irg, tarval *con);
+FIRM_API ir_node *new_rd_Const(dbg_info *db, ir_graph *irg, ir_tarval *con);
 
 /**
  * Constructor for a Const node.
@@ -1257,7 +1240,7 @@ FIRM_API ir_node *new_rd_Const(dbg_info *db, ir_graph *irg, tarval *con);
 FIRM_API ir_node *new_rd_Const_long(dbg_info *db, ir_graph *irg,
                                     ir_mode *mode, long value);
 
-/** Constructor for a SymConst_type node.
+/** Constructor for a SymConst node.
  *
  *  This is the constructor for a symbolic constant.
  *    There are several kinds of symbolic constants:
@@ -1291,15 +1274,6 @@ FIRM_API ir_node *new_rd_Const_long(dbg_info *db, ir_graph *irg,
  * @param val     A type, ident, entity or enum constant depending on the
  *                SymConst kind.
  * @param kind    The kind of the symbolic constant, see the list above
- * @param tp      The source type of the constant.
- */
-FIRM_API ir_node *new_rd_SymConst_type(dbg_info *db, ir_graph *irg,
-                                       ir_mode *mode, union symconst_symbol val,
-                                       symconst_kind kind, ir_type *tp);
-
-/** Constructor for a SymConst node.
- *
- *  Same as new_rd_SymConst_type, except that it sets the type to type_unknown.
  */
 FIRM_API ir_node *new_rd_SymConst(dbg_info *db, ir_graph *irg, ir_mode *mode,
                                   union symconst_symbol value,
@@ -1307,51 +1281,46 @@ FIRM_API ir_node *new_rd_SymConst(dbg_info *db, ir_graph *irg, ir_mode *mode,
 
 /** Constructor for a SymConst addr_ent node.
  *
- * Same as new_rd_SymConst_type, except that the constructor is tailored for
+ * Same as new_rd_SymConst, except that the constructor is tailored for
  * symconst_addr_ent.
  * Adds the SymConst to the start block of irg. */
 FIRM_API ir_node *new_rd_SymConst_addr_ent(dbg_info *db, ir_graph *irg,
-                                           ir_mode *mode, ir_entity *symbol,
-                                           ir_type *tp);
+                                           ir_mode *mode, ir_entity *symbol);
 
 /** Constructor for a SymConst ofs_ent node.
  *
- * Same as new_rd_SymConst_type, except that the constructor is tailored for
+ * Same as new_rd_SymConst, except that the constructor is tailored for
  * symconst_ofs_ent.
  * Adds the SymConst to the start block of irg.
  */
 FIRM_API ir_node *new_rd_SymConst_ofs_ent(dbg_info *db, ir_graph *irg,
-                                          ir_mode *mode, ir_entity *symbol,
-                                          ir_type *tp);
+                                          ir_mode *mode, ir_entity *symbol);
 
 /** Constructor for a SymConst type_tag node.
  *
- * Same as new_rd_SymConst_type, except that the constructor is tailored for
+ * Same as new_rd_SymConst, except that the constructor is tailored for
  * symconst_type_tag.
  * Adds the SymConst to the start block of irg.
  */
 FIRM_API ir_node *new_rd_SymConst_type_tag(dbg_info *db, ir_graph *irg,
-                                           ir_mode *mode, ir_type *symbol,
-                                           ir_type *tp);
+                                           ir_mode *mode, ir_type *symbol);
 
 /** Constructor for a SymConst size node.
  *
- * Same as new_rd_SymConst_type, except that the constructor is tailored for
+ * Same as new_rd_SymConst, except that the constructor is tailored for
  * symconst_type_size.
  * Adds the SymConst to the start block of irg. */
 FIRM_API ir_node *new_rd_SymConst_size(dbg_info *db, ir_graph *irg,
-                                       ir_mode *mode, ir_type *symbol,
-                                       ir_type *tp);
+                                       ir_mode *mode, ir_type *symbol);
 
 /** Constructor for a SymConst size node.
  *
- * Same as new_rd_SymConst_type, except that the constructor is tailored for
+ * Same as new_rd_SymConst, except that the constructor is tailored for
  * symconst_type_align.
  * Adds the SymConst to the start block of irg.
  */
 FIRM_API ir_node *new_rd_SymConst_align(dbg_info *db, ir_graph *irg,
-                                        ir_mode *mode, ir_type *symbol,
-                                        ir_type *tp);
+                                        ir_mode *mode, ir_type *symbol);
 
 /** Constructor for a simpleSel node.
  *
@@ -1837,6 +1806,13 @@ FIRM_API ir_node *new_rd_Tuple(dbg_info *db, ir_node *block,
 FIRM_API ir_node *new_rd_Id(dbg_info *db, ir_node *block,
                             ir_node *val, ir_mode *mode);
 
+/** Constructor for a Bad node.
+ *
+ * @param *db     A pointer for debug information.
+ * @param *irg    The IR graph the node  belongs to.
+ */
+FIRM_API ir_node *new_rd_Bad(dbg_info *db, ir_graph *irg);
+
 /** Constructor for a Confirm node.
  *
  * Specifies constraints for a value.  To support dataflow analyses.
@@ -1863,6 +1839,13 @@ FIRM_API ir_node *new_rd_Confirm(dbg_info *db, ir_node *block,
  */
 FIRM_API ir_node *new_rd_Unknown(dbg_info *db, ir_graph *irg, ir_mode *m);
 
+/** Constructor for a NoMem node.
+ *
+ * @param *db     A pointer for debug information.
+ * @param *irg    The IR graph the node belongs to.
+ */
+FIRM_API ir_node *new_rd_NoMem(dbg_info *db, ir_graph *irg);
+
 /** Constructor for a Mux node.
  *
  * @param *db       A pointer for debug information.
@@ -1975,19 +1958,11 @@ FIRM_API ir_node *new_rd_ASM(dbg_info *db, ir_node *block,
  */
 FIRM_API ir_node *new_r_Block(ir_graph *irg, int arity, ir_node *in[]);
 
-/** Constructor for a Start node.
- *
- * @param *irg   The IR graph the node belongs to.
- * @param *block The IR block the node belongs to.
- */
-FIRM_API ir_node *new_r_Start(ir_graph *irg, ir_node *block);
+/** Constructor for a Start node. */
+FIRM_API ir_node *new_r_Start(ir_graph *irg);
 
-/** Constructor for a End node.
- *
- * @param *irg   The IR graph the node  belongs to.
- * @param *block The IR block the node belongs to.
- */
-FIRM_API ir_node *new_r_End(ir_graph *irg, ir_node *block);
+/** Constructor for a End node. */
+FIRM_API ir_node *new_r_End(ir_graph *irg, int arity, ir_node *in[]);
 
 /** Constructor for a Jmp node.
  *
@@ -2046,7 +2021,7 @@ FIRM_API ir_node *new_r_Return(ir_node *block, ir_node *store,
  * @param *irg   The IR graph the node  belongs to.
  * @param *con   Points to an entry in the constant table.
  */
-FIRM_API ir_node *new_r_Const(ir_graph *irg, tarval *con);
+FIRM_API ir_node *new_r_Const(ir_graph *irg, ir_tarval *con);
 
 /** Constructor for a Const node.
  *
@@ -2062,20 +2037,6 @@ FIRM_API ir_node *new_r_Const(ir_graph *irg, tarval *con);
  */
 FIRM_API ir_node *new_r_Const_long(ir_graph *irg, ir_mode *mode, long value);
 
-/** Constructor for a Const_type node.
- *
- * Adds the node to the start block.
- *
- * The constant represents a target value.  This constructor sets high
- * level type information for the constant value.
- * Derives mode from passed tarval.
- *
- * @param *irg   The IR graph the node  belongs to.
- * @param *con   Points to an entry in the constant table.
- * @param *tp    The type of the constant.
- */
-FIRM_API ir_node *new_r_Const_type(ir_graph *irg, tarval *con, ir_type *tp);
-
 /** Constructor for a SymConst node.
  *
  *  This is the constructor for a symbolic constant.
@@ -2550,9 +2511,6 @@ FIRM_API ir_node *new_r_Tuple(ir_node *block, int arity, ir_node *in[]);
 FIRM_API ir_node *new_r_Id(ir_node *block, ir_node *val, ir_mode *mode);
 
 /** Constructor for a Bad node.
- *
- * Returns the unique Bad node of the graph.  The same as
- * get_irg_bad().
  *
  * @param *irg    The IR graph the node  belongs to.
  */
@@ -2584,9 +2542,6 @@ FIRM_API ir_node *new_r_Confirm(ir_node *block, ir_node *val, ir_node *bound,
 FIRM_API ir_node *new_r_Unknown(ir_graph *irg, ir_mode *m);
 
 /** Constructor for a NoMem node.
- *
- * Returns the unique NoMem node of the graph.  The same as
- * get_irg_no_mem().
  *
  * @param *irg    The IR graph the node belongs to.
  */
@@ -2684,9 +2639,11 @@ FIRM_API ir_node *new_r_ASM(ir_node *block,
  *  @param target  The new current block.
  */
 FIRM_API void set_cur_block(ir_node *target);
+FIRM_API void set_r_cur_block(ir_graph *irg, ir_node *target);
 
 /** Returns the current block of the current graph. */
 FIRM_API ir_node *get_cur_block(void);
+FIRM_API ir_node *get_r_cur_block(ir_graph *irg);
 
 /** Constructor for a Block node.
  *
@@ -2714,7 +2671,7 @@ FIRM_API ir_node *new_d_Start(dbg_info *db);
  *
  * @param *db     A pointer for debug information.
  */
-FIRM_API ir_node *new_d_End(dbg_info *db);
+FIRM_API ir_node *new_d_End(dbg_info *db, int arity, ir_node *in[]);
 
 /** Constructor for a Jmp node.
  *
@@ -2767,21 +2724,6 @@ FIRM_API ir_node *new_d_Cond(dbg_info *db, ir_node *c);
 FIRM_API ir_node *new_d_Return(dbg_info *db, ir_node *store,
                                int arity, ir_node *in[]);
 
-/** Constructor for a Const_type node.
- *
- * Adds the node to the start block.
- *
- * The constant represents a target value.  This constructor sets high
- * level type information for the constant value.
- * Derives mode from passed tarval.
- *
- * @param *db    A pointer for debug information.
- * @param *con   Points to an entry in the constant table. This pointer is
-                 added to the attributes of the node.
- * @param *tp    The type of the constant.
- */
-FIRM_API ir_node *new_d_Const_type(dbg_info *db, tarval *con, ir_type *tp);
-
 /** Constructor for a Const node.
  *
  * Adds the node to the block in current_ir_block.
@@ -2795,7 +2737,7 @@ FIRM_API ir_node *new_d_Const_type(dbg_info *db, tarval *con, ir_type *tp);
  * @param *con   Points to an entry in the constant table. This pointer is added
  *               to the attributes of the node.
  */
-FIRM_API ir_node *new_d_Const(dbg_info *db, tarval *con);
+FIRM_API ir_node *new_d_Const(dbg_info *db, ir_tarval *con);
 
 /**
  * @see new_rd_Const_long()
@@ -2806,7 +2748,7 @@ FIRM_API ir_node *new_d_Const(dbg_info *db, tarval *con);
  */
 FIRM_API ir_node *new_d_Const_long(dbg_info *db, ir_mode *mode, long value);
 
-/** Constructor for a SymConst_type node.
+/** Constructor for a SymConst node.
  *
  *  This is the constructor for a symbolic constant.
  *    There are several kinds of symbolic constants:
@@ -2839,15 +2781,6 @@ FIRM_API ir_node *new_d_Const_long(dbg_info *db, ir_mode *mode, long value);
  * @param value   A type, ident, entity or enum constant depending on the
  *                SymConst kind.
  * @param kind    The kind of the symbolic constant, see the list above
- * @param tp      The source type of the constant.
- */
-FIRM_API ir_node *new_d_SymConst_type(dbg_info *db, ir_mode *mode,
-                                      union symconst_symbol value,
-                                      symconst_kind kind, ir_type *tp);
-
-/** Constructor for a SymConst node.
- *
- *  Same as new_d_SymConst_type, except that it sets the type to type_unknown.
  */
 FIRM_API ir_node *new_d_SymConst(dbg_info *db, ir_mode *mode,
                                  union symconst_symbol value,
@@ -3343,6 +3276,12 @@ FIRM_API ir_node *new_d_Tuple(dbg_info *db, int arity, ir_node *in[]);
  */
 FIRM_API ir_node *new_d_Id(dbg_info *db, ir_node *val, ir_mode *mode);
 
+/** Constructor for a Bad node.
+ *
+ * @param *db     A pointer for debug information.
+ */
+FIRM_API ir_node *new_d_Bad(dbg_info *db);
+
 /** Constructor for a Confirm node.
  *
  * Constructor for a Confirm node. Adds the node to the block in current_ir_block.
@@ -3369,6 +3308,12 @@ FIRM_API ir_node *new_d_Confirm(dbg_info *db, ir_node *val, ir_node *bound,
  */
 FIRM_API ir_node *new_d_Unknown(dbg_info *db, ir_mode *m);
 
+/** Constructor for a NoMem node.
+ *
+ * @param *db     A pointer for debug information.
+ */
+FIRM_API ir_node *new_d_NoMem(dbg_info *db);
+
 /** Constructor for a Mux node.
  *
  * @param *db       A pointer for debug information.
@@ -3477,7 +3422,7 @@ FIRM_API ir_node *new_Start(void);
  *
  * Adds the node to the block in current_ir_block.
  */
-FIRM_API ir_node *new_End(void);
+FIRM_API ir_node *new_End(int arity, ir_node *in[]);
 
 /** Constructor for a Jump node.
  *
@@ -3532,7 +3477,7 @@ FIRM_API ir_node *new_Return(ir_node *store, int arity, ir_node *in[]);
  * @param *con   Points to an entry in the constant table. This pointer is
  *               added to the attributes of  the node.
  */
-FIRM_API ir_node *new_Const(tarval *con);
+FIRM_API ir_node *new_Const(ir_tarval *con);
 
 /**
  * Make a const from a long.
@@ -3547,48 +3492,6 @@ FIRM_API ir_node *new_Const(tarval *con);
  */
 FIRM_API ir_node *new_Const_long(ir_mode *mode, long value);
 
-/** Constructor for a Const node.
- *
- * Derives mode from passed tarval. */
-FIRM_API ir_node *new_Const_type(tarval *con, ir_type *tp);
-
-/** Constructor for a SymConst_type node.
- *
- *  This is the constructor for a symbolic constant.
- *    There are several kinds of symbolic constants:
- *    - symconst_type_tag   The symbolic constant represents a type tag.  The
- *                          type the tag stands for is given explicitly.
- *    - symconst_type_size  The symbolic constant represents the size of a type.
- *                          The type of which the constant represents the size
- *                          is given explicitly.
- *    - symconst_type_align The symbolic constant represents the alignment of a
- *                          type.  The type of which the constant represents the
- *                          size is given explicitly.
- *    - symconst_addr_ent   The symbolic constant represents the address of an
- *                          entity (variable or method).  The variable is given
- *                          explicitly by a firm entity.
- *    - symconst_ofs_ent    The symbolic constant represents the offset of an
- *                          entity in its owner type.
- *    - symconst_enum_const The symbolic constant is a enumeration constant of
- *                          an enumeration type.
- *
- *    Inputs to the node:
- *      No inputs except the block it belongs to.
- *    Outputs of the node.
- *      An unsigned integer (I_u) or a pointer (P).
- *
- *    Mention union in declaration so that the firmjni generator recognizes that
- *    it can not cast the argument to an int.
- *
- * @param mode    The mode for the SymConst.
- * @param value   A type, ident, entity or enum constant depending on the
- *                SymConst kind.
- * @param kind    The kind of the symbolic constant, see the list above
- * @param tp      The source type of the constant.
- */
-FIRM_API ir_node *new_SymConst_type(ir_mode *mode, union symconst_symbol value,
-                                    symconst_kind kind, ir_type *tp);
-
 /** Constructor for a SymConst node.
  *
  *  This is the constructor for a symbolic constant.
@@ -4047,9 +3950,6 @@ FIRM_API ir_node *new_Tuple(int arity, ir_node *in[]);
 FIRM_API ir_node *new_Id(ir_node *val, ir_mode *mode);
 
 /** Constructor for a Bad node.
- *
- * Returns the unique Bad node of the graph.  The same as
- * get_irg_bad().
  */
 FIRM_API ir_node *new_Bad(void);
 
@@ -4076,11 +3976,7 @@ FIRM_API ir_node *new_Confirm(ir_node *val, ir_node *bound, pn_Cmp cmp);
  */
 FIRM_API ir_node *new_Unknown(ir_mode *m);
 
-/** Constructor for a NoMem node.
- *
- * Returns the unique NoMem node of the graph.  The same as
- * get_irg_no_mem().
- */
+/** Constructor for a NoMem node. */
 FIRM_API ir_node *new_NoMem(void);
 
 /** Constructor for a Mux node.
@@ -4217,20 +4113,8 @@ FIRM_API ir_node *new_Dummy(ir_mode *mode);
  */
 FIRM_API ir_node *new_d_immBlock(dbg_info *db);
 FIRM_API ir_node *new_immBlock(void);
-
-/** Create an immature PartBlock.
- *
- * An immature block has only one Block or PartBlock predecessor.
- * A PartBlock forms together with one BLock and possibly other
- * PartBlocks a MacroBlock.
- *
- * Adds the PartBlock to the graph in current_ir_graph. Does set
- * current_block.  Can be used with automatic Phi node construction.
- * This constructor can only be used if the graph is in
- * state_building.
- */
-FIRM_API ir_node *new_d_immPartBlock(dbg_info *db, ir_node *pred_jmp);
-FIRM_API ir_node *new_immPartBlock(ir_node *pred_jmp);
+FIRM_API ir_node *new_r_immBlock(ir_graph *irg);
+FIRM_API ir_node *new_rd_immBlock(dbg_info *db, ir_graph *irg);
 
 /** Add a control flow edge to an immature block. */
 FIRM_API void add_immBlock_pred(ir_node *immblock, ir_node *jmp);
@@ -4248,8 +4132,8 @@ FIRM_API void mature_immBlock(ir_node *block);
  * @param  pos   The position/id of the local variable.
  * @param *mode  The mode of the value to get.
  */
-FIRM_API ir_node *get_d_value(dbg_info *db, int pos, ir_mode *mode);
 FIRM_API ir_node *get_value(int pos, ir_mode *mode);
+FIRM_API ir_node *get_r_value(ir_graph *irg, int pos, ir_mode *mode);
 
 /**
  * Try to guess the mode of a local variable.
@@ -4272,6 +4156,7 @@ FIRM_API ir_mode *ir_guess_mode(int pos);
  * @param *value The new value written to the local variable.
  */
 FIRM_API void set_value(int pos, ir_node *value);
+FIRM_API void set_r_value(ir_graph *irg, int pos, ir_node *value);
 
 /**
  * Find the value number for a node in the current block.
@@ -4290,6 +4175,7 @@ FIRM_API int find_value(ir_node *value);
  * state value.
  */
 FIRM_API ir_node *get_store(void);
+FIRM_API ir_node *get_r_store(ir_graph *irg);
 
 /** Remark a new definition of the memory state.
  *
@@ -4299,6 +4185,7 @@ FIRM_API ir_node *get_store(void);
  * @param *store The new memory state.
  */
 FIRM_API void set_store(ir_node *store);
+FIRM_API void set_r_store(ir_graph *irg, ir_node *store);
 
 /** keep this node alive even if End is not control-reachable from it
  *
@@ -4306,10 +4193,6 @@ FIRM_API void set_store(ir_node *store);
  */
 FIRM_API void keep_alive(ir_node *ka);
 
-/** Returns the frame type of the current graph */
-FIRM_API ir_type *get_cur_frame_type(void);
-
-
 /* --- initialize and finalize IR construction --- */
 
 /** Puts the graph into state "phase_high" */