X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fir%2Fircons.h;h=ed41f5d2deb5d75d9bc67178ffaa04be3ff62267;hb=f9d25133f86594ca2b1f33fb0b41a591ecc9b914;hp=5eb79f5f513bf5c3aa6c380e5dd30610484e100b;hpb=32eac5a7b1ffd9044c30f337154b4dc69e0ba86f;p=libfirm diff --git a/ir/ir/ircons.h b/ir/ir/ircons.h index 5eb79f5f5..ed41f5d2d 100644 --- a/ir/ir/ircons.h +++ b/ir/ir/ircons.h @@ -243,13 +243,14 @@ * constructors and at the paragraph COPING WITH DATA OBJECTS at the * end of this documentation. * - * The comfortable interface contains the following routines further explained + * The comfortable interface contains the following routines further explained * below: * * ir_node *new_immBlock (void); * ir_node *new_Start (void); * ir_node *new_End (void); * ir_node *new_Jmp (void); + * 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_Raise (ir_node *store, ir_node *obj); @@ -290,6 +291,7 @@ * ir_node *new_Proj (ir_node *arg, ir_mode *mode, long proj); * ir_node *new_NoMem (void); * ir_node *new_Mux (ir_node *sel, ir_node *ir_false, ir_node *ir_true, ir_mode *mode); + * ir_node *new_CopyB (ir_node *store, ir_node *dst, ir_node *src, type *data_type); * * void add_immBlock_pred (ir_node *block, ir_node *jmp); * void mature_immBlock (ir_node *block); @@ -448,6 +450,17 @@ * Output: * Control flow to the next block. * + * ir_node *new_IJmp (ir_node *tgt) + * ----------------------- + * + * Creates an IJmp node. + * + * Inputs: + * The node that represents the target jump address + * Output: + * Control flow to an unknown target, must be pinned by + * the End node. + * * ir_node *new_Cond (ir_node *c) * ------------------------------ * @@ -650,7 +663,7 @@ * ir_node *new_Minus (ir_node *op, ir_mode *mode) * ----------------------------------------------- * - * Unary Minus operations on floating point values. + * Unary Minus operations on integer and floating point values. * * ir_node *new_Mul (ir_node *op1, ir_node *op2, ir_mode *mode) * ------------------------------------------------------------ @@ -751,23 +764,23 @@ * Output: * A 16-tuple containing the results of the 16 different comparisons. * The following is a list giving the comparisons and a projection - * number (pnc_number) to use in Proj nodes to extract the proper result. - * False false - * Eq equal - * Lt less - * Le less or equal - * Gt greater - * Ge greater of equal - * Lg less or greater - * Leg less, equal or greater = ordered - * Uo unordered - * Ue unordered or equal - * Ul unordered or less - * Ule unordered, less or equal - * Ug unordered or greater - * Uge unordered, greater or equal - * Ne unordered, less or greater = not equal - * True true + * number (pn_Cmp) to use in Proj nodes to extract the proper result. + * pn_Cmp_False false + * pn_Cmp_Eq equal + * pn_Cmp_Lt less + * pn_Cmp_Le less or equal + * pn_Cmp_Gt greater + * pn_Cmp_Ge greater of equal + * pn_Cmp_Lg less or greater + * pn_Cmp_Leg less, equal or greater = ordered + * pn_Cmp_Uo unordered + * pn_Cmp_Ue unordered or equal + * pn_Cmp_Ul unordered or less + * pn_Cmp_Ule unordered, less or equal + * pn_Cmp_Ug unordered or greater + * pn_Cmp_Uge unordered, greater or equal + * pn_Cmp_Ne unordered, less or greater = not equal + * pn_Cmp_True true * * * @@ -924,6 +937,12 @@ * This node is used as input for operations that need a Memory, but do not * change it like Div by const != 0, analyzed calls etc. * + * ir_node *new_CopyB (ir_node *store, ir_node *dst, ir_node *src, type *data_type) + * ----------------------------------------------------------------------------------- + * + * Describes a high level block copy of a compound type form address src to + * address dst. Must be lowered to a Call to a runtime memory copy function. + * * ir_node *new_Proj (ir_node *arg, ir_mode *mode, long proj) * ---------------------------------------------------------- * @@ -1084,6 +1103,18 @@ ir_node *new_rd_End (dbg_info *db, ir_graph *irg, ir_node *block); */ ir_node *new_rd_Jmp (dbg_info *db, ir_graph *irg, ir_node *block); +/** Constructor for an IJmp node. + * + * IJmp represents control flow to a single control successor not + * statically known i.e. an indirect Jmp. + * + * @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. + * @param *tgt The ir node representing the target address. + */ +ir_node *new_rd_IJmp (dbg_info *db, ir_graph *irg, ir_node *block, ir_node *tgt); + /** Constructor for a Break node. * * Break represents control flow to a single control successor just as Jmp. @@ -1295,8 +1326,8 @@ ir_node *new_rd_Call (dbg_info *db, ir_graph *irg, ir_node *block, ir_node *st * @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. - * @param *op1 The operand 1. - * @param *op2 The operand 2. + * @param *op1 The first operand. + * @param *op2 The second operand. * @param *mode The mode of the operands and the result. */ ir_node *new_rd_Add (dbg_info *db, ir_graph *irg, ir_node *block, @@ -1307,8 +1338,8 @@ ir_node *new_rd_Add (dbg_info *db, ir_graph *irg, ir_node *block, * @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. - * @param *op1 The operand 1. - * @param *op2 The operand 2. + * @param *op1 The first operand. + * @param *op2 The second operand. * @param *mode The mode of the operands and the result. */ ir_node *new_rd_Sub (dbg_info *db, ir_graph *irg, ir_node *block, @@ -1330,8 +1361,8 @@ ir_node *new_rd_Minus (dbg_info *db, ir_graph *irg, ir_node *block, * @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. - * @param *op1 The operand 1. - * @param *op2 The operand 2. + * @param *op1 The first operand. + * @param *op2 The second operand. * @param *mode The mode of the operands and the result. */ ir_node *new_rd_Mul (dbg_info *db, ir_graph *irg, ir_node *block, @@ -1343,8 +1374,8 @@ ir_node *new_rd_Mul (dbg_info *db, ir_graph *irg, ir_node *block, * @param *irg The ir graph the node belongs to. * @param *block The ir block the node belongs to. * @param *memop The store needed to model exceptions - * @param *op1 The operand 1. - * @param *op2 The operand 2. + * @param *op1 The first operand. + * @param *op2 The second operand. */ ir_node *new_rd_Quot (dbg_info *db, ir_graph *irg, ir_node *block, ir_node *memop, ir_node *op1, ir_node *op2); @@ -1355,8 +1386,8 @@ ir_node *new_rd_Quot (dbg_info *db, ir_graph *irg, ir_node *block, * @param *irg The ir graph the node belongs to. * @param *block The ir block the node belongs to. * @param *memop The store needed to model exceptions - * @param *op1 The operand 1. - * @param *op2 The operand 2. + * @param *op1 The first operand. + * @param *op2 The second operand. */ ir_node *new_rd_DivMod (dbg_info *db, ir_graph *irg, ir_node *block, ir_node *memop, ir_node *op1, ir_node *op2); @@ -1367,8 +1398,8 @@ ir_node *new_rd_DivMod (dbg_info *db, ir_graph *irg, ir_node *block, * @param *irg The ir graph the node belongs to. * @param *block The ir block the node belongs to. * @param *memop The store needed to model exceptions - * @param *op1 The operand 1. - * @param *op2 The operand 2. + * @param *op1 The first operand. + * @param *op2 The second operand. */ ir_node *new_rd_Div (dbg_info *db, ir_graph *irg, ir_node *block, ir_node *memop, ir_node *op1, ir_node *op2); @@ -1379,8 +1410,8 @@ ir_node *new_rd_Div (dbg_info *db, ir_graph *irg, ir_node *block, * @param *irg The ir graph the node belongs to. * @param *block The ir block the node belongs to. * @param *memop The store needed to model exceptions - * @param *op1 The operand 1. - * @param *op2 The operand 2. + * @param *op1 The first operand. + * @param *op2 The second operand. */ ir_node *new_rd_Mod (dbg_info *db, ir_graph *irg, ir_node *block, ir_node *memop, ir_node *op1, ir_node *op2); @@ -1401,8 +1432,8 @@ ir_node *new_rd_Abs (dbg_info *db, ir_graph *irg, ir_node *block, * @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. - * @param *op1 The operand 1. - * @param *op2 The operand 2. + * @param *op1 The first operand. + * @param *op2 The second operand. * @param *mode The mode of the operands and the result. */ ir_node *new_rd_And (dbg_info *db, ir_graph *irg, ir_node *block, @@ -1413,8 +1444,8 @@ ir_node *new_rd_And (dbg_info *db, ir_graph *irg, ir_node *block, * @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. - * @param *op1 The operand 1. - * @param *op2 The operand 2. + * @param *op1 The first operand. + * @param *op2 The second operand. * @param *mode The mode of the operands and the result. */ ir_node *new_rd_Or (dbg_info *db, ir_graph *irg, ir_node *block, @@ -1425,8 +1456,8 @@ ir_node *new_rd_Or (dbg_info *db, ir_graph *irg, ir_node *block, * @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. - * @param *op1 The operand 1. - * @param *op2 The operand 2. + * @param *op1 The first operand. + * @param *op2 The second operand. * @param *mode The mode of the operands and the results. */ ir_node *new_rd_Eor (dbg_info *db, ir_graph *irg, ir_node *block, @@ -1448,8 +1479,8 @@ ir_node *new_rd_Not (dbg_info *db, ir_graph *irg, ir_node *block, * @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. - * @param *op1 The operand 1. - * @param *op2 The operand 2. + * @param *op1 The first operand. + * @param *op2 The second operand. */ ir_node *new_rd_Cmp (dbg_info *db, ir_graph *irg, ir_node *block, ir_node *op1, ir_node *op2); @@ -1781,6 +1812,21 @@ ir_node *new_rd_NoMem (ir_graph *irg); ir_node *new_rd_Mux (dbg_info *db, ir_graph *irg, ir_node *block, ir_node *sel, ir_node *ir_false, ir_node *ir_true, ir_mode *mode); +/** Constructor for a CopyB node. + * + * Adds the node to the block in current_ir_block. + * + * @param *db A pointer for debug information. + * @param *irg The ir graph the node belong to. + * @param *block The block the node belong to. + * @param *store The current memory + * @param *dst The ir_node that represents the destination address. + * @param *arg The ir_node that represents the source address. + * @param *data_type The type of the copied data + */ +ir_node *new_rd_CopyB(dbg_info *db, ir_graph *irg, ir_node *block, + ir_node *store, ir_node *dst, ir_node *src, type *data_type); + /*-------------------------------------------------------------------------*/ /* The raw interface without debug support */ /*-------------------------------------------------------------------------*/ @@ -1824,6 +1870,17 @@ ir_node *new_r_End (ir_graph *irg, ir_node *block); */ ir_node *new_r_Jmp (ir_graph *irg, ir_node *block); +/** Constructor for an IJmp node. + * + * IJmp represents control flow to a single control successor not + * statically known i.e. an indirect Jmp. + * + * @param *irg The ir graph the node belongs to. + * @param *block The ir block the node belongs to. + * @param *tgt The ir node representing the target address. + */ +ir_node *new_r_IJmp (ir_graph *irg, ir_node *block, ir_node *tgt); + /** Constructor for a Cond node. * * If c is mode_b represents a conditional branch (if/else). If c is @@ -1877,6 +1934,34 @@ ir_node *new_r_Raise (ir_graph *irg, ir_node *block, ir_node *new_r_Const (ir_graph *irg, ir_node *block, ir_mode *mode, tarval *con); +/** Constructor for a Const node. + * + * Constructor for a Const node. The constant represents a target + * value. Sets the type information to type_unknown. (No more + * supported: If tv is entity derives a somehow useful type.) + * + * @param *irg The ir graph the node belongs to. + * @param *block The ir block the node belongs to. + * @param *mode The mode of the operands and the results. + * @param value A value from which the tarval is made. + */ +ir_node *new_r_Const_long(ir_graph *irg, ir_node *block, + ir_mode *mode, long value); + +/** Constructor for a Const_type node. + * + * The constant represents a target value. This constructor sets high + * level type information for the constant value. + * + * @param *irg The ir graph the node belongs to. + * @param *block The ir block the node belongs to. + * @param *mode The mode of the operands and results. + * @param *con Points to an entry in the constant table. + * @param *tp The type of the constant. + */ +ir_node *new_r_Const_type(ir_graph *irg, ir_node *block, + ir_mode *mode, tarval *con, type *tp); + /** Constructor for a SymConst node. * * This is the constructor for a symbolic constant. @@ -1947,7 +2032,7 @@ ir_node *new_r_InstOf (ir_graph *irg, ir_node *block, ir_node *x, ir_node *y, ty * * @param *irg The ir graph the node belongs to. * @param *block The ir block the node belongs to. - * @param * store The actual store. + * @param *store The actual store. * @param *callee A pointer to the called procedure. * @param arity The number of procedure parameters. * @param *in[] An array with the pointers to the parameters. The constructor copies this array. @@ -1961,8 +2046,8 @@ ir_node *new_r_Call (ir_graph *irg, ir_node *block, ir_node *store, * * @param *irg The ir graph the node belongs to. * @param *block The ir block the node belongs to. - * @param *op1 The operand 1. - * @param *op2 The operand 2. + * @param *op1 The first operand. + * @param *op2 The second operand. * @param *mode The mode of the operands and the result. */ ir_node *new_r_Add (ir_graph *irg, ir_node *block, @@ -1973,8 +2058,8 @@ ir_node *new_r_Add (ir_graph *irg, ir_node *block, * * @param *irg The ir graph the node belongs to. * @param *block The ir block the node belongs to. - * @param *op1 The operand 1. - * @param *op2 The operand 2. + * @param *op1 The first operand. + * @param *op2 The second operand. * @param *mode The mode of the operands and the results. */ ir_node *new_r_Sub (ir_graph *irg, ir_node *block, @@ -1993,8 +2078,8 @@ ir_node *new_r_Minus (ir_graph *irg, ir_node *block, * * @param *irg The ir graph the node belongs to. * @param *block The ir block the node belongs to. - * @param *op1 The operand 1. - * @param *op2 The operand 2. + * @param *op1 The first operand. + * @param *op2 The second operand. * @param *mode The mode of the operands and the result. */ ir_node *new_r_Mul (ir_graph *irg, ir_node *block, @@ -2005,8 +2090,8 @@ ir_node *new_r_Mul (ir_graph *irg, ir_node *block, * @param *irg The ir graph the node belongs to. * @param *block The ir block the node belongs to. * @param *memop The store needed to model exceptions - * @param *op1 The operand 1. - * @param *op2 The operand 2. + * @param *op1 The first operand. + * @param *op2 The second operand. */ ir_node *new_r_Quot (ir_graph *irg, ir_node *block, ir_node *memop, ir_node *op1, ir_node *op2); @@ -2016,8 +2101,8 @@ ir_node *new_r_Quot (ir_graph *irg, ir_node *block, * @param *irg The ir graph the node belongs to. * @param *block The ir block the node belongs to. * @param *memop The store needed to model exceptions - * @param *op1 The operand 1. - * @param *op2 The operand 2. + * @param *op1 The first operand. + * @param *op2 The second operand. */ ir_node *new_r_DivMod (ir_graph *irg, ir_node *block, ir_node *memop, ir_node *op1, ir_node *op2); @@ -2027,8 +2112,8 @@ ir_node *new_r_DivMod (ir_graph *irg, ir_node *block, * @param *irg The ir graph the node belongs to. * @param *block The ir block the node belongs to. * @param *memop The store needed to model exceptions - * @param *op1 The operand 1. - * @param *op2 The operand 2. + * @param *op1 The first operand. + * @param *op2 The second operand. */ ir_node *new_r_Div (ir_graph *irg, ir_node *block, ir_node *memop, ir_node *op1, ir_node *op2); @@ -2038,8 +2123,8 @@ ir_node *new_r_Div (ir_graph *irg, ir_node *block, * @param *irg The ir graph the node belongs to. * @param *block The ir block the node belongs to. * @param *memop The store needed to model exceptions - * @param *op1 The operand 1. - * @param *op2 The operand 2. + * @param *op1 The first operand. + * @param *op2 The second operand. */ ir_node *new_r_Mod (ir_graph *irg, ir_node *block, ir_node *memop, ir_node *op1, ir_node *op2); @@ -2058,8 +2143,8 @@ ir_node *new_r_Abs (ir_graph *irg, ir_node *block, * * @param *irg The ir graph the node belongs to. * @param *block The ir block the node belongs to. - * @param *op1 The operand 1. - * @param *op2 The operand 2. + * @param *op1 The first operand. + * @param *op2 The second operand. * @param *mode The mode of the operands and the result. */ ir_node *new_r_And (ir_graph *irg, ir_node *block, @@ -2069,8 +2154,8 @@ ir_node *new_r_And (ir_graph *irg, ir_node *block, * * @param *irg The ir graph the node belongs to. * @param *block The ir block the node belongs to. - * @param *op1 The operand 1. - * @param *op2 The operand 2. + * @param *op1 The first operand. + * @param *op2 The second operand. * @param *mode The mode of the operands and the result. */ ir_node *new_r_Or (ir_graph *irg, ir_node *block, @@ -2080,8 +2165,8 @@ ir_node *new_r_Or (ir_graph *irg, ir_node *block, * * @param *irg The ir graph the node belongs to. * @param *block The ir block the node belongs to. - * @param *op1 The operand 1. - * @param *op2 The operand 2. + * @param *op1 The first operand. + * @param *op2 The second operand. * @param *mode The mode of the operands and the results. */ ir_node *new_r_Eor (ir_graph *irg, ir_node *block, @@ -2101,8 +2186,8 @@ ir_node *new_r_Not (ir_graph *irg, ir_node *block, * * @param *irg The ir graph the node belongs to. * @param *block The ir block the node belongs to. - * @param *op1 The operand 1. - * @param *op2 The operand 2. + * @param *op1 The first operand. + * @param *op2 The second operand. */ ir_node *new_r_Cmp (ir_graph *irg, ir_node *block, ir_node *op1, ir_node *op2); @@ -2272,7 +2357,7 @@ ir_node *new_r_Proj (ir_graph *irg, ir_node *block, ir_node *arg, * @param *irg The ir graph the node belongs to. * @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. + * @param max_proj The end position of the value in the tuple. */ ir_node *new_r_defaultProj (ir_graph *irg, ir_node *block, ir_node *arg, long max_proj); @@ -2323,7 +2408,6 @@ ir_node *new_r_Bad (ir_graph *irg); * * @param *irg The ir graph the node belong to. * @param *block The ir block the node belong to. - * @param *db A pointer for debug information. * @param *val The value we express a constraint for * @param *bound The value to compare against. Must be a firm node, typically a constant. * @param cmp The compare operation. @@ -2428,6 +2512,20 @@ ir_node *new_r_NoMem (ir_graph *irg); ir_node *new_r_Mux (ir_graph *irg, ir_node *block, ir_node *sel, ir_node *ir_false, ir_node *ir_true, ir_mode *mode); +/** Constructor for a CopyB node. + * + * Adds the node to the block in current_ir_block. + * + * @param *irg The ir graph the node belong to. + * @param *block The block the node belong to. + * @param *store The current memory + * @param *dst The ir_node that represents the destination address. + * @param *arg The ir_node that represents the source address. + * @param *data_type The type of the copied data + */ +ir_node *new_r_CopyB(ir_graph *irg, ir_node *block, + ir_node *store, ir_node *dst, ir_node *src, type *data_type); + /*-----------------------------------------------------------------------*/ /* The block oriented interface */ /*-----------------------------------------------------------------------*/ @@ -2485,9 +2583,18 @@ ir_node *new_d_End (dbg_info* db); * * @param *db A pointer for debug information. */ - ir_node *new_d_Jmp (dbg_info* db); +/** Constructor for an IJmp node. + * + * IJmp represents control flow to a single control successor not + * statically known i.e. an indirect Jmp. + * + * @param *db A pointer for debug information. + * @param *tgt The ir node representing the target address. + */ +ir_node *new_d_IJmp (dbg_info *db, ir_node *tgt); + /** Constructor for a Cond node. * * Adds the node to the block in current_ir_block. @@ -2585,10 +2692,9 @@ ir_node *new_d_Const (dbg_info* db, ir_mode *mode, tarval *con); * * @param *db A pointer for debug information. * @param value A type, entity or ident depending on the SymConst kind. - * @param symkind The kind of the symbolic constant: symconst_type_tag, symconst_size + * @param kind The kind of the symbolic constant: symconst_type_tag, symconst_size * or symconst_addr_name. * @param tp The source type of the constant. - * */ ir_node *new_d_SymConst_type (dbg_info* db, union symconst_symbol value, symconst_kind kind, type* tp); @@ -2626,8 +2732,8 @@ ir_node *new_d_simpleSel(dbg_info* db, ir_node *store, ir_node *objptr, entity * * from is allocated. * @param *objptr A pointer to a compound entity the Sel operation selects a * single attribute from. - * @param *n_index The number of array indices needed to select an array element entity. - * @param *index[] If the compound entity is an array the indices of the selected + * @param arity The number of array indices needed to select an array element entity. + * @param *in[] If the compound entity is an array the indices of the selected * element entity. The constructor copies this array. * @param *ent The entity to select. */ @@ -2668,8 +2774,8 @@ ir_node *new_d_Call (dbg_info* db, ir_node *store, ir_node *callee, int arity, * Adds the node to the block in current_ir_block. * * @param *db A pointer for debug information. - * @param *op1 The operand 1. - * @param *op2 The operand 2. + * @param *op1 The first operand. + * @param *op2 The second operand. * @param *mode The mode of the operands and the result. */ ir_node *new_d_Add (dbg_info* db, ir_node *op1, ir_node *op2, ir_mode *mode); @@ -2679,8 +2785,8 @@ ir_node *new_d_Add (dbg_info* db, ir_node *op1, ir_node *op2, ir_mode *mode); * Adds the node to the block in current_ir_block. * * @param *db A pointer for debug information. - * @param *op1 The operand 1. - * @param *op2 The operand 2. + * @param *op1 The first operand. + * @param *op2 The second operand. * @param *mode The mode of the operands and the result. */ @@ -2701,8 +2807,8 @@ ir_node *new_d_Minus (dbg_info* db, ir_node *op, ir_mode *mode); * Adds the node to the block in current_ir_block. * * @param *db A pointer for debug information. - * @param *op1 The operand 1. - * @param *op2 The operand 2. + * @param *op1 The first operand. + * @param *op2 The second operand. * @param *mode The mode of the operands and the result. */ ir_node *new_d_Mul (dbg_info* db, ir_node *op1, ir_node *op2, ir_mode *mode); @@ -2713,8 +2819,8 @@ ir_node *new_d_Mul (dbg_info* db, ir_node *op1, ir_node *op2, ir_mode *mode); * * @param *db A pointer for debug information. * @param *memop The store needed to model exceptions - * @param *op1 The operand 1. - * @param *op2 The operand 2. + * @param *op1 The first operand. + * @param *op2 The second operand. */ ir_node *new_d_Quot (dbg_info* db, ir_node *memop, ir_node *op1, ir_node *op2); @@ -2724,8 +2830,8 @@ ir_node *new_d_Quot (dbg_info* db, ir_node *memop, ir_node *op1, ir_node *op2) * * @param *db A pointer for debug information. * @param *memop The store needed to model exceptions - * @param *op1 The operand 1. - * @param *op2 The operand 2. + * @param *op1 The first operand. + * @param *op2 The second operand. */ ir_node *new_d_DivMod (dbg_info* db, ir_node *memop, ir_node *op1, ir_node *op2); @@ -2735,8 +2841,8 @@ ir_node *new_d_DivMod (dbg_info* db, ir_node *memop, ir_node *op1, ir_node *op2) * * @param *db A pointer for debug information. * @param *memop The store needed to model exceptions - * @param *op1 The operand 1. - * @param *op2 The operand 2. + * @param *op1 The first operand. + * @param *op2 The second operand. */ ir_node *new_d_Div (dbg_info* db, ir_node *memop, ir_node *op1, ir_node *op2); @@ -2746,8 +2852,8 @@ ir_node *new_d_Div (dbg_info* db, ir_node *memop, ir_node *op1, ir_node *op2) * * @param *db A pointer for debug information. * @param *memop The store needed to model exceptions - * @param *op1 The operand 1. - * @param *op2 The operand 2. + * @param *op1 The first operand. + * @param *op2 The second operand. */ ir_node *new_d_Mod (dbg_info* db, ir_node *memop, ir_node *op1, ir_node *op2); @@ -2766,10 +2872,8 @@ ir_node *new_d_Abs (dbg_info* db, ir_node *op, ir_mode *mode); * Adds the node to the block in current_ir_block. * * @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. - * @param *op1 The operand 1. - * @param *op2 The operand 2. + * @param *op1 The first operand. + * @param *op2 The second operand. * @param *mode The mode of the operands and the result. */ ir_node *new_d_And (dbg_info* db, ir_node *op1, ir_node *op2, ir_mode *mode); @@ -2779,8 +2883,8 @@ ir_node *new_d_And (dbg_info* db, ir_node *op1, ir_node *op2, ir_mode *mode); * Adds the node to the block in current_ir_block. * * @param *db A pointer for debug information. - * @param *op1 The operand 1. - * @param *op2 The operand 2. + * @param *op1 The first operand. + * @param *op2 The second operand. * @param *mode The mode of the operands and the result. */ ir_node *new_d_Or (dbg_info* db, ir_node *op1, ir_node *op2, ir_mode *mode); @@ -2790,8 +2894,8 @@ ir_node *new_d_Or (dbg_info* db, ir_node *op1, ir_node *op2, ir_mode *mode); * Adds the node to the block in current_ir_block. * * @param *db A pointer for debug information. - * @param *op1 The operand 1. - * @param *op2 The operand 2. + * @param *op1 The first operand. + * @param *op2 The second operand. * @param *mode The mode of the operands and the results. */ ir_node *new_d_Eor (dbg_info* db, ir_node *op1, ir_node *op2, ir_mode *mode); @@ -2855,8 +2959,8 @@ ir_node *new_d_Rot (dbg_info* db, ir_node *op, ir_node *k, ir_mode *mode); * Adds the node to the block in current_ir_block. * * @param *db A pointer for debug information. - * @param *op1 The operand 1. - * @param *op2 The operand 2. + * @param *op1 The first operand. + * @param *op2 The second operand. */ ir_node *new_d_Cmp (dbg_info* db, ir_node *op1, ir_node *op2); @@ -2898,7 +3002,7 @@ ir_node *new_d_Phi (dbg_info* db, int arity, ir_node *in[], ir_mode *mode); * * @param *db A pointer for debug information. * @param *store The current memory - * @param *adr A pointer to the variable to be read in this memory. + * @param *addr A pointer to the variable to be read in this memory. * @param *mode The mode of the value to be loaded. */ ir_node *new_d_Load (dbg_info* db, ir_node *store, ir_node *addr, ir_mode *mode); @@ -2909,7 +3013,7 @@ ir_node *new_d_Load (dbg_info* db, ir_node *store, ir_node *addr, ir_mode *mod * * @param *db A pointer for debug information. * @param *store The current memory - * @param *adr A pointer to the variable to be read in this memory. + * @param *addr A pointer to the variable to be read in this memory. * @param *val The value to write to this variable. */ ir_node *new_d_Store (dbg_info* db, ir_node *store, ir_node *addr, ir_node *val); @@ -2980,7 +3084,7 @@ ir_node *new_d_Proj (dbg_info* db, ir_node *arg, ir_mode *mode, long proj); * * @param *db A pointer for debug information. * @param arg A node producing a tuple. - * @param max_ proj The end position of the value in the tuple. + * @param max_proj The end position of the value in the tuple. */ ir_node *new_d_defaultProj (dbg_info* db, ir_node *arg, long max_proj); @@ -3123,6 +3227,18 @@ ir_node *new_d_NoMem (void); ir_node *new_d_Mux (dbg_info *db, ir_node *sel, ir_node *ir_false, ir_node *ir_true, ir_mode *mode); +/** Constructor for a CopyB node. + * + * Adds the node to the block in current_ir_block. + * + * @param *db A pointer for debug information. + * @param *store The current memory + * @param *dst The ir_node that represents the destination address. + * @param *arg The ir_node that represents the source address. + * @param *data_type The type of the copied data + */ +ir_node *new_d_CopyB(dbg_info *db, ir_node *store, ir_node *dst, ir_node *src, type *data_type); + /*-----------------------------------------------------------------------*/ /* The block oriented interface without debug support */ /*-----------------------------------------------------------------------*/ @@ -3178,6 +3294,15 @@ ir_node *new_EndExcept(void); */ ir_node *new_Jmp (void); +/** Constructor for an IJmp node. + * + * IJmp represents control flow to a single control successor not + * statically known i.e. an indirect Jmp. + * + * @param *tgt The ir node representing the target address. + */ +ir_node *new_IJmp (ir_node *tgt); + /** Constructor for a Break node. * Break represents control flow to a single control successor just as Jmp. * The blocks separated by a break may not be concatenated by an optimization. @@ -3234,6 +3359,19 @@ ir_node *new_Raise (ir_node *store, ir_node *obj); */ ir_node *new_Const (ir_mode *mode, tarval *con); +/** + * Make a const from a long. + * This is just convenience for the usual + * + * new_Const(mode, tarval_from_long(mode, ...)) + * + * pain. + * @param mode The mode for the const. + * @param value The value of the constant. + * @return A new const node. + */ +ir_node *new_Const_long(ir_mode *mode, long value); + /** Constructor for a Const node. * * Derives mode from passed type. */ @@ -3242,19 +3380,19 @@ ir_node *new_Const_type(tarval *con, type *tp); /** Constructor for a SymConst node. * * Adds the node to the block in current_ir_block. - * This is the constructor for a symbolic constant. - * There are four kinds of symbolic constants: - * - type_tag The symbolic constant represents a type tag. The type the - * tag stands for is given explicitly. - * - size The symbolic constant represents the size of a type. The - * type of which the constant represents the size is given - * explicitly. - * - addr_name The symbolic constant represents the address of an entity - * (variable or method). The variable is indicated by a name - * that is valid for linking. - * - addr_ent The symbolic constant represents the address of an entity - * (variable or method). The variable is given explicitly by - * a firm entity. + * This is the constructor for a symbolic constant. + * There are four kinds of symbolic constants: + * -# type_tag The symbolic constant represents a type tag. The type the + * tag stands for is given explicitly. + * -# size The symbolic constant represents the size of a type. The + * type of which the constant represents the size is given + * explicitly. + * -# addr_name The symbolic constant represents the address of an entity + * (variable or method). The variable is indicated by a name + * that is valid for linking. + * -# addr_ent The symbolic constant represents the address of an entity + * (variable or method). The variable is given explicitly by + * a firm entity. * * Inputs to the node: * No inputs except the block it belongs to. @@ -3262,7 +3400,7 @@ ir_node *new_Const_type(tarval *con, type *tp); * An unsigned integer (I_u) or a pointer (P). * * @param value A type or a ident depending on the SymConst kind. - * @param symkind The kind of the symbolic constant: symconst_type_tag, symconst_size or symconst_addr_name. + * @param kind The kind of the symbolic constant: symconst_type_tag, symconst_size or symconst_addr_name. */ ir_node *new_SymConst (union symconst_symbol value, symconst_kind kind); @@ -3291,8 +3429,8 @@ ir_node *new_simpleSel(ir_node *store, ir_node *objptr, entity *ent); * from is allocated. * @param *objptr A pointer to a compound entity the Sel operation selects a * single attribute from. - * @param *n_index The number of array indices needed to select an array element entity. - * @param *index[] If the compound entity is an array the indices of the selected + * @param arity The number of array indices needed to select an array element entity. + * @param *in[] If the compound entity is an array the indices of the selected * element entity. The constructor copies this array. * @param *ent The entity to select. */ @@ -3304,8 +3442,8 @@ ir_node *new_Sel (ir_node *store, ir_node *objptr, int arity, ir_node *in[], * Adds the node to the block in current_ir_block. * For translating Java. Not supported as standard firm node. * - * @param *store - * @param *objptr + * @param *store The actual store. + * @param *obj * @param *ent */ ir_node *new_InstOf (ir_node *store, ir_node *obj, type *ent); @@ -3339,8 +3477,8 @@ ir_node *new_CallBegin(ir_node *callee); * constructor copies the method pointer input from the passed Call * node.Adds the node to the block in current_ir_block. * - * @param *op1 The operand 1. - * @param *op2 The operand 2. + * @param *op1 The first operand. + * @param *op2 The second operand. * @param *mode The mode of the operands and the result. */ ir_node *new_Add (ir_node *op1, ir_node *op2, ir_mode *mode); @@ -3349,8 +3487,8 @@ ir_node *new_Add (ir_node *op1, ir_node *op2, ir_mode *mode); * * Adds the node to the block in current_ir_block. * - * @param *op1 The operand 1. - * @param *op2 The operand 2. + * @param *op1 The first operand. + * @param *op2 The second operand. * @param *mode The mode of the operands and the result. */ ir_node *new_Sub (ir_node *op1, ir_node *op2, ir_mode *mode); @@ -3367,8 +3505,8 @@ ir_node *new_Minus (ir_node *op, ir_mode *mode); /** * Constructor for a Mul node. Adds the node to the block in current_ir_block. * - * @param *op1 The operand 1. - * @param *op2 The operand 2. + * @param *op1 The first operand. + * @param *op2 The second operand. * @param *mode The mode of the operands and the result. */ ir_node *new_Mul (ir_node *op1, ir_node *op2, ir_mode *mode); @@ -3378,8 +3516,8 @@ ir_node *new_Mul (ir_node *op1, ir_node *op2, ir_mode *mode); * Adds the node to the block in current_ir_block. * * @param *memop The store needed to model exceptions - * @param *op1 The operand 1. - * @param *op2 The operand 2. + * @param *op1 The first operand. + * @param *op2 The second operand. */ ir_node *new_Quot (ir_node *memop, ir_node *op1, ir_node *op2); @@ -3388,8 +3526,8 @@ ir_node *new_Quot (ir_node *memop, ir_node *op1, ir_node *op2); * Adds the node to the block in current_ir_block. * * @param *memop The store needed to model exceptions - * @param *op1 The operand 1. - * @param *op2 The operand 2. + * @param *op1 The first operand. + * @param *op2 The second operand. */ ir_node *new_DivMod (ir_node *memop, ir_node *op1, ir_node *op2); @@ -3398,8 +3536,8 @@ ir_node *new_DivMod (ir_node *memop, ir_node *op1, ir_node *op2); * Adds the node to the block in current_ir_block. * * @param *memop The store needed to model exceptions - * @param *op1 The operand 1. - * @param *op2 The operand 2. + * @param *op1 The first operand. + * @param *op2 The second operand. */ ir_node *new_Div (ir_node *memop, ir_node *op1, ir_node *op2); @@ -3408,8 +3546,8 @@ ir_node *new_Div (ir_node *memop, ir_node *op1, ir_node *op2); * Adds the node to the block in current_ir_block. * * @param *memop The store needed to model exceptions - * @param *op1 The operand 1. - * @param *op2 The operand 2. + * @param *op1 The first operand. + * @param *op2 The second operand. */ ir_node *new_Mod (ir_node *memop, ir_node *op1, ir_node *op2); @@ -3426,8 +3564,8 @@ ir_node *new_Abs (ir_node *op, ir_mode *mode); * * Adds the node to the block in current_ir_block. * - * @param *op1 The operand 1. - * @param *op2 The operand 2. + * @param *op1 The first operand. + * @param *op2 The second operand. * @param *mode The mode of the operands and the result. */ ir_node *new_And (ir_node *op1, ir_node *op2, ir_mode *mode); @@ -3435,8 +3573,8 @@ ir_node *new_And (ir_node *op1, ir_node *op2, ir_mode *mode); /** * Constructor for a Or node. Adds the node to the block in current_ir_block. * - * @param *op1 The operand 1. - * @param *op2 The operand 2. + * @param *op1 The first operand. + * @param *op2 The second operand. * @param *mode The mode of the operands and the result. */ ir_node *new_Or (ir_node *op1, ir_node *op2, ir_mode *mode); @@ -3444,8 +3582,8 @@ ir_node *new_Or (ir_node *op1, ir_node *op2, ir_mode *mode); /** * Constructor for a Eor node. Adds the node to the block in current_ir_block. * - * @param *op1 The operand 1. - * @param *op2 The operand 2. + * @param *op1 The first operand. + * @param *op2 The second operand. * @param *mode The mode of the operands and the results. */ ir_node *new_Eor (ir_node *op1, ir_node *op2, ir_mode *mode); @@ -3502,8 +3640,8 @@ ir_node *new_Rot (ir_node *op, ir_node *k, ir_mode *mode); * * Adds the node to the block in current_ir_block. * - * @param *op1 The operand 1. - * @param *op2 The operand 2. + * @param *op1 The first operand. + * @param *op2 The second operand. */ ir_node *new_Cmp (ir_node *op1, ir_node *op2); @@ -3629,7 +3767,7 @@ ir_node *new_Filter (ir_node *arg, ir_mode *mode, long proj); * Adds the node to the block in current_ir_block. * * @param arg A node producing a tuple. - * @param max_ proj The end position of the value in the tuple. + * @param max_proj The end position of the value in the tuple. */ ir_node *new_defaultProj (ir_node *arg, long max_proj); @@ -3702,6 +3840,17 @@ ir_node *new_NoMem (void); */ ir_node *new_Mux (ir_node *sel, ir_node *ir_false, ir_node *ir_true, ir_mode *mode); +/** Constructor for a CopyB node. + * + * Adds the node to the block in current_ir_block. + * + * @param *store The current memory + * @param *dst The ir_node that represents the destination address. + * @param *arg The ir_node that represents the source address. + * @param *data_type The type of the copied data + */ +ir_node *new_CopyB(ir_node *store, ir_node *dst, ir_node *src, type *data_type); + /*---------------------------------------------------------------------*/ /* The comfortable interface. */ /* Supports automatic Phi node construction. */ @@ -3726,7 +3875,7 @@ ir_node *new_immBlock (void); /** Add a control flow edge to an immature block. */ void add_immBlock_pred (ir_node *immblock, ir_node *jmp); -/** Fix the number of predecessors of an immature block. */ +/** Finalize a Block node, when all control flows are known. */ void mature_immBlock (ir_node *block); #define mature_cur_block() mature_immBlock(get_cur_block()); @@ -3741,7 +3890,7 @@ void mature_immBlock (ir_node *block); * @param pos The position/id of the local variable. * @param *mode The mode of the value to get. */ -ir_node *get_d_value (dbg_info* db, int pos, ir_mode *mode); +ir_node *get_d_value (dbg_info *db, int pos, ir_mode *mode); ir_node *get_value (int pos, ir_mode *mode); /** Remark a new definition of a variable. @@ -3786,7 +3935,13 @@ type *get_cur_frame_type(void); /* --- initialize and finalize ir construction --- */ /** Puts the graph into state "phase_high" */ -void finalize_cons (ir_graph *irg); +void irg_finalize_cons (ir_graph *irg); + +/** Puts the program and all graphs into state phase_high. + * + * This also remarks, the construction of types is finished, + * e.g., that no more subtypes will be added. */ +void irp_finalize_cons(void); /* --- Initialization --- */ @@ -3800,7 +3955,7 @@ void finalize_cons (ir_graph *irg); * @return a firm node of mode @p mode that initializes the var at position pos * * @note - * Do not return NULL + * Do not return NULL! * If this function is not set, FIRM will create a const node with tarval BAD. * Use set_irg_loc_description()/get_irg_loc_description() to assign additional * informations to local variables.