dbb1aec6946f5c0d5f9234bdcf11e99e0bc89edf
[libfirm] / include / libfirm / ircons.h
1 /*
2  * Copyright (C) 1995-2008 University of Karlsruhe.  All right reserved.
3  *
4  * This file is part of libFirm.
5  *
6  * This file may be distributed and/or modified under the terms of the
7  * GNU General Public License version 2 as published by the Free Software
8  * Foundation and appearing in the file LICENSE.GPL included in the
9  * packaging of this file.
10  *
11  * Licensees holding valid libFirm Professional Edition licenses may use
12  * this file in accordance with the libFirm Commercial License.
13  * Agreement provided with the Software.
14  *
15  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17  * PURPOSE.
18  */
19
20 /**
21  * @file
22  * @brief   Various irnode constructors. Automatic construction of SSA
23  *          representation.
24  * @author  Martin Trapp, Christian Schaefer, Goetz Lindenmaier, Boris Boesler,
25  *          Michael Beck
26  * @version $Id$
27  */
28
29 /**@todo
30  Ideas for improvement:
31  -# Handle construction of exceptions more comfortable:
32     Add new constructors that pass the exception region (or better the
33     Phi for the memories, the ex. region can be found from there) as parameter,
34     constructor then adds all Proj nodes and returns the pointer
35     to the Proj node that selects the result of the arithmetic operation.
36  -# Maybe hide the exception region in a global variable, especially if
37     it is always unambiguous.
38 */
39
40 /**
41  *  @file
42  *
43  *  documentation no more supported since 2001
44  *
45  *  IR node construction.
46  *
47  *    This file documents all datatypes and constructors needed to
48  *    build a FIRM representation of a procedure.  The constructors are
49  *    also implemented in this file.
50  *
51  *    The documentation also gives a short manual how to use the library.
52  *
53  *    For extensive documentation of FIRM see UKA Techreport 1999-14.
54  *
55  *
56  *    Three kinds of nodes
57  *    --------------------
58  *
59  *      There are three kinds of nodes known to the IR:  entities,
60  *      types, and ir_nodes
61  *
62  *      + ir_nodes are the actual nodes of the FIRM intermediate representation.
63  *        They represent operations on the data of the program and control flow
64  *        operations.
65  *
66  *      + entity ==> implemented in entity.h
67  *        Refers to a single entity of the compiled program, e.g. a field of a
68  *        class or a method.  If a method or variable can not be assigned to
69  *        a method or class or the like, it is a global object.
70  *
71  *      + types ==> implemented in type.h
72  *        With types type information is represented.  There are several type
73  *       nodes.
74  *
75  *    Implementation of the FIRM operations: ir_node
76  *    ----------------------------------------------
77  *
78  *      Ir_nodes represent operations on the data of the program and control flow
79  *      operations.  Examples of ir_nodes:  Add, Jmp, Cmp
80  *
81  *      FIRM is a dataflow graph.  A dataflow graph is a directed graph,
82  *      so that every node has incoming and outgoing edges.  A node is
83  *      executable if every input at it's incoming edges is available.
84  *      Execution of the dataflow graph is started at the Start node which
85  *      has no incoming edges and ends when the End node executes, even if
86  *      there are still executable or not executed nodes.  (Is this true,
87  *      or must all executable nodes be executed?)  (There are exceptions
88  *      to the dataflow paradigma that all inputs have to be available
89  *      before a node can execute: Phi, Block.  See UKA Techreport
90  *      1999-14.)
91  *
92  *      The implementation of FIRM differs from the view as a dataflow
93  *      graph.  To allow fast traversion of the graph edges are
94  *      implemented as C-pointers.  Inputs to nodes are not ambiguous, the
95  *      results can be used by several other nodes.  Each input can be
96  *      implemented as a single pointer to a predecessor node, outputs
97  *      need to be lists of pointers to successors.  Therefore a node
98  *      contains pointers to it's predecessor so that the implementation is a
99  *      dataflow graph with reversed edges.  It has to be traversed bottom
100  *      up.
101  *
102  *      All nodes of the IR have the same basic structure.  They are
103  *      distinguished by a field containing the opcode.
104  *
105  *      The fields of an ir_node:
106  *
107  *      kind             A firm_kind tag containing k_ir_node.  This is useful for
108  *                       dynamically checking the type of a node.
109  *
110  *      *op              This ir_op gives the opcode as a tag and a string
111  *                       and the number of attributes of an ir_node.  There is
112  *                       one statically allocated struct ir_op for each opcode.
113  *
114  *      *mode            The ir_mode of the operation represented by this firm
115  *                      node.  The mode of the operation is the mode of it's
116  *                       result.  A Firm mode is a datatype as known to the target,
117  *               not a type of the source language.
118  *
119  *      visit            A flag for traversing the IR.
120  *
121  *      **in             An array with pointers to the node's predecessors.
122  *
123  *      *link            A pointer to an ir_node.  With this pointer all Phi nodes
124  *                       are attached to a Block, i.e., a Block points to it's
125  *                       first Phi node, this node points to the second Phi node
126  *                       in the Block and so fourth.  Used in mature_immBlock
127  *                       to find all Phi nodes to be matured.  It's also used to
128  *               annotate a node with a better, optimized version of it.
129  *
130  *      attr             An attr struct containing the attributes of the nodes. The
131  *                       attributes depend on the opcode of the node.  The number
132  *               of these attributes is given in op.
133  *
134  *    The struct ir_op
135  *    ----------------
136  *                       Not yet documented. See irop.h.
137  *
138  *    The struct ir_mode
139  *    ------------------
140  *                       Not yet documented. See irmode.h.
141  *
142  *    GLOBAL VARIABLES -- now also fields of ir_graph.
143  *    ================
144  *
145  *    current_ir_graph   Points to the current ir_graph.  All constructors for
146  *                      nodes add nodes to this graph.
147  *
148  *    ir_visited         An int used as flag to traverse the ir_graph.
149  *
150  *    block_visited      An int used as a flag to traverse block nodes in the
151  *                       graph.
152  *
153  *                       Others not yet documented.
154  *
155  *
156  *
157  *    CONSTRUCTOR FOR IR_GRAPH --> see irgraph.h
158  *    ========================
159  *
160  *
161  *    PROCEDURE TO CONSTRUCT AN IR GRAPH --> see also Firm tutorial
162  *    ==================================
163  *
164  *    This library supplies several interfaces to construct a FIRM graph for
165  *    a program:
166  *    - A "comfortable" interface generating SSA automatically.  Automatically
167  *      computed predecessors of nodes need not be specified in the constructors.
168  *      (new_<Node> constructurs and a set of additional routines.)
169  *    - A less comfortable interface where all predecessors except the block
170  *      an operation belongs to need to be specified.  SSA must be constructed
171  *      by hand.  (new_<Node> constructors and set_cur_block()).  This interface
172  *      is called "block oriented".  It automatically calles the local optimizations
173  *      for each new node.
174  *    - An even less comfortable interface where the block needs to be specified
175  *      explicitly.  This is called the "raw" interface. (new_r_<Node>
176  *      constructors).  These nodes are not optimized.
177  *
178  *    To use the functionality of the comfortable interface correctly the Front
179  *    End needs to follow certain protocols.  This is explained in the following.
180  *    To build a correct IR with the other interfaces study the semantics of
181  *    the firm node (See tech-reprot UKA 1999-14).  For the construction of
182  *    types and entities see the documentation in those modules.
183  *
184  *    First the Frontend needs to decide which variables and values used in
185  *    a procedure can be represented by dataflow edges.  These are variables
186  *    that need not be saved to memory as they cause no side effects visible
187  *    out of the procedure.  Often these are all compiler generated
188  *    variables and simple local variables of the procedure as integers,
189  *    reals and pointers.  The frontend has to count and number these variables.
190  *
191  *    First an ir_graph needs to be constructed with new_ir_graph.  The
192  *    constructor gets the number of local variables.  The graph is hold in the
193  *    global variable irg.
194  *
195  *    Now the construction of the procedure can start.  Several basic blocks can
196  *    be constructed in parallel, but the code within each block needs to
197  *    be constructed (almost) in program order.
198  *
199  *    A global variable holds the current basic block.  All (non block) nodes
200  *    generated are added to this block.  The current block can be set with
201  *    set_cur_block(block).  If several blocks are constructed in parallel block
202  *    switches need to be performed constantly.
203  *
204  *    To generate a Block node (with the comfortable interface), its predecessor
205  *    control flow nodes need not be known.  In case of cyclic control flow these
206  *    can not be known when the block is constructed.  With add_immBlock_pred(block,
207  *    cfnode) predecessors can be added to the block.  If all predecessors are
208  *    added to the block mature_immBlock(b) needs to be called.  Calling mature_immBlock
209  *    early improves the efficiency of the Phi node construction algorithm.
210  *    But if several  blocks are constructed at once, mature_immBlock must only
211  *    be called after performing all set_values and set_stores in the block!
212  *    (See documentation of new_immBlock constructor.)
213  *
214  *    The constructors of arithmetic nodes require that their predecessors
215  *    are mentioned.  Sometimes these are available in the Frontend as the
216  *    predecessors have just been generated by the frontend.  If they are local
217  *    values the predecessors can be obtained from the library with a call to
218  *    get_value(local_val_nr).  (local_val_nr needs to be administered by
219  *    the Frontend.)  A call to get_value triggers the generation of Phi nodes.
220  *    If an arithmetic operation produces a local value this value needs to be
221  *    passed to the library by set_value(node, local_val_nr).
222  *    In straight line code these two operations just remember and return the
223  *    pointer to nodes producing the value.  If the value passes block boundaries
224  *    Phi nodes can be inserted.
225  *    Similar routines exist to manage the Memory operands: set_store and
226  *    get_store.
227  *
228  *    Several nodes produce more than one result.  An example is the Div node.
229  *    Such nodes return tuples of values.  From these individual values can be
230  *    extracted by proj nodes.
231  *
232  *    The following example illustrates the construction of a simple basic block
233  *    with two predecessors stored in variables cf_pred1 and cf_pred2, containing
234  *    the code
235  *      a = a div a;
236  *    and finally jumping to an other block.  The variable a got the local_val_nr
237  *    42 by the frontend.
238  *
239  *    ir_node *this_block, *cf_pred1, *cf_pred2, *a_val, *mem, *div, *res, *cf_op;
240  *
241  *    this_block = new_immBlock();
242  *    add_immBlock_pred(this_block, cf_pred1);
243  *    add_immBlock_pred(this_block, cf_pred2);
244  *    mature_immBlock(this_block);
245  *    a_val = get_value(42, mode_Iu);
246  *    mem = get_store();
247  *    div = new_Div(mem, a_val, a_val, mode_Iu);
248  *    mem = new_Proj(div, mode_M, pn_Div_M);   * for the numbers for Proj see docu *
249  *    res = new_Proj(div, mode_Iu, pn_Div_res);
250  *    set_store(mem);
251  *    set_value(res, 42);
252  *    cf_op = new_Jmp();
253  *
254  *    For further information look at the documentation of the nodes and
255  *    constructors and at the paragraph COPING WITH DATA OBJECTS at the
256  *    end of this documentation.
257  *
258  *    The comfortable interface contains the following routines further explained
259  *    below:
260  *
261  *    ir_node *new_immBlock (void);
262  *    ir_node *new_Start    (void);
263  *    ir_node *new_End      (void);
264  *    ir_node *new_Jmp      (void);
265  *    ir_node *new_IJmp     (ir_node *tgt);
266  *    ir_node *new_Cond     (ir_node *c);
267  *    ir_node *new_Return   (ir_node *store, int arity, ir_node **in);
268  *    ir_node *new_Const    (tarval *con);
269  *    ir_node *new_SymConst (ir_mode *mode, symconst_symbol value, symconst_kind kind);
270  *    ir_node *new_simpleSel (ir_node *store, ir_node *objptr, ir_entity *ent);
271  *    ir_node *new_Sel    (ir_node *store, ir_node *objptr, int arity,
272  *                         ir_node **in, ir_entity *ent);
273  *    ir_node *new_Call   (ir_node *store, ir_node *callee, int arity,
274  *                 ir_node **in, type_method *type);
275  *    ir_node *new_Add    (ir_node *op1, ir_node *op2, ir_mode *mode);
276  *    ir_node *new_Sub    (ir_node *op1, ir_node *op2, ir_mode *mode);
277  *    ir_node *new_Minus  (ir_node *op,  ir_mode *mode);
278  *    ir_node *new_Mul    (ir_node *op1, ir_node *op2, ir_mode *mode);
279  *    ir_node *new_Mulh   (ir_node *op1, ir_node *op2, ir_mode *mode);
280  *    ir_node *new_Quot   (ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state);
281  *    ir_node *new_DivMod (ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state);
282  *    ir_node *new_Div    (ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state);
283  *    ir_node *new_Mod    (ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state;
284  *    ir_node *new_Abs    (ir_node *op,                ir_mode *mode);
285  *    ir_node *new_And    (ir_node *op1, ir_node *op2, ir_mode *mode);
286  *    ir_node *new_Or     (ir_node *op1, ir_node *op2, ir_mode *mode);
287  *    ir_node *new_Eor    (ir_node *op1, ir_node *op2, ir_mode *mode);
288  *    ir_node *new_Not    (ir_node *op,                ir_mode *mode);
289  *    ir_node *new_Shl    (ir_node *op,  ir_node *k,   ir_mode *mode);
290  *    ir_node *new_Shr    (ir_node *op,  ir_node *k,   ir_mode *mode);
291  *    ir_node *new_Shrs   (ir_node *op,  ir_node *k,   ir_mode *mode);
292  *    ir_node *new_Rotl   (ir_node *op,  ir_node *k,   ir_mode *mode);
293  *    ir_node *new_Cmp    (ir_node *op1, ir_node *op2);
294  *    ir_node *new_Conv   (ir_node *op, ir_mode *mode);
295  *    ir_node *new_Cast   (ir_node *op, ir_type *to_tp);
296  *    ir_node *new_Carry  (ir_node *op1, ir_node *op2, ir_mode *mode);
297  *    ir_node *new_Borrow (ir_node *op1, ir_node *op2, ir_mode *mode);
298  *    ir_node *new_Load   (ir_node *store, ir_node *addr, ir_mode *mode);
299  *    ir_node *new_Store  (ir_node *store, ir_node *addr, ir_node *val);
300  *    ir_node *new_Alloc  (ir_node *store, ir_node *size, ir_type *alloc_type,
301  *                         where_alloc where);
302  *    ir_node *new_Free   (ir_node *store, ir_node *ptr, ir_node *size,
303  *               ir_type *free_type, where_alloc where);
304  *    ir_node *new_Proj   (ir_node *arg, ir_mode *mode, long proj);
305  *    ir_node *new_NoMem  (void);
306  *    ir_node *new_Mux    (ir_node *sel, ir_node *ir_false, ir_node *ir_true, ir_mode *mode);
307  *    ir_node *new_CopyB  (ir_node *store, ir_node *dst, ir_node *src, ir_type *data_type);
308  *    ir_node *new_InstOf (ir_node *store, ir_node obj, ir_type *ent);
309  *    ir_node *new_Raise  (ir_node *store, ir_node *obj);
310  *    ir_node *new_Bound  (ir_node *store, ir_node *idx, ir_node *lower, ir_node *upper);
311  *    ir_node *new_Pin    (ir_node *node);
312  *
313  *    void add_immBlock_pred (ir_node *block, ir_node *jmp);
314  *    void mature_immBlock (ir_node *block);
315  *    void set_cur_block (ir_node *target);
316  *    ir_node *get_value (int pos, ir_mode *mode);
317  *    void set_value (int pos, ir_node *value);
318  *    ir_node *get_store (void);
319  *    void set_store (ir_node *store);
320  *    keep_alive (ir_node ka)
321  *
322  *    IR_NODES AND CONSTRUCTORS FOR IR_NODES
323  *    =======================================
324  *
325  *    All ir_nodes are defined by a common data structure.  They are distinguished
326  *    by their opcode and differ in the number of their attributes.
327  *
328  *    The constructor for the block node sets current_block to itself.
329  *    Const nodes are always added to the start block.
330  *    All other constructors add the created node to the current_block.
331  *    swich_block(block) allows to set the current block to block.
332  *
333  *    Watch for my inconsistent use of input and predecessor (dataflow view)
334  *    and `the node points to' (implementation view).
335  *
336  *    The following description of the nodes lists four properties them if these
337  *    are of interest:
338  *     - the parameters to the constructor
339  *     - the inputs of the Firm node
340  *     - the outputs of the Firm node
341  *     - attributes to the node
342  *
343  *    ------------
344  *
345  *    ir_node *new_immBlock (void)
346  *    ----------------------------
347  *
348  *    Creates a new block. When a new block is created it cannot be known how
349  *    many predecessors this block will have in the control flow graph.
350  *    Therefore the list of inputs can not be fixed at creation.  Predecessors
351  *    can be added with add_immBlock_pred (block, control flow operation).
352  *    With every added predecessor the number of inputs to Phi nodes also
353  *    changes.
354  *
355  *    The block can be completed by mature_immBlock(block) if all predecessors are
356  *    known.  If several blocks are built at once, mature_immBlock can only be called
357  *    after set_value has been called for all values that are life at the end
358  *    of the block.  This is necessary so that Phi nodes created mature_immBlock
359  *    get the right predecessors in case of cyclic dependencies.  If all set_values
360  *    of this block are called after maturing it and before calling get_value
361  *    in some block that is control flow dependent on this block, the construction
362  *    is correct.
363  *
364  *    Example for faulty IR construction:  (draw the graph on a paper and you'll
365  *                                          get it ;-)
366  *
367  *      block_before_loop = new_immBlock();
368  *      set_cur_block(block_before_loop);
369  *      set_value(x);
370  *      mature_immBlock(block_before_loop);
371  *      before2header = new_Jmp;
372  *
373  *      loop_header = new_immBlock ();
374  *      set_cur_block(loop_header);
375  *      header2body - new_Jmp();
376  *
377  *      loop_body = new_immBlock ();
378  *      set_cur_block(loop_body);
379  *      body2header = new_Jmp();
380  *
381  *      add_immBlock_pred(loop_header, before2header);
382  *      add_immBlock_pred(loop_header, body2header);
383  *      add_immBlock_pred(loop_body, header2body);
384  *
385  *      mature_immBlock(loop_header);
386  *      mature_immBlock(loop_body);
387  *
388  *      get_value(loop_body, x);   //  gets the Phi in loop_header
389  *      set_value(loop_header, x); //  sets the value the above get_value should
390  *                                 //  have returned!!!
391  *
392  *    Mature_immBlock also fixes the number of inputs to the Phi nodes.  Mature_immBlock
393  *    should be called as early as possible, as afterwards the generation of Phi
394  *   nodes is more efficient.
395  *
396  *    Inputs:
397  *      There is an input for each control flow predecessor of the block.
398  *      The input points to an instruction producing an output of type X.
399  *      Possible predecessors:  Start, Jmp, Cond, Raise or Return or any node
400  *      possibly causing an exception.  (Often the real predecessors are Projs.)
401  *    Output:
402  *      Mode BB (R), all nodes belonging to this block should consume this output.
403  *      As they are strict (except Block and Phi node) it is a necessary condition
404  *      that the block node executed before any other node in this block executes.
405  *    Attributes:
406  *      block.matured  Indicates whether the block is mature.
407  *      block.**graph_arr
408  *                      This attribute contains all local values valid in this
409  *                      block. This is needed to build the Phi nodes and removed
410  *                      if the graph is complete.  This field is used by the
411  *              internal construction algorithm and should not be accessed
412  *              from outside.
413  *
414  *
415  *    ir_node *new_Block (int arity, ir_node **in)
416  *    --------------------------------------------
417  *
418  *    Creates a new Block with the given list of predecessors.  This block
419  *    is mature.  As other constructors calls optimization and vrfy for the
420  *    block.  If one of the predecessors is Unknown (as it has to be filled in
421  *    later) optimizations are skipped.  This is necessary to
422  *    construct Blocks in loops.  Leaving Unknown in the Block after finishing
423  *    the construction may have strange effects, especially for interprocedural
424  *    representation and analysis.
425  *
426  *
427  *    CONTROL FLOW OPERATIONS
428  *    -----------------------
429  *
430  *    In each block there must be exactly one of the control flow
431  *    operations Start, End, Jmp, Cond, Return or Raise.  The output of a
432  *    control flow operation points to the block to be executed next.
433  *
434  *    ir_node *new_Start (void)
435  *    -------------------------
436  *
437  *    Creates a start node.  Not actually needed public.  There is only one such
438  *   node in each procedure which is automatically created by new_ir_graph.
439  *
440  *    Inputs:
441  *      No inputs except the block it belogns to.
442  *    Output:
443  *      A tuple of 4 (5, 6) distinct values. These are labeled by the following
444  *      projection numbers (pn_Start):
445  *      * pn_Start_X_initial_exec    mode X, points to the first block to be exe *                                   cuted.
446  *      * pn_Start_M                 mode M, the global store
447  *      * pn_Start_P_frame_base      mode P, a pointer to the base of the proce  *                                   dures stack frame.
448  *      * pn_Start_P_globals         mode P, a pointer to the part of the memory *                                   containing_all_ global things.
449  *      * pn_Start_T_args            mode T, a tuple containing all arguments of *                                   the procedure.
450  *
451  *
452  *    ir_node *new_End (void)
453  *    -----------------------
454  *
455  *    Creates an end node.  Not actually needed public.  There is only one such
456  *   node in each procedure which is automatically created by new_ir_graph.
457  *
458  *    Inputs:
459  *      No inputs except the block it belongs to.
460  *    Output:
461  *      No output.
462  *
463  *    ir_node *new_Jmp (void)
464  *    -----------------------
465  *
466  *    Creates a Jmp node.
467  *
468  *    Inputs:
469  *      The block the node belongs to
470  *    Output:
471  *      Control flow to the next block.
472  *
473  *    ir_node *new_IJmp (ir_node *tgt)
474  *    -----------------------
475  *
476  *    Creates an IJmp node.
477  *
478  *    Inputs:
479  *      The node that represents the target jump address
480  *    Output:
481  *      Control flow to an unknown target, must be pinned by
482  *      the End node.
483  *
484  *    ir_node *new_Cond (ir_node *c)
485  *    ------------------------------
486  *
487  *    Creates a Cond node.  There are two versions of this node.
488  *
489  *    The Boolean Cond:
490  *    Input:
491  *      A value of mode b.
492  *    Output:
493  *      A tuple of two control flows.  The first is taken if the input is
494  *      false, the second if it is true.
495  *
496  *    The Switch Cond:
497  *    Input:
498  *      A value of mode I_u. (i)
499  *    Output:
500  *      A tuple of n control flows.  If the Cond's input is i, control
501  *      flow will procede along output i. If the input is >= n control
502  *      flow proceeds along output n.
503  *
504  *    ir_node *new_Return (ir_node *store, int arity, ir_node **in)
505  *    -------------------------------------------------------------
506  *
507  *    The return node has as inputs the results of the procedure.  It
508  *    passes the control flow to the end_block.
509  *
510  *    Inputs:
511  *      The memory state.
512  *      All results.
513  *    Output
514  *      Control flow to the end block.
515  *
516  *    ---------
517  *
518  *    ir_node *new_Const (tarval *con)
519  *    -----------------------------------------------
520  *
521  *    Creates a constant in the constant table and adds a Const node
522  *    returning this value to the start block. The mode is derived
523  *    from the tarval.
524  *
525  *    Parameters:
526  *      *con             Points to an entry in the constant table.
527  *                       This pointer is added to the attributes of
528  *                       the node (self->attr.con)
529  *    Inputs:
530  *      No inputs except the block it belogns to.
531  *    Output:
532  *      The constant value.
533  *    Attribute:
534  *      attr.con   A tarval* pointer to the proper entry in the constant
535  *                 table.
536  *
537  *    ir_node *new_SymConst (ir_mode *mode,union symconst_symbol value, symconst_addr_ent kind)
538  *    -----------------------------------------------------------------------------------------
539  *
540  *    There are three five of symbolic constants:
541  *     symconst_type_tag   The symbolic constant represents a type tag.
542  *     symconst_type_size  The symbolic constant represents the size of a type.
543  *     symconst_type_align The symbolic constant represents the alignment of a type.
544  *     symconst_addr_name  Information for the linker, e.g. the name of a global
545  *                         variable.
546  *     symconst_addr_ent   The symbolic constant represents the address of an entity.
547  *
548  *    To represent a pointer to an entity that is represented by an entity
549  *    datastructure don't use
550  *      new_SymConst((type_or_id*)get_entity_ld_ident(ent), symconst_addr_name);.
551  *    Use a real const instead:
552  *      new_SymConst(ent, symconst_addr_ent);
553  *    This makes the Constant independent of name changes of the entity due to
554  *    mangling.
555  *
556  *    Parameters
557  *      kind        The kind of the symbolic constant: type_tag, size or link_info.
558  *      *type_or_id Points to the type the tag stands for or to the type
559  *                  whose size is represented by the constant or to an ident
560  *                  representing the linkage info.
561  *
562  *    Inputs:
563  *      No inputs except the block it belongs to.
564  *    Output:
565  *      A symbolic constant.
566  *
567  *    Attributes:
568  *      attr.i.num       The symconst_addr_ent, i.e. one of
569  *                        -symconst_type_tag
570  *                        -symconst_type_size
571  *                        -symconst_type_align
572  *                        -symconst_addr_name
573  *                        -symconst_addr_ent
574  *
575  *    If the attr.i.num is symconst_type_tag, symconst_type_size or symconst_type_align,
576  *    the node contains an attribute:
577  *
578  *      attr.i.*type,    a pointer to a type_class.
579  *        if it is linkage_ptr_info it contains
580  *      attr.i.*ptrinfo,  an ident holding information for the linker.
581  *
582  *    ---------------
583  *
584  *    ir_node *new_simpleSel (ir_node *store, ir_node *frame, ir_entity *sel)
585  *    -----------------------------------------------------------------------
586  *
587  *
588  *    Selects an entity from a compound type. This entity can be a field or
589  *    a method.
590  *
591  *    Parameters:
592  *      *store     The memory in which the object the entity should be selected
593  *                 from is allocated.
594  *      *frame     The pointer to the object.
595  *      *sel       The entity to select.
596  *
597  *    Inputs:
598  *      The memory containing the object.
599  *      A pointer to the object.
600  *      An unsigned integer.
601  *    Output:
602  *      A pointer to the selected entity.
603  *    Attributes:
604  *      attr.sel   Pointer to the entity
605  *
606  *
607  *    ir_node *new_Sel (ir_node *store, ir_node *frame, int arity, ir_node **in,
608  *    --------------------------------------------------------------------------
609  *                      ir_entity *sel)
610  *                      ---------------
611  *
612  *    Selects a field from an array type.  The entity has as owner the array, as
613  *    type the arrays element type.  The indices to access an array element are
614  *    given also.
615  *
616  *    Parameters:
617  *      *store     The memory in which the object the entity should be selected from
618  *                 is allocated.
619  *      *frame     The pointer to the object.
620  *      *arity     number of array indices.
621  *      *in        array with index inputs to the node.
622  *      *sel       The entity to select.
623  *
624  *    Inputs:
625  *      The memory containing the object.
626  *      A pointer to the object.
627  *      As much unsigned integer as there are array expressions.
628  *    Output:
629  *      A pointer to the selected entity.
630  *    Attributes:
631  *      attr.sel   Pointer to the entity
632  *
633  *    The constructors new_Sel and new_simpleSel generate the same IR nodes.
634  *    simpleSel just sets the arity of the index inputs to zero.
635  *
636  *
637  *    ARITHMETIC OPERATIONS
638  *    ---------------------
639  *
640  *    ir_node *new_Call (ir_node *store, ir_node *callee, int arity, ir_node **in,
641  *    ----------------------------------------------------------------------------
642  *                       type_method *type)
643  *                       ------------------
644  *
645  *    Creates a procedure call.
646  *
647  *    Parameters
648  *      *store           The actual store.
649  *      *callee          A pointer to the called procedure.
650  *      arity            The number of procedure parameters.
651  *      **in             An array with the pointers to the parameters.
652  *                       The constructor copies this array.
653  *      *type            Type information of the procedure called.
654  *
655  *    Inputs:
656  *      The store, the callee and the parameters.
657  *    Output:
658  *      A tuple containing the eventually changed store and the procedure
659  *      results.
660  *    Attributes:
661  *      attr.call        Contains the type information for the procedure.
662  *
663  *
664  *    ir_node *new_Add (ir_node *op1, ir_node *op2, ir_mode *mode)
665  *    ------------------------------------------------------------
666  *
667  *    Trivial.
668  *
669  *    ir_node *new_Sub (ir_node *op1, ir_node *op2, ir_mode *mode)
670  *    ------------------------------------------------------------
671  *
672  *    Trivial.
673  *
674  *    ir_node *new_Minus (ir_node *op, ir_mode *mode)
675  *    -----------------------------------------------
676  *
677  *    Unary Minus operations on integer and floating point values.
678  *
679  *    ir_node *new_Mul (ir_node *op1, ir_node *op2, ir_mode *mode)
680  *    ------------------------------------------------------------
681  *
682  *    Trivial.
683  *
684  *    ir_node *new_Mulh (ir_node *op1, ir_node *op2, ir_mode *mode)
685  *    ------------------------------------------------------------
686  *
687  *    Returns the high order bits of a n*n=2n multiplication.
688  *
689  *    ir_node *new_Quot (ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state)
690  *    -------------------------------------------------------------------------------------------------
691  *
692  *    Quot performs exact division of floating point numbers.  It's mode
693  *    is Tuple, the mode of the result must match the Proj mode
694  *    that extracts the result of the arithmetic operations.
695  *
696  *    Inputs:
697  *      The store needed to model exceptions and the two operands.
698  *    Output:
699  *      A tuple containing a memory and a execution for modeling exceptions
700  *      and the result of the arithmetic operation.
701  *
702  *    ir_node *new_DivMod (ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state)
703  *    ---------------------------------------------------------------------------------------------------
704  *
705  *    Performs Div and Mod on integer values.
706  *
707  *    Output:
708  *      A tuple containing a memory and a execution for modeling exceptions
709  *      and the two result of the arithmetic operations.
710  *
711  *    ir_node *new_Div (ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state)
712  *    ------------------------------------------------------------------------------------------------
713  *
714  *    Trivial.
715  *
716  *    ir_node *new_Mod (ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state)
717  *    ------------------------------------------------------------------------------------------------
718  *
719  *    Trivial.
720  *
721  *    ir_node *new_Abs (ir_node *op, ir_mode *mode)
722  *    ---------------------------------------------
723  *
724  *    Trivial.
725  *
726  *    ir_node *new_And (ir_node *op1, ir_node *op2, ir_mode *mode)
727  *    ------------------------------------------------------------
728  *
729  *    Trivial.
730  *
731  *    ir_node *new_Or (ir_node *op1, ir_node *op2, ir_mode *mode)
732  *    -----------------------------------------------------------
733  *
734  *    Trivial.
735  *
736  *    ir_node *new_Eor (ir_node *op1, ir_node *op2, ir_mode *mode)
737  *    ------------------------------------------------------------
738  *
739  *    Trivial.
740  *
741  *    ir_node *new_Not (ir_node *op, ir_mode *mode)
742  *    ---------------------------------------------
743  *
744  *    This node constructs a constant where all bits are set to one
745  *    and a Eor of this constant and the operator.  This simulates a
746  *    Not operation.
747  *
748  *    ir_node *new_Shl (ir_node *op, ir_node *k, ir_mode *mode)
749  *    ---------------------------------------------------------
750  *
751  *    Trivial.
752  *
753  *    ir_node *new_Shr (ir_node *op, ir_node *k, ir_mode *mode)
754  *    ---------------------------------------------------------
755  *
756  *    Logic shift right, i.e., zero extended.
757  *
758  *
759  *    ir_node *new_Shrs (ir_node *op, ir_node *k, ir_mode *mode)
760  *    ----------------------------------------------------------
761  *
762  *    Arithmetic shift right, i.e., sign extended.
763  *
764  *    ir_node *new_Rotl (ir_node *op, ir_node *k, ir_mode *mode)
765  *    ---------------------------------------------------------
766  *
767  *    Rotates the operand to the left by k bits.
768  *
769  *    ir_node *new_Carry (ir_node *op1, ir_node *op2, ir_mode *mode)
770  *    ------------------------------------------------------------
771  *
772  *    Calculates the Carry value for integer addition. Used only
773  *    in lowering code.
774  *
775  *    ir_node *new_Borrow (ir_node *op1, ir_node *op2, ir_mode *mode)
776  *    ------------------------------------------------------------
777  *
778  *    Calculates the Borrow value for integer substraction. Used only
779  *    in lowering code.
780  *
781  *    ir_node *new_Conv (ir_node *op, ir_mode *mode)
782  *    ---------------------------------------------
783  *
784  *    Mode conversion.  For allowed conversions see UKA Tech Report
785  *    1999-14.
786  *
787  *    ir_node *new_Cmp (ir_node *op1, ir_node *op2)
788  *    ---------------------------------------------
789  *
790  *    Input:
791  *      The two values to be compared.
792  *    Output:
793  *      A 16-tuple containing the results of the 16 different comparisons.
794  *      The following is a list giving the comparisons and a projection
795  *      number (pn_Cmp) to use in Proj nodes to extract the proper result.
796  *        pn_Cmp_False false
797  *        pn_Cmp_Eq    equal
798  *        pn_Cmp_Lt    less
799  *        pn_Cmp_Le    less or equal
800  *        pn_Cmp_Gt    greater
801  *        pn_Cmp_Ge    greater of equal
802  *        pn_Cmp_Lg    less or greater
803  *        pn_Cmp_Leg   less, equal or greater = ordered
804  *        pn_Cmp_Uo    unordered
805  *        pn_Cmp_Ue    unordered or equal
806  *        pn_Cmp_Ul    unordered or less
807  *        pn_Cmp_Ule   unordered, less or equal
808  *        pn_Cmp_Ug    unordered or greater
809  *        pn_Cmp_Uge   unordered, greater or equal
810  *        pn_Cmp_Ne    unordered, less or greater = not equal
811  *        pn_Cmp_True  true
812  *
813  *
814  *
815  *    ------------
816  *
817  *    In general, Phi nodes are automaitcally inserted.  In some cases, if
818  *    all predecessors of a block are known, an explicit Phi node constructor
819  *    is needed.  E.g., to construct a FIRM graph for a statement as
820  *      a = (b==c) ? 2 : 5;
821  *
822  *    ir_node *new_Phi (int arity, ir_node **in, ir_mode *mode)
823  *    ---------------------------------------------------------
824  *
825  *    Creates a Phi node. The in's order has to correspond to the order
826  *    of in's of current_block.  This is not checked by the library!
827  *    If one of the predecessors is Unknown (as it has to be filled in
828  *    later) optimizations are skipped.  This is necessary to
829  *    construct Phi nodes in loops.  Leaving Unknown in the Phi after finishing
830  *    the construction may have strange effects, especially for interprocedural
831  *    representation and analysis.
832  *
833  *    Parameter
834  *      arity            number of predecessors
835  *      **in             array with predecessors
836  *      *mode            The mode of it's inputs and output.
837  *    Inputs:
838  *      A Phi node has as many inputs as the block it belongs to.
839  *      Each input points to a definition of the same value on a
840  *      different path in the control flow.
841  *    Output
842  *      The definition valid in this block.
843  *
844  *    ir_node *new_Mux (ir_node *sel, ir_node *ir_false, ir_node *ir_true, ir_mode *mode)
845  *    -----------------------------------------------------------------------------
846  *
847  *    Creates a Mux node. This node implements the following semantic:
848  *    If the sel node (which must be of mode_b) evaluates to true, its value is
849  *    ir_true, else ir_false;
850  *
851  *
852  *
853  *    OPERATIONS TO MANAGE MEMORY EXPLICITLY
854  *    --------------------------------------
855  *
856  *    ir_node *new_Load (ir_node *store, ir_node *addr, ir_mode *mode)
857  *    ----------------------------------------------------------------
858  *
859  *    The Load operation reads a value from memory.
860  *
861  *    Parameters:
862  *    *store        The current memory.
863  *    *addr         A pointer to the variable to be read in this memory.
864  *    *mode         The mode of the value to be loaded.
865  *
866  *    Inputs:
867  *      The memory and a pointer to a variable in this memory.
868  *    Output:
869  *      A tuple of the memory, a control flow to be taken in case of
870  *      an exception and the loaded value.
871  *
872  *    ir_node *new_Store (ir_node *store, ir_node *addr, ir_node *val)
873  *    ----------------------------------------------------------------
874  *
875  *    The Store operation writes a value to a variable in memory.
876  *
877  *    Inputs:
878  *      The memory, a pointer to a variable in this memory and the value
879  *      to write to this variable.
880  *    Output:
881  *      A tuple of the changed memory and a control flow to be taken in
882  *      case of an exception.
883  *
884  *    ir_node *new_Alloc (ir_node *store, ir_node *size, ir_type *alloc_type,
885  *    -----------------------------------------------------------------------
886  *                        where_alloc where)
887  *                        ------------------
888  *
889  *    The Alloc node allocates a new variable.  It can be specified whether the
890  *    variable should be allocated to the stack or to the heap.
891  *
892  *    Parameters:
893  *      *store       The memory which shall contain the new variable.
894  *      **    *size        The number of bytes to allocate. Old. **
895  *      *size        We decided that the size easily can be derived from the type.
896  *                   This field is for allocating arrays, i.e., it gives the multiple
897  *           of the size of alloc_type to allocate memory for.
898  *      *alloc_type  The type of the allocated variable.
899  *      where        Where to allocate the variable, either heap_alloc or stack_alloc.
900  *
901  *    Inputs:
902  *      A memory and an unsigned integer.
903  *    Output:
904  *      A tuple of the changed memory, a control flow to be taken in
905  *      case of an exception and the pointer to the new variable.
906  *    Attributes:
907  *      a.where          Indicates where the variable is allocated.
908  *      a.*type          A pointer to the class the allocated data object
909  *                       belongs to.
910  *
911  *    ir_node *new_Free (ir_node *store, ir_node *ptr, ir_node *size, ir_type *free_type,
912  *    -----------------------------------------------------------------------------------
913  *                        where_alloc where)
914  *                        ------------------
915  *
916  *    The Free node frees memory of the given variable.
917  *
918  *    Parameters:
919  *      *store       The memory which shall contain the new variable.
920  *      *ptr         The pointer to the object to free.
921  *      *size        The number of objects of type free_type to free in a sequence.
922  *      *free_type   The type of the freed variable.
923  *      where        Where the variable was allocated, either heap_alloc or stack_alloc.
924  *
925  *    Inputs:
926  *      A memory, a pointer and an unsigned integer.
927  *    Output:
928  *      The changed memory.
929  *    Attributes:
930  *      f.*type          A pointer to the type information of the freed data object.
931  *
932  *    Not Implemented!
933  *
934  *    ir_node *new_Sync (int arity, ir_node **in)
935  *    -------------------------------------------
936  *
937  *    The Sync operation unifies several partial memory blocks.  These blocks
938  *    have to be pairwise disjunct or the values in common locations have to
939  *    be identical.  This operation allows to specify all operations that eventually
940  *    need several partial memory blocks as input with a single entrance by
941  *    unifying the memories with a preceding Sync operation.
942  *
943  *    Parameters
944  *      arity    The number of memories to synchronize.
945  *      **in     An array of pointers to nodes that produce an output of
946  *               type memory.
947  *    Inputs
948  *      Several memories.
949  *    Output
950  *      The unified memory.
951  *
952  *
953  *    SPECIAL OPERATIONS
954  *    ------------------
955  *
956  *    ir_node *new_Bad (void)
957  *    -----------------------
958  *
959  *    Returns the unique Bad node current_ir_graph->bad.
960  *    This node is used to express results of dead code elimination.
961  *
962  *    ir_node *new_NoMem (void)
963  *    -----------------------------------------------------------------------------------
964  *
965  *    Returns the unique NoMem node current_ir_graph->no_mem.
966  *    This node is used as input for operations that need a Memory, but do not
967  *    change it like Div by const != 0, analyzed calls etc.
968  *
969  *    ir_node *new_Proj (ir_node *arg, ir_mode *mode, long proj)
970  *    ----------------------------------------------------------
971  *
972  *    Selects one entry of a tuple.  This is a hidden edge with attributes.
973  *
974  *    Parameters
975  *      *arg      A node producing a tuple.
976  *      *mode     The mode of the value to project.
977  *      proj      The position of the value in the tuple.
978  *    Input:
979  *      The tuple.
980  *    Output:
981  *      The value.
982  *
983  *    ir_node *new_Tuple (int arity, ir_node **in)
984  *    --------------------------------------------
985  *
986  *    Builds a Tuple from single values.  This is needed to implement
987  *    optimizations that remove a node that produced a tuple.  The node can be
988  *    replaced by the Tuple operation so that the following Proj nodes have not to
989  *    be changed.  (They are hard to find due to the implementation with pointers
990  *    in only one direction.)  The Tuple node is smaller than any other
991  *    node, so that a node can be changed into a Tuple by just changing it's
992  *    opcode and giving it a new in array.
993  *
994  *    Parameters
995  *      arity    The number of tuple elements.
996  *      **in     An array containing pointers to the nodes producing the
997  *               tuple elements.
998  *
999  *    ir_node *new_Id (ir_node *val, ir_mode *mode)
1000  *    ---------------------------------------------
1001  *
1002  *    The single output of the Id operation is it's input.  Also needed
1003  *    for optimizations.
1004  *
1005  *
1006  *    HIGH LEVEL OPERATIONS
1007  *    ---------------------
1008  *
1009  *    ir_node *new_CopyB (ir_node *store, ir_node *dst, ir_node *src, ir_type *data_type)
1010  *    -----------------------------------------------------------------------------------
1011  *
1012  *    Describes a high level block copy of a compound type from address src to
1013  *    address dst. Must be lowered to a Call to a runtime memory copy function.
1014  *
1015  *
1016  *    HIGH LEVEL OPERATIONS: Exception Support
1017  *    ----------------------------------------
1018  *    See TechReport 1999-14, chapter Exceptions.
1019  *
1020  *    ir_node *new_InstOf(ir_node *store, ir_node *ptr, ir_type *type);
1021  *    -----------------------------------------------------------------------------------
1022  *
1023  *    Describes a high level type check. Must be lowered to a Call to a runtime check
1024  *    function.
1025  *
1026  *    ir_node *new_Raise (ir_node *store, ir_node *obj)
1027  *    -------------------------------------------------
1028  *
1029  *    Raises an exception.  Unconditional change of control flow.  Writes
1030  *    an explicit Except variable to memory to pass it to the exception
1031  *    handler.  Must be lowered to a Call to a runtime check
1032  *    function.
1033  *
1034  *    Inputs:
1035  *      The memory state.
1036  *      A pointer to the Except variable.
1037  *    Output:
1038  *      A tuple of control flow and the changed memory state.  The control flow
1039  *      points to the exception handler if it is definied in this procedure,
1040  *      else it points to the end_block.
1041  *
1042  *    ir_node *new_Bound  (ir_node *store, ir_node *idx, ir_node *lower, ir_node *upper);
1043  *    -----------------------------------------------------------------------------------
1044  *
1045  *    Describes a high level bounds check. Must be lowered to a Call to a runtime check
1046  *    function.
1047  *
1048  *    ir_node *new_Pin  (ir_node *node);
1049  *    -----------------------------------------------------------------------------------
1050  *
1051  *    Pin the value of the node node in the current block  No users of the Pin node can
1052  *    float above the Block of the Pin. The node cannot float behind this block. Often
1053  *    used to Pin the NoMem node.
1054  *
1055  *
1056  *    COPING WITH DATA OBJECTS
1057  *    ========================
1058  *
1059  *    Two kinds of data objects have to be distinguished for generating
1060  *    FIRM.  First there are local variables other than arrays that are
1061  *    known to be alias free.  Second there are all other data objects.
1062  *    For the first a common SSA representation is built, the second
1063  *    are modeled by saving them to memory.  The memory is treated as
1064  *    a single local variable, the alias problem is hidden in the
1065  *    content of this variable.
1066  *
1067  *    All values known in a Block are listed in the block's attribute,
1068  *    block.**graph_arr which is used to automatically insert Phi nodes.
1069  *    The following two functions can be used to add a newly computed value
1070  *    to the array, or to get the producer of a value, i.e., the current
1071  *    live value.
1072  *
1073  *    inline void set_value (int pos, ir_node *value)
1074  *    -----------------------------------------------
1075  *
1076  *    Has to be called for every assignment to a local variable.  It
1077  *    adds the value to the array of used values at position pos.  Pos
1078  *    has to be a unique identifier for an entry in the procedure's
1079  *    definition table.  It can be used to access the value again.
1080  *    Requires current_block to be set correctly.
1081  *
1082  *    ir_node *get_value (int pos, ir_mode *mode)
1083  *    -------------------------------------------
1084  *
1085  *    Returns the node defining the value referred to by pos. If the
1086  *    value is not defined in this block a Phi node is generated and
1087  *    all definitions reaching this Phi node are collected.  It can
1088  *    happen that the algorithm allocates an unnecessary Phi node,
1089  *    e.g. if there is only one definition of this value, but this
1090  *    definition reaches the currend block on several different
1091  *    paths.  This Phi node will be eliminated if optimizations are
1092  *    turned on right after it's creation.
1093  *    Requires current_block to be set correctly.
1094  *
1095  *    There are two special routines for the global store:
1096  *
1097  *    void set_store (ir_node *store)
1098  *    -------------------------------
1099  *
1100  *    Adds the store to the array of known values at a reserved
1101  *    position.
1102  *    Requires current_block to be set correctly.
1103  *
1104  *    ir_node *get_store (void)
1105  *    -------------------------
1106  *
1107  *    Returns the node defining the actual store.
1108  *    Requires current_block to be set correctly.
1109  *
1110  *
1111  *    inline void keep_alive (ir_node *ka)
1112  *    ------------------------------------
1113  *
1114  *    Keep this node alive because it is (might be) not in the control
1115  *    flow from Start to End.  Adds the node to the list in the end
1116  *   node.
1117  *
1118  */
1119 #ifndef FIRM_IR_IRCONS_H
1120 #define FIRM_IR_IRCONS_H
1121
1122 #include "firm_types.h"
1123
1124 /*-------------------------------------------------------------------------*/
1125 /* The raw interface                                                       */
1126 /*-------------------------------------------------------------------------*/
1127
1128 /** Constructor for a Block node.
1129  *
1130  * Constructs a mature block with the given predecessors.  Use Unknown
1131  * nodes as predecessors to construct a block if the number of
1132  * predecessors is known, but not the predecessors themselves.  This
1133  * constructor does not set current_block.  It not be used with
1134  * automatic Phi node construction.
1135  *
1136  * @param *db    A Pointer for  debug information.
1137  * @param irg    The IR graph the block belongs to.
1138  * @param arity  The number of control predecessors.
1139  * @param in[]   An array of control predecessors.  The length of
1140  *               the array must be 'arity'.  The constructor copies this array.
1141  */
1142 ir_node *new_rd_Block  (dbg_info *db, ir_graph *irg,  int arity, ir_node *in[]);
1143
1144 /** Constructor for a Start node.
1145  *
1146  * @param *db    A pointer for debug information.
1147  * @param *irg   The IR graph the node belongs to.
1148  * @param *block The IR block the node belongs to.
1149  */
1150 ir_node *new_rd_Start  (dbg_info *db, ir_graph *irg, ir_node *block);
1151
1152 /** Constructor for a End node.
1153  *
1154  * @param *db    A pointer for  debug information.
1155  * @param *irg   The IR graph the node  belongs to.
1156  * @param *block The IR block the node belongs to.
1157  */
1158 ir_node *new_rd_End    (dbg_info *db, ir_graph *irg, ir_node *block);
1159
1160 /** Constructor for a Jmp node.
1161  *
1162  * Jmp represents control flow to a single control successor.
1163  *
1164  * @param *db     A pointer for debug information.
1165  * @param *irg    The IR graph the node belongs to.
1166  * @param *block  The IR block the node belongs to.
1167  */
1168 ir_node *new_rd_Jmp    (dbg_info *db, ir_graph *irg, ir_node *block);
1169
1170 /** Constructor for an IJmp node.
1171  *
1172  * IJmp represents control flow to a single control successor not
1173  * statically known i.e. an indirect Jmp.
1174  *
1175  * @param *db     A pointer for debug information.
1176  * @param *irg    The IR graph the node belongs to.
1177  * @param *block  The IR block the node belongs to.
1178  * @param *tgt    The IR node representing the target address.
1179  */
1180 ir_node *new_rd_IJmp   (dbg_info *db, ir_graph *irg, ir_node *block, ir_node *tgt);
1181
1182 /** Constructor for a Break node.
1183  *
1184  * Break represents control flow to a single control successor just as Jmp.
1185  * The blocks separated by a break may not be concatenated by an optimization.
1186  * It is used for the interprocedural representation where blocks are parted
1187  * behind Call nodes to represent the control flow to called procedures.
1188  *
1189  * @param *db     A pointer for debug information.
1190  * @param *irg    The IR graph the node belong to.
1191  * @param *block  The block the node belong to.
1192  */
1193 ir_node *new_rd_Break  (dbg_info *db, ir_graph *irg, ir_node *block);
1194
1195 /** Constructor for a Cond node.
1196  *
1197  * If c is mode_b represents a conditional branch (if/else). If c is
1198  * mode_Is/mode_Iu (?) represents a switch.  (Allocates dense Cond
1199  * node, default Proj is 0.)
1200  *
1201  * This is not consistent:  Input to Cond is Is, Proj has as proj number
1202  * longs.
1203  *
1204  * @param *db    A pointer for debug information.
1205  * @param *irg   The IR graph the node  belongs to.
1206  * @param *block The IR block the node belongs to.
1207  * @param *c     The conditions parameter. Can be of mode b or I_u.
1208  */
1209 ir_node *new_rd_Cond   (dbg_info *db, ir_graph *irg, ir_node *block, ir_node *c);
1210
1211 /** Constructor for a Return node.
1212  *
1213  * Returns the memory and zero or more return values.  Only node that
1214  * can end regular control flow.
1215  *
1216  * @param *db    A pointer for debug information.
1217  * @param *irg   The IR graph the node  belongs to.
1218  * @param *block The IR block the node belongs to.
1219  * @param *store The state of memory.
1220  * @param arity  Number of return values.
1221  * @param *in    Array of length arity with return values.  The constructor copies this array.
1222  */
1223 ir_node *new_rd_Return (dbg_info *db, ir_graph *irg, ir_node *block,
1224                         ir_node *store, int arity, ir_node *in[]);
1225
1226 /** Constructor for a Const_type node.
1227  *
1228  * Adds the node to the start block.
1229  *
1230  * The constant represents a target value.  This constructor sets high
1231  * level type information for the constant value.
1232  * Derives mode from passed tarval.
1233  *
1234  * @param *db    A pointer for debug information.
1235  * @param *irg   The IR graph the node  belongs to.
1236  * @param *con   Points to an entry in the constant table.
1237  * @param *tp    The type of the constant.
1238  */
1239 ir_node *new_rd_Const_type (dbg_info *db, ir_graph *irg,
1240                             tarval *con, ir_type *tp);
1241
1242 /** Constructor for a Const node.
1243  *
1244  * Adds the node to the start block.
1245  *
1246  * Constructor for a Const node. The constant represents a target
1247  * value.  Sets the type information to type_unknown.  (No more
1248  * supported: If tv is entity derives a somehow useful type.)
1249  * Derives mode from passed tarval.
1250  *
1251  * @param *db    A pointer for debug information.
1252  * @param *irg   The IR graph the node  belongs to.
1253  * @param *con   Points to an entry in the constant table.
1254  */
1255 ir_node *new_rd_Const  (dbg_info *db, ir_graph *irg, tarval *con);
1256
1257 /** Constructor for a Const node.
1258  *
1259  * Adds the node to the start block.
1260  *
1261  * Constructor for a Const node. The constant represents a target
1262  * value.  Sets the type information to type_unknown.  (No more
1263  * supported: If tv is entity derives a somehow useful type.)
1264  *
1265  * @param *db    A pointer for debug information.
1266  * @param *irg   The IR graph the node  belongs to.
1267  * @param *mode  The mode of the operands and results.
1268  * @param value  A value from which the tarval is made.
1269  */
1270 ir_node *new_rd_Const_long (dbg_info *db, ir_graph *irg,
1271                                     ir_mode *mode, long value);
1272
1273 /** Constructor for a SymConst_type node.
1274  *
1275  *  This is the constructor for a symbolic constant.
1276  *    There are four kinds of symbolic constants:
1277  *    - type_tag   The symbolic constant represents a type tag.  The type the
1278  *                 tag stands for is given explicitly.
1279  *    - type_size  The symbolic constant represents the size of a type.  The
1280  *                 type of which the constant represents the size is given
1281  *                 explicitly.
1282  *    - type_align The symbolic constant represents the alignment of a type.  The
1283  *                 type of which the constant represents the size is given
1284  *                 explicitly.
1285  *    - addr_name  The symbolic constant represents the address of an entity
1286  *                 (variable or method).  The variable is indicated by a name
1287  *                 that is valid for linking.
1288  *    - addr_ent   The symbolic constant represents the address of an entity
1289  *                 (variable or method).  The variable is given explicitly by
1290  *                 a firm entity.
1291  *
1292  *    Inputs to the node:
1293  *      No inputs except the block it belongs to.
1294  *    Outputs of the node.
1295  *      An unsigned integer (I_u) or a pointer (P).
1296  *
1297  *    Mention union in declaration so that the firmjni generator recognizes that
1298  *    it can not cast the argument to an int.
1299  *
1300  * @param *db     A pointer for debug information.
1301  * @param *irg    The IR graph the node  belongs to.
1302  * @param *block  The IR block the node belongs to.
1303  * @param mode    The mode for the SymConst.
1304  * @param symkind The kind of the symbolic constant: type_tag, size, addr_name or addr_ent.
1305  * @param value   A type, entity or a ident depending on the SymConst kind.
1306  * @param tp      The source type of the constant.
1307  */
1308 ir_node *new_rd_SymConst_type(dbg_info *db, ir_graph *irg, ir_node *block, ir_mode *mode,
1309                               union symconst_symbol value,
1310                               symconst_kind symkind, ir_type *tp);
1311
1312 /** Constructor for a SymConst node.
1313  *
1314  *  Same as new_rd_SymConst_type, except that it sets the type to type_unknown.
1315  */
1316 ir_node *new_rd_SymConst(dbg_info *db, ir_graph *irg, ir_node *block, ir_mode *mode,
1317                          union symconst_symbol value, symconst_kind symkind);
1318
1319 /** Constructor for a SymConst addr_ent node.
1320  *
1321  * Same as new_rd_SymConst_type, except that the constructor is tailored for
1322  * symconst_addr_ent.
1323  * Adds the SymConst to the start block of irg. */
1324 ir_node *new_rd_SymConst_addr_ent(dbg_info *db, ir_graph *irg, ir_mode *mode,
1325                                   ir_entity *symbol, ir_type *tp);
1326
1327 /** Constructor for a SymConst ofs_ent node.
1328  *
1329  * Same as new_rd_SymConst_type, except that the constructor is tailored for
1330  * symconst_ofs_ent.
1331  * Adds the SymConst to the start block of irg.
1332  */
1333 ir_node *new_rd_SymConst_ofs_ent(dbg_info *db, ir_graph *irg, ir_mode *mode,
1334                                  ir_entity *symbol, ir_type *tp);
1335
1336 /** Constructor for a SymConst addr_name node.
1337  *
1338  * Same as new_rd_SymConst_type, except that the constructor is tailored for
1339  * symconst_addr_ent.
1340  * Adds the SymConst to the start block of irg.
1341  */
1342 ir_node *new_rd_SymConst_addr_name(dbg_info *db, ir_graph *irg, ir_mode *mode,
1343                                    ident *symbol, ir_type *tp);
1344
1345 /** Constructor for a SymConst type_tag node.
1346  *
1347  * Same as new_rd_SymConst_type, except that the constructor is tailored for
1348  * symconst_addr_ent.
1349  * Adds the SymConst to the start block of irg.
1350  */
1351 ir_node *new_rd_SymConst_type_tag(dbg_info *db, ir_graph *irg, ir_mode *mode,
1352                                   ir_type *symbol, ir_type *tp);
1353
1354 /** Constructor for a SymConst size node.
1355  *
1356  * Same as new_rd_SymConst_type, except that the constructor is tailored for
1357  * symconst_type_size.
1358  * Adds the SymConst to the start block of irg. */
1359 ir_node *new_rd_SymConst_size(dbg_info *db, ir_graph *irg, ir_mode *mode,
1360                               ir_type *symbol, ir_type *tp);
1361
1362 /** Constructor for a SymConst size node.
1363  *
1364  * Same as new_rd_SymConst_type, except that the constructor is tailored for
1365  * symconst_type_align.
1366  * Adds the SymConst to the start block of irg.
1367  */
1368 ir_node *new_rd_SymConst_align(dbg_info *db, ir_graph *irg, ir_mode *mode,
1369                                ir_type *symbol, ir_type *tp);
1370
1371 /** Constructor for a simpleSel node.
1372  *
1373  *  This is a shortcut for the new_rd_Sel() constructor.  To be used for
1374  *  Sel nodes that do not select from an array, i.e., have no index
1375  *  inputs.  It adds the two parameters 0, NULL.
1376  *
1377  * @param   *db        A pointer for debug information.
1378  * @param   *irg       The IR graph the node  belongs to.
1379  * @param   *block     The IR block the node belongs to.
1380  * @param   *store     The memory in which the object the entity should be
1381  *                     selected from is allocated.
1382  * @param   *objptr    The object from that the Sel operation selects a
1383  *                     single attribute out.
1384  * @param   *ent       The entity to select.
1385  */
1386 ir_node *new_rd_simpleSel (dbg_info *db, ir_graph *irg, ir_node *block,
1387                            ir_node *store, ir_node *objptr, ir_entity *ent);
1388
1389 /** Constructor for a Sel node.
1390  *
1391  * The select node selects an entity (field or method) from an entity
1392  * with a compound type.  It explicitly specifies the entity selected.
1393  * Dynamically the node may select entities that overwrite the given
1394  * entity.  If the selected entity is an array element entity the Sel
1395  * node takes the required array indices as inputs.
1396  *
1397  * @param   *db        A pointer for debug information.
1398  * @param   *irg       The IR graph the node  belongs to.
1399  * @param   *block     The IR block the node belongs to.
1400  * @param   *store     The memory in which the object the entity should be selected
1401  *                     from is allocated.
1402  * @param   *objptr    A pointer to a compound entity the Sel operation selects a
1403  *                     single attribute from.
1404  * @param   *n_index   The number of array indices needed to select an array element entity.
1405  * @param   *index[]   If the compound entity is an array the indices of the selected
1406  *                     element entity.  The constructor copies this array.
1407  * @param   *ent       The entity to select.
1408  */
1409 ir_node *new_rd_Sel    (dbg_info *db, ir_graph *irg, ir_node *block, ir_node *store,
1410                                     ir_node *objptr, int n_index, ir_node *index[], ir_entity *ent);
1411
1412 /** Constructor for a Call node.
1413  *
1414  *  Represents all kinds of method and function calls.
1415  *
1416  * @param   *db     A pointer for debug information.
1417  * @param   *irg    The IR graph the node  belongs to.
1418  * @param   *block  The IR block the node belongs to.
1419  * @param   *store  The current memory state.
1420  * @param   *callee A pointer to the called procedure.
1421  * @param   arity   The number of procedure parameters.
1422  * @param   *in[]   An array with the procedure parameters. The constructor copies this array.
1423  * @param   *tp     Type information of the procedure called.
1424  */
1425 ir_node *new_rd_Call   (dbg_info *db, ir_graph *irg, ir_node *block, ir_node *store,
1426                                     ir_node *callee, int arity, ir_node *in[], ir_type *tp);
1427
1428 /** Constructor for a Add node.
1429  *
1430  * @param   *db    A pointer for debug information.
1431  * @param   *irg   The IR graph the node  belongs to.
1432  * @param   *block The IR block the node belongs to.
1433  * @param   *op1   The first operand.
1434  * @param   *op2   The second operand.
1435  * @param   *mode  The mode of the operands and the result.
1436  */
1437 ir_node *new_rd_Add    (dbg_info *db, ir_graph *irg, ir_node *block,
1438                                     ir_node *op1, ir_node *op2, ir_mode *mode);
1439
1440 /** Constructor for a Sub node.
1441  *
1442  * @param   *db    A pointer for debug information.
1443  * @param   *irg   The IR graph the node  belongs to.
1444  * @param   *block The IR block the node belongs to.
1445  * @param   *op1   The first operand.
1446  * @param   *op2   The second operand.
1447  * @param   *mode  The mode of the operands and the result.
1448  */
1449 ir_node *new_rd_Sub    (dbg_info *db, ir_graph *irg, ir_node *block,
1450                                     ir_node *op1, ir_node *op2, ir_mode *mode);
1451
1452 /** Constructor for a Minus node.
1453  *
1454  * @param   *db    A pointer for debug information.
1455  * @param   *irg   The IR graph the node  belongs to.
1456  * @param   *block The IR block the node belongs to.
1457  * @param   *op    The operand .
1458  * @param   *mode  The mode of the operand and the result.
1459  */
1460 ir_node *new_rd_Minus  (dbg_info *db, ir_graph *irg, ir_node *block,
1461                         ir_node *op,  ir_mode *mode);
1462
1463 /** Constructor for a Mul node.
1464  *
1465  * @param   *db    A pointer for debug information.
1466  * @param   *irg   The IR graph the node  belongs to.
1467  * @param   *block The IR block the node belongs to.
1468  * @param   *op1   The first operand.
1469  * @param   *op2   The second operand.
1470  * @param   *mode  The mode of the operands and the result.
1471  */
1472 ir_node *new_rd_Mul    (dbg_info *db, ir_graph *irg, ir_node *block,
1473                ir_node *op1, ir_node *op2, ir_mode *mode);
1474
1475 /** Constructor for a Mulh node.
1476  *
1477  * @param   *db    A pointer for debug information.
1478  * @param   *irg   The IR graph the node  belongs to.
1479  * @param   *block The IR block the node belongs to.
1480  * @param   *op1   The first operand.
1481  * @param   *op2   The second operand.
1482  * @param   *mode  The mode of the operands and the result.
1483  */
1484 ir_node *new_rd_Mulh   (dbg_info *db, ir_graph *irg, ir_node *block,
1485                ir_node *op1, ir_node *op2, ir_mode *mode);
1486
1487 /** Constructor for a Quot node.
1488  *
1489  * @param   *db    A pointer for debug information.
1490  * @param   *irg   The IR graph the node  belongs to.
1491  * @param   *block The IR block the node belongs to.
1492  * @param   *memop The store needed to model exceptions
1493  * @param   *op1   The first operand.
1494  * @param   *op2   The second operand.
1495  * @param   *mode  The mode of the result.
1496  * @param   state  The pinned state.
1497  */
1498 ir_node *new_rd_Quot   (dbg_info *db, ir_graph *irg, ir_node *block,
1499                ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state);
1500
1501 /** Constructor for a DivMod node.
1502  *
1503  * @param   *db    A pointer for debug information.
1504  * @param   *irg   The IR graph the node  belongs to.
1505  * @param   *block The IR block the node belongs to.
1506  * @param   *memop The store needed to model exceptions
1507  * @param   *op1   The first operand.
1508  * @param   *op2   The second operand.
1509  * @param   *mode  The mode of the results.
1510  * @param   state  The pinned state.
1511  */
1512 ir_node *new_rd_DivMod (dbg_info *db, ir_graph *irg, ir_node *block,
1513                ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state);
1514
1515 /** Constructor for a Div node.
1516  *
1517  * @param   *db    A pointer for debug information.
1518  * @param   *irg   The IR graph the node  belongs to.
1519  * @param   *block The IR block the node belongs to.
1520  * @param   *memop The store needed to model exceptions
1521  * @param   *op1   The first operand.
1522  * @param   *op2   The second operand.
1523  * @param   *mode  The mode of the result.
1524  * @param   state  The pinned state.
1525  */
1526 ir_node *new_rd_Div    (dbg_info *db, ir_graph *irg, ir_node *block,
1527                ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state);
1528
1529 /** Constructor for a remainderless Div node.
1530  *
1531  * @param   *db    A pointer for debug information.
1532  * @param   *irg   The IR graph the node  belongs to.
1533  * @param   *block The IR block the node belongs to.
1534  * @param   *memop The store needed to model exceptions
1535  * @param   *op1   The first operand.
1536  * @param   *op2   The second operand.
1537  * @param   *mode  The mode of the result.
1538  * @param   state  The pinned state.
1539  */
1540 ir_node *new_rd_DivRL  (dbg_info *db, ir_graph *irg, ir_node *block,
1541                ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state);
1542
1543 /** Constructor for a Mod node.
1544  *
1545  * @param   *db    A pointer for debug information.
1546  * @param   *irg   The IR graph the node  belongs to.
1547  * @param   *block The IR block the node belongs to.
1548  * @param   *memop The store needed to model exceptions
1549  * @param   *op1   The first operand.
1550  * @param   *op2   The second operand.
1551  * @param   *mode  The mode of the result.
1552  * @param   state  The pinned state.
1553  */
1554 ir_node *new_rd_Mod    (dbg_info *db, ir_graph *irg, ir_node *block,
1555                         ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state);
1556
1557 /** Constructor for a Abs node.
1558  *
1559  * @param   *db    A pointer for debug information.
1560  * @param   *irg   The IR graph the node  belongs to.
1561  * @param   *block The IR block the node belongs to.
1562  * @param   *op    The operand
1563  * @param   *mode  The mode of the operands and the result.
1564  */
1565 ir_node *new_rd_Abs    (dbg_info *db, ir_graph *irg, ir_node *block,
1566                        ir_node *op, ir_mode *mode);
1567
1568 /** Constructor for a And node.
1569  *
1570  * @param   *db    A pointer for debug information.
1571  * @param   *irg   The IR graph the node  belongs to.
1572  * @param   *block The IR block the node belongs to.
1573  * @param   *op1   The first operand.
1574  * @param   *op2   The second operand.
1575  * @param   *mode  The mode of the operands and the result.
1576  */
1577 ir_node *new_rd_And    (dbg_info *db, ir_graph *irg, ir_node *block,
1578                         ir_node *op1, ir_node *op2, ir_mode *mode);
1579
1580 /** Constructor for a Or node.
1581  *
1582  * @param   *db    A pointer for debug information.
1583  * @param   *irg   The IR graph the node  belongs to.
1584  * @param   *block The IR block the node belongs to.
1585  * @param   *op1   The first operand.
1586  * @param   *op2   The second operand.
1587  * @param   *mode  The mode of the operands and the result.
1588  */
1589 ir_node *new_rd_Or     (dbg_info *db, ir_graph *irg, ir_node *block,
1590                         ir_node *op1, ir_node *op2, ir_mode *mode);
1591
1592 /** Constructor for a Eor node.
1593  *
1594  * @param   *db    A pointer for debug information.
1595  * @param   *irg   The IR graph the node  belongs to.
1596  * @param   *block The IR block the node belongs to.
1597  * @param   *op1   The first operand.
1598  * @param   *op2   The second operand.
1599  * @param   *mode  The mode of the operands and the results.
1600  */
1601 ir_node *new_rd_Eor    (dbg_info *db, ir_graph *irg, ir_node *block,
1602                         ir_node *op1, ir_node *op2, ir_mode *mode);
1603
1604 /** Constructor for a Not node.
1605  *
1606  * @param   *db    A pointer for debug information.
1607  * @param   *irg   The IR graph the node  belongs to.
1608  * @param   *block The IR block the node belongs to.
1609  * @param   *op    The operand.
1610  * @param   *mode  The mode of the operand and the result.
1611  */
1612 ir_node *new_rd_Not    (dbg_info *db, ir_graph *irg, ir_node *block,
1613                ir_node *op, ir_mode *mode);
1614
1615 /** Constructor for a Cmp node.
1616  *
1617  * @param   *db    A pointer for debug information.
1618  * @param   *irg   The IR graph the node  belongs to.
1619  * @param   *block The IR block the node belongs to.
1620  * @param   *op1   The first operand.
1621  * @param   *op2   The second operand.
1622  */
1623 ir_node *new_rd_Cmp    (dbg_info *db, ir_graph *irg, ir_node *block,
1624                ir_node *op1, ir_node *op2);
1625
1626 /** Constructor for a Shl node.
1627  *
1628  * @param   *db    A pointer for debug information.
1629  * @param   *irg   The IR graph the node  belongs to.
1630  * @param   *block The IR block the node belongs to.
1631  * @param   *op    The operand.
1632  * @param   *k     The number of bits to  shift the operand .
1633  * @param   *mode  The mode of the operand and the result.
1634  */
1635 ir_node *new_rd_Shl    (dbg_info *db, ir_graph *irg, ir_node *block,
1636                ir_node *op, ir_node *k, ir_mode *mode);
1637
1638 /** Constructor for a Shr node.
1639  *
1640  * @param   *db    A pointer for debug information.
1641  * @param   *irg   The IR graph the node  belongs to.
1642  * @param   *block The IR block the node belongs to.
1643  * @param   *op    The operand.
1644  * @param   *k     The number of bits to shift the operand .
1645  * @param   *mode  The mode of the operand and the result.
1646  */
1647 ir_node *new_rd_Shr    (dbg_info *db, ir_graph *irg, ir_node *block,
1648                ir_node *op, ir_node *k, ir_mode *mode);
1649
1650 /** Constructor for a Shrs node.
1651  *
1652  * @param   *db    A pointer for debug information.
1653  * @param   *irg   The IR graph the node  belongs to.
1654  * @param   *block The IR block the node belongs to.
1655  * @param   *op    The operand.
1656  * @param   *k     The number of bits to shift the operand.
1657  * @param   *mode  The mode of the operand and the result.
1658  */
1659 ir_node *new_rd_Shrs   (dbg_info *db, ir_graph *irg, ir_node *block,
1660                ir_node *op, ir_node *k, ir_mode *mode);
1661
1662 /** Constructor for a Rotl node.
1663  *
1664  * @param   *db    A pointer for debug information.
1665  * @param   *irg   The IR graph the node  belongs to.
1666  * @param   *block The IR block the node belongs to.
1667  * @param   *op    The operand.
1668  * @param   *k     The number of bits to rotate the operand.
1669  * @param   *mode  The mode of the operand.
1670  */
1671 ir_node *new_rd_Rotl    (dbg_info *db, ir_graph *irg, ir_node *block,
1672                ir_node *op, ir_node *k, ir_mode *mode);
1673
1674
1675 /** Constructor for a Conv node.
1676  *
1677  * @param   *db    A pointer for debug information.
1678  * @param   *irg   The IR graph the node  belongs to.
1679  * @param   *block The IR block the node belongs to.
1680  * @param   *op    The operand.
1681  * @param   *mode  The mode of this the operand muss be converted .
1682  */
1683 ir_node *new_rd_Conv   (dbg_info *db, ir_graph *irg, ir_node *block,
1684                ir_node *op, ir_mode *mode);
1685
1686 /** Constructor for a Cast node.
1687  *
1688  * High level type cast.
1689  *
1690  * @param   *db    A pointer for debug information.
1691  * @param   *irg   The IR graph the node  belongs to.
1692  * @param   *block The IR block the node belongs to.
1693  * @param   *op    The operand.
1694  * @param   *to_tp The type of this the operand muss be casted .
1695  */
1696 ir_node *new_rd_Cast   (dbg_info *db, ir_graph *irg, ir_node *block,
1697                         ir_node *op, ir_type *to_tp);
1698
1699 /** Constructor for a Carry node.
1700  *
1701  * @param   *db    A pointer for debug information.
1702  * @param   *irg   The IR graph the node  belongs to.
1703  * @param   *block The IR block the node belongs to.
1704  * @param   *op1   The first operand.
1705  * @param   *op2   The second operand.
1706  * @param   *mode  The mode of the operands and the result.
1707  */
1708 ir_node *new_rd_Carry  (dbg_info *db, ir_graph *irg, ir_node *block,
1709                         ir_node *op1, ir_node *op2, ir_mode *mode);
1710
1711 /** Constructor for a Borrow node.
1712  *
1713  * @param   *db    A pointer for debug information.
1714  * @param   *irg   The IR graph the node  belongs to.
1715  * @param   *block The IR block the node belongs to.
1716  * @param   *op1   The first operand.
1717  * @param   *op2   The second operand.
1718  * @param   *mode  The mode of the operands and the result.
1719  */
1720 ir_node *new_rd_Borrow (dbg_info *db, ir_graph *irg, ir_node *block,
1721                         ir_node *op1, ir_node *op2, ir_mode *mode);
1722
1723 /** Constructor for a Phi node.
1724  *
1725  * @param *db    A pointer for debug information.
1726  * @param *irg   The IR graph the node  belongs to.
1727  * @param *block The IR block the node belongs to.
1728  * @param arity  The number of predecessors
1729  * @param *in[]  Array with predecessors.  The constructor copies this array.
1730  * @param *mode  The mode of it's inputs and output.
1731  */
1732 ir_node *new_rd_Phi    (dbg_info *db, ir_graph *irg, ir_node *block, int arity,
1733                         ir_node *in[], ir_mode *mode);
1734
1735 /** Constructor for a Load node.
1736  *
1737  * @param *db    A pointer for debug information.
1738  * @param *irg   The IR graph the node  belongs to.
1739  * @param *block The IR block the node belongs to.
1740  * @param *store The current memory
1741  * @param *adr   A pointer to the variable to be read in this memory.
1742  * @param *mode  The mode of the value to be loaded.
1743  */
1744 ir_node *new_rd_Load   (dbg_info *db, ir_graph *irg, ir_node *block,
1745                         ir_node *store, ir_node *adr, ir_mode *mode);
1746
1747 /** Constructor for a Store node.
1748  *
1749  * @param *db    A pointer for debug information.
1750  * @param *irg   The IR graph the node  belongs to.
1751  * @param *block The IR block the node belongs to.
1752  * @param *store The current memory
1753  * @param *adr   A pointer to the variable to be read in this memory.
1754  * @param *val   The value to write to this variable.
1755  */
1756 ir_node *new_rd_Store  (dbg_info *db, ir_graph *irg, ir_node *block,
1757                ir_node *store, ir_node *adr, ir_node *val);
1758
1759 /** Constructor for a Alloc node.
1760  *
1761  * The Alloc node extends the memory by space for an entity of type alloc_type.
1762  *
1763  * @param *db         A pointer for debug information.
1764  * @param *irg        The IR graph the node  belongs to.
1765  * @param *block      The IR block the node belongs to.
1766  * @param *store      The memory which shall contain the new variable.
1767  * @param *size       The number of bytes to allocate.
1768  * @param *alloc_type The type of the allocated variable.
1769  * @param where       Where to allocate the variable, either heap_alloc or stack_alloc.
1770  */
1771 ir_node *new_rd_Alloc  (dbg_info *db, ir_graph *irg, ir_node *block, ir_node *store,
1772                ir_node *size, ir_type *alloc_type, ir_where_alloc where);
1773
1774 /** Constructor for a Free node.
1775  *
1776  * Frees the memory occupied by the entity pointed to by the pointer
1777  * arg.  Type indicates the type of the entity the argument points to.
1778  *
1779  * @param *db         A pointer for debug information.
1780  * @param *irg        The IR graph the node  belongs to.
1781  * @param *block      The IR block the node belongs to.
1782  * @param *store      The memory which shall contain the new variable.
1783  * @param *ptr        The pointer to the object to free.
1784  * @param *size       The number of objects of type free_type to free in a sequence.
1785  * @param *free_type  The type of the freed variable.
1786  * @param where       Where the variable was allocated, either heap_alloc or stack_alloc.
1787  */
1788 ir_node *new_rd_Free   (dbg_info *db, ir_graph *irg, ir_node *block, ir_node *store,
1789                         ir_node *ptr, ir_node *size, ir_type *free_type, ir_where_alloc where);
1790
1791 /** Constructor for a Sync node.
1792  *
1793  * Merges several memory values.  The node assumes that a variable
1794  * either occurs only in one of the memories, or it contains the same
1795  * value in all memories where it occurs.
1796  *
1797  * @param *db       A pointer for debug information.
1798  * @param *irg      The IR graph the node  belongs to.
1799  * @param *block    The IR block the node belongs to.
1800  * @param  arity    The number of memories to synchronize.
1801  * @param  *in[]    An array of pointers to nodes that produce an output of type
1802  *                  memory.  The constructor copies this array.
1803  */
1804 ir_node *new_rd_Sync   (dbg_info *db, ir_graph *irg, ir_node *block, int arity, ir_node *in[]);
1805
1806 /** Constructor for a Proj node.
1807  *
1808  * Projects a single value out of a tuple.  The parameter proj gives the
1809  * position of the value within the tuple.
1810  *
1811  * @param *db    A pointer for debug information.
1812  * @param *irg   The IR graph the node  belongs to.
1813  * @param *block The IR block the node belongs to.
1814  * @param arg    A node producing a tuple.  The node must have mode_T.
1815  * @param *mode  The mode of the value to project.
1816  * @param proj   The position of the value in the tuple.
1817  */
1818 ir_node *new_rd_Proj   (dbg_info *db, ir_graph *irg, ir_node *block, ir_node *arg,
1819                         ir_mode *mode, long proj);
1820
1821 /** Constructor for a defaultProj node.
1822  *
1823  * Represents the default control flow of a Switch-Cond node.
1824  *
1825  * @param *db       A pointer for debug information.
1826  * @param *irg      The IR graph the node  belongs to.
1827  * @param *block    The IR block the node belongs to.
1828  * @param arg       A node producing a tuple.
1829  * @param max_proj  The end position of the value in the tuple.
1830  */
1831 ir_node *new_rd_defaultProj (dbg_info *db, ir_graph *irg, ir_node *block, ir_node *arg,
1832                              long max_proj);
1833
1834 /** Constructor for a Tuple node.
1835  *
1836  * This is an auxiliary node to replace a node that returns a tuple
1837  * without changing the corresponding Proj nodes.
1838  *
1839  * @param *db     A pointer for debug information.
1840  * @param *irg    The IR graph the node  belongs to.
1841  * @param *block  The IR block the node belongs to.
1842  * @param arity   The number of tuple elements.
1843  * @param *in[]   An array containing pointers to the nodes producing the tuple
1844  *                elements. The constructor copies this array.
1845  */
1846 ir_node *new_rd_Tuple  (dbg_info *db, ir_graph *irg, ir_node *block,
1847                         int arity, ir_node *in[]);
1848
1849 /** Constructor for a Id node.
1850  *
1851  * This is an auxiliary node to replace a node that returns a single
1852  * value.
1853  *
1854  * @param *db     A pointer for debug information.
1855  * @param *irg    The IR graph the node  belongs to.
1856  * @param *block  The IR block the node belongs to.
1857  * @param *val    The value
1858  * @param *mode   The mode of *val.
1859  */
1860 ir_node *new_rd_Id     (dbg_info *db, ir_graph *irg, ir_node *block,
1861                         ir_node *val, ir_mode *mode);
1862
1863 /** Constructor for a Confirm node.
1864  *
1865  * Specifies constraints for a value.  To support dataflow analyses.
1866  *
1867  * Example: If the value never exceeds '100' this is expressed by placing a
1868  * Confirm node val = new_d_Confirm(db, val, 100, '<=') on the dataflow edge.
1869  *
1870  * @param *irg    The IR graph the node belong to.
1871  * @param *block  The IR block the node belong to.
1872  * @param *db     A pointer for debug information.
1873  * @param *val    The value we express a constraint for
1874  * @param *bound  The value to compare against. Must be a firm node, typically a constant.
1875  * @param cmp     The compare operation.
1876  */
1877 ir_node *new_rd_Confirm (dbg_info *db, ir_graph *irg, ir_node *block,
1878              ir_node *val, ir_node *bound, pn_Cmp cmp);
1879
1880 /** Constructor for an Unknown node.
1881  *
1882  * Represents an arbitrary value.  Places the node in the start block.
1883  *
1884  * @param *irg    The IR graph the node  belongs to.
1885  * @param *m      The mode of the unknown value.
1886  */
1887 ir_node *new_rd_Unknown(ir_graph *irg, ir_mode *m);
1888
1889 /** Constructor for a CallBegin node.
1890  *
1891  * CallBegin represents control flow depending of the pointer value
1892  * representing the called method to the called methods.  The
1893  * constructor copies the method pointer input from the passed Call
1894  * node.
1895  *
1896  * @param *db     A pointer for debug information.
1897  * @param *irg    The IR graph the node belong to.
1898  * @param *block  The block the node belong to.
1899  * @param *callee The call node visible in the intra procedural view.
1900  */
1901 ir_node *new_rd_CallBegin(dbg_info *db, ir_graph *irg, ir_node *block, ir_node *callee);
1902
1903 /** Constructor for a EndReg node.
1904  *
1905  * Used to represent regular procedure end in interprocedual view.
1906  *
1907  * @param *db     A pointer for debug information.
1908  * @param *irg    The IR graph the node belong to.
1909  * @param *block  The block the node belong to.
1910  */
1911 ir_node *new_rd_EndReg (dbg_info *db, ir_graph *irg, ir_node *block);
1912
1913 /** Constructor for a EndExcept node.
1914  *
1915  * Used to represent exceptional procedure end in interprocedural view.
1916  *
1917  * @param *db     A pointer for debug information.
1918  * @param *irg    The IR graph the node belong to.
1919  * @param *block  The block the node belong to.
1920  */
1921 ir_node *new_rd_EndExcept(dbg_info *db, ir_graph *irg, ir_node *block);
1922
1923 /** Constructor for a Filter node.
1924  *
1925  * Adds the node to the block in current_ir_block.  Filter is a node
1926  * with two views used to construct the interprocedural view.  In
1927  * intraprocedural view its semantics are identical to the Proj node.
1928  * In interprocedural view the Filter performs the Phi operation on
1929  * method parameters or results.  Other than a Phi a Filter node may
1930  * not be removed if it has only a single input.
1931  *
1932  * The constructor builds the Filter in intraprocedural view.
1933  *
1934  * @param *db     A pointer for debug information.
1935  * @param *irg    The IR graph the node belong to.
1936  * @param *block  The block the node belong to.
1937  * @param *arg  The tuple value to project from.
1938  * @param *mode The mode of the projected value.
1939  * @param proj  The position in the tuple to project from.
1940  */
1941 ir_node *new_rd_Filter (dbg_info *db, ir_graph *irg, ir_node *block, ir_node *arg,
1942                         ir_mode *mode, long proj);
1943
1944 /** Constructor for a Mux node.
1945  *
1946  * @param *db       A pointer for debug information.
1947  * @param *irg      The IR graph the node belong to.
1948  * @param *block    The block the node belong to.
1949  * @param *sel      The ir_node that calculates the boolean select.
1950  * @param *ir_true  The ir_node that calculates the true result.
1951  * @param *ir_false The ir_node that calculates the false result.
1952  * @param *mode     The mode of the node (and it_true and ir_false).
1953  */
1954 ir_node *new_rd_Mux  (dbg_info *db, ir_graph *irg, ir_node *block,
1955     ir_node *sel, ir_node *ir_false, ir_node *ir_true, ir_mode *mode);
1956
1957 /** Constructor for a CopyB node.
1958  *
1959  * @param *db         A pointer for debug information.
1960  * @param *irg        The IR graph the node belong to.
1961  * @param *block      The block the node belong to.
1962  * @param *store      The current memory
1963  * @param *dst        The ir_node that represents the destination address.
1964  * @param *src        The ir_node that represents the source address.
1965  * @param *data_type  The type of the copied data
1966  */
1967 ir_node *new_rd_CopyB(dbg_info *db, ir_graph *irg, ir_node *block,
1968     ir_node *store, ir_node *dst, ir_node *src, ir_type *data_type);
1969
1970 /** Constructor for a InstOf node.
1971  *
1972  * A High-Level Type check.
1973  *
1974  * @param   *db        A pointer for debug information.
1975  * @param   *irg       The IR graph the node  belongs to.
1976  * @param   *block     The IR block the node belongs to.
1977  * @param   *store     The memory in which the object the entity should be selected
1978  *                     from is allocated.
1979  * @param   *objptr    A pointer to a object of a class type.
1980  * @param   *type      The type of which objptr must be.
1981  */
1982 ir_node *new_rd_InstOf (dbg_info *db, ir_graph *irg, ir_node *block, ir_node *store,
1983                         ir_node *objptr, ir_type *type);
1984
1985 /** Constructor for a Raise node.
1986  *
1987  * A High-Level Exception throw.
1988  *
1989  * @param *db    A pointer for debug information.
1990  * @param *irg   The IR graph the node  belongs to.
1991  * @param *block The IR block the node belongs to.
1992  * @param *store The current memory.
1993  * @param *obj   A pointer to the Except variable.
1994  */
1995 ir_node *new_rd_Raise  (dbg_info *db, ir_graph *irg, ir_node *block,
1996                         ir_node *store, ir_node *obj);
1997
1998 /** Constructor for a Bound node.
1999  *
2000  * A High-Level bounds check. Checks whether lower <= idx && idx < upper.
2001  *
2002  * @param *db         A pointer for debug information.
2003  * @param *irg        The IR graph the node belong to.
2004  * @param *block      The block the node belong to.
2005  * @param *store      The current memory.
2006  * @param *idx        The ir_node that represents an index.
2007  * @param *lower      The ir_node that represents the lower bound for the index.
2008  * @param *upper      The ir_node that represents the upper bound for the index.
2009  */
2010 ir_node *new_rd_Bound(dbg_info *db, ir_graph *irg, ir_node *block,
2011     ir_node *store, ir_node *idx, ir_node *lower, ir_node *upper);
2012
2013 /** Constructor for a Pin node.
2014  *
2015  * @param *db         A pointer for debug information.
2016  * @param *irg        The IR graph the node belong to.
2017  * @param *block      The block the node belong to.
2018  * @param *node       The node which value should be pinned.
2019  */
2020 ir_node *new_rd_Pin(dbg_info *db, ir_graph *irg, ir_node *block, ir_node *node);
2021
2022 /** Constructor for an ASM pseudo node.
2023  *
2024  * @param *db         A pointer for debug information.
2025  * @param *irg        The IR graph the node belong to.
2026  * @param *block      The block the node belong to.
2027  * @param arity       The number of data inputs to the node.
2028  * @param *in         The array of length arity of data inputs.
2029  * @param *inputs     The array of length arity of input constraints.
2030  * @param n_outs      The number of data outputs to the node.
2031  * @param *outputs    The array of length n_outs of output constraints.
2032  * @param n_clobber   The number of clobbered registers.
2033  * @param *clobber    The array of length n_clobber of clobbered registers.
2034  * @param *asm_text   The assembler text.
2035  */
2036 ir_node *new_rd_ASM(dbg_info *db, ir_graph *irg, ir_node *block,
2037                     int arity, ir_node *in[], ir_asm_constraint *inputs,
2038                     int n_outs, ir_asm_constraint *outputs,
2039                     int n_clobber, ident *clobber[], ident *asm_text);
2040
2041 /*-------------------------------------------------------------------------*/
2042 /* The raw interface without debug support                                 */
2043 /*-------------------------------------------------------------------------*/
2044
2045 /** Constructor for a Block node.
2046  *
2047  * Constructs a mature block with the given predecessors.  Use Unknown
2048  * nodes as predecessors to construct a block if the number of
2049  * predecessors is known, but not the predecessors themselves.  This
2050  * constructor does not set current_block.  It not be used with
2051  * automatic Phi node construction.
2052  *
2053  *
2054  * @param irg    The IR graph the block belongs to.
2055  * @param arity  The number of control predecessors.
2056  * @param in[]   An array of control predecessors.  The length of
2057  *               the array must be 'arity'. The constructor copies this array.
2058  */
2059 ir_node *new_r_Block  (ir_graph *irg,  int arity, ir_node *in[]);
2060
2061 /** Constructor for a Start node.
2062  *
2063  * @param *irg   The IR graph the node belongs to.
2064  * @param *block The IR block the node belongs to.
2065  */
2066 ir_node *new_r_Start  (ir_graph *irg, ir_node *block);
2067
2068 /** Constructor for a End node.
2069  *
2070  * @param *irg   The IR graph the node  belongs to.
2071  * @param *block The IR block the node belongs to.
2072  */
2073 ir_node *new_r_End    (ir_graph *irg, ir_node *block);
2074
2075 /** Constructor for a Jmp node.
2076  *
2077  * Jmp represents control flow to a single control successor.
2078  *
2079  * @param *irg    The IR graph the node belongs to.
2080  * @param *block  The IR block the node belongs to.
2081  */
2082 ir_node *new_r_Jmp    (ir_graph *irg, ir_node *block);
2083
2084 /** Constructor for an IJmp node.
2085  *
2086  * IJmp represents control flow to a single control successor not
2087  * statically known i.e. an indirect Jmp.
2088  *
2089  * @param *irg    The IR graph the node belongs to.
2090  * @param *block  The IR block the node belongs to.
2091  * @param *tgt    The IR node representing the target address.
2092  */
2093 ir_node *new_r_IJmp   (ir_graph *irg, ir_node *block, ir_node *tgt);
2094
2095 /** Constructor for a Cond node.
2096  *
2097  * If c is mode_b represents a conditional branch (if/else). If c is
2098  * mode_Is/mode_Iu (?) represents a switch.  (Allocates dense Cond
2099  * node, default Proj is 0.)
2100  *
2101  * This is not consistent:  Input to Cond is Is, Proj has as proj number
2102  * longs.
2103  *
2104  * @param *irg   The IR graph the node  belongs to.
2105  * @param *block The IR block the node belongs to.
2106  * @param *c     The conditions parameter.Can be of mode b or I_u.
2107  */
2108 ir_node *new_r_Cond   (ir_graph *irg, ir_node *block, ir_node *c);
2109
2110 /** Constructor for a Return node.
2111  *
2112  * Returns the memory and zero or more return values.  Only node that
2113  * can end regular control flow.
2114  *
2115  * @param *irg   The IR graph the node  belongs to.
2116  * @param *block The IR block the node belongs to.
2117  * @param *store The state of memory.
2118  * @param arity  Number of array indices.
2119  * @param *in[]   Array with index inputs to the node. The constructor copies this array.
2120  */
2121 ir_node *new_r_Return (ir_graph *irg, ir_node *block,
2122                        ir_node *store, int arity, ir_node *in[]);
2123
2124 /** Constructor for a Const node.
2125  *
2126  * Adds the node to the start block.
2127  *
2128  * Constructor for a Const node. The constant represents a target
2129  * value.  Sets the type information to type_unknown.  (No more
2130  * supported: If tv is entity derives a somehow useful type.)
2131  * Derives mode from passed tarval.
2132  *
2133  * @param *irg   The IR graph the node  belongs to.
2134  * @param *block The IR block the node belongs to.
2135  * @param *con   Points to an entry in the constant table.
2136  */
2137 ir_node *new_r_Const  (ir_graph *irg, tarval *con);
2138
2139 /** Constructor for a Const node.
2140  *
2141  * Adds the node to the start block.
2142  *
2143  * Constructor for a Const node. The constant represents a target
2144  * value.  Sets the type information to type_unknown.  (No more
2145  * supported: If tv is entity derives a somehow useful type.)
2146  *
2147  * @param *irg   The IR graph the node  belongs to.
2148  * @param *mode  The mode of the operands and the results.
2149  * @param value  A value from which the tarval is made.
2150  */
2151 ir_node *new_r_Const_long(ir_graph *irg,
2152                        ir_mode *mode, long value);
2153
2154 /** Constructor for a Const_type node.
2155  *
2156  * Adds the node to the start block.
2157  *
2158  * The constant represents a target value.  This constructor sets high
2159  * level type information for the constant value.
2160  * Derives mode from passed tarval.
2161  *
2162  * @param *irg   The IR graph the node  belongs to.
2163  * @param *con   Points to an entry in the constant table.
2164  * @param *tp    The type of the constant.
2165  */
2166 ir_node *new_r_Const_type(ir_graph *irg, tarval *con, ir_type *tp);
2167
2168 /** Constructor for a SymConst node.
2169  *
2170  *  This is the constructor for a symbolic constant.
2171  *    There are four kinds of symbolic constants:
2172  *    - type_tag  The symbolic constant represents a type tag.  The type the
2173  *                tag stands for is given explicitly.
2174  *    - size      The symbolic constant represents the size of a type.  The
2175  *                type of which the constant represents the size is given
2176  *                explicitly.
2177  *    - addr_name The symbolic constant represents the address of an entity
2178  *                (variable or method).  The variable is indicated by a name
2179  *                that is valid for linking.
2180  *    - addr_ent   The symbolic constant represents the address of an entity
2181  *                (variable or method).  The variable is given explicitly by
2182  *                a firm entity.
2183  *
2184  *    Inputs to the node:
2185  *      No inputs except the block it belongs to.
2186  *    Outputs of the node.
2187  *      An unsigned integer (I_u) or a pointer (P).
2188  *
2189  * @param *irg    The IR graph the node  belongs to.
2190  * @param *block  The IR block the node belongs to.
2191  * @param mode    The mode for the SymConst.
2192  * @param value   A type, entity or a ident depending on the SymConst kind.
2193  * @param symkind The kind of the symbolic constant: type_tag, size or link_info.
2194  */
2195 ir_node *new_r_SymConst(ir_graph *irg, ir_node *block, ir_mode *mode,
2196                         union symconst_symbol value, symconst_kind symkind);
2197
2198 /** Constructor for a simpleSel node.
2199  *
2200  *  This is a shortcut for the new_d_Sel() constructor.  To be used for
2201  *  Sel nodes that do not select from an array, i.e., have no index
2202  *  inputs.  It adds the two parameters 0, NULL.
2203  *
2204  * @param   *irg       The IR graph the node  belongs to.
2205  * @param   *block     The IR block the node belongs to.
2206  * @param   *store     The memory in which the object the entity should be selected
2207  *                     from is allocated.
2208  * @param   *objptr    The object from that the Sel operation selects a
2209  *                     single attribute out.
2210  * @param   *ent       The entity to select.
2211  */
2212 ir_node *new_r_simpleSel(ir_graph *irg, ir_node *block, ir_node *store,
2213                          ir_node *objptr, ir_entity *ent);
2214
2215 /** Constructor for a Sel node.
2216  *
2217  * The select node selects an entity (field or method) from an entity
2218  * with a compound type.  It explicitly specifies the entity selected.
2219  * Dynamically the node may select entities that overwrite the given
2220  * entity.  If the selected entity is an array element entity the Sel
2221  * node takes the required array indices as inputs.
2222  *
2223  * @param   *irg       The IR graph the node  belongs to.
2224  * @param   *block     The IR block the node belongs to.
2225  * @param   *store     The memory in which the object the entity should be selected
2226  *                     from is allocated.
2227  * @param   *objptr    A pointer to a compound entity the Sel operation selects a
2228  *                     single attribute from.
2229  * @param   *n_index   The number of array indices needed to select an array element entity.
2230  * @param   *index[]   If the compound entity is an array the indices of the selected
2231  *                     element entity.  The constructor copies this array.
2232  * @param   *ent       The entity to select.
2233  */
2234 ir_node *new_r_Sel    (ir_graph *irg, ir_node *block, ir_node *store,
2235                        ir_node *objptr, int n_index, ir_node *index[],
2236                ir_entity *ent);
2237
2238 /** Constructor for a Call node.
2239  *
2240  *  Represents all kinds of method and function calls.
2241  *
2242  * @param   *irg    The IR graph the node  belongs to.
2243  * @param   *block  The IR block the node belongs to.
2244  * @param   *store  The actual store.
2245  * @param   *callee A pointer to the called procedure.
2246  * @param   arity   The number of procedure parameters.
2247  * @param   *in[]   An array with the pointers to the parameters. The constructor copies this array.
2248  * @param   *tp     Type information of the procedure called.
2249  */
2250 ir_node *new_r_Call   (ir_graph *irg, ir_node *block, ir_node *store,
2251                ir_node *callee, int arity, ir_node *in[],
2252                ir_type *tp);
2253
2254 /** Constructor for a Add node.
2255  *
2256  * @param   *irg   The IR graph the node  belongs to.
2257  * @param   *block The IR block the node belongs to.
2258  * @param   *op1   The first operand.
2259  * @param   *op2   The second operand.
2260  * @param   *mode  The mode of the operands and the result.
2261  */
2262 ir_node *new_r_Add    (ir_graph *irg, ir_node *block,
2263                ir_node *op1, ir_node *op2, ir_mode *mode);
2264
2265 /**
2266  * Constructor for a Sub node.
2267  *
2268  * @param   *irg   The IR graph the node  belongs to.
2269  * @param   *block The IR block the node belongs to.
2270  * @param   *op1   The first operand.
2271  * @param   *op2   The second operand.
2272  * @param   *mode  The mode of the operands and the results.
2273  */
2274 ir_node *new_r_Sub    (ir_graph *irg, ir_node *block,
2275                ir_node *op1, ir_node *op2, ir_mode *mode);
2276
2277 /** Constructor for a Minus node.
2278  *
2279  * @param   *irg   The IR graph the node  belongs to.
2280  * @param   *block The IR block the node belongs to.
2281  * @param   *op   The operand.
2282  * @param   *mode  The mode of the operand and the result.
2283  */
2284 ir_node *new_r_Minus  (ir_graph *irg, ir_node *block,
2285                ir_node *op,  ir_mode *mode);
2286
2287 /** Constructor for a Mul node.
2288  *
2289  * @param   *irg   The IR graph the node  belongs to.
2290  * @param   *block The IR block the node belongs to.
2291  * @param   *op1   The first operand.
2292  * @param   *op2   The second operand.
2293  * @param   *mode  The mode of the operands and the result.
2294  */
2295 ir_node *new_r_Mul    (ir_graph *irg, ir_node *block,
2296                ir_node *op1, ir_node *op2, ir_mode *mode);
2297
2298 /** Constructor for a Mulh node.
2299  *
2300  * @param   *irg   The IR graph the node  belongs to.
2301  * @param   *block The IR block the node belongs to.
2302  * @param   *op1   The first operand.
2303  * @param   *op2   The second operand.
2304  * @param   *mode  The mode of the operands and the result.
2305  */
2306 ir_node *new_r_Mulh   (ir_graph *irg, ir_node *block,
2307                ir_node *op1, ir_node *op2, ir_mode *mode);
2308
2309 /** Constructor for a Quot node.
2310  *
2311  * @param   *irg   The IR graph the node  belongs to.
2312  * @param   *block The IR block the node belongs to.
2313  * @param   *memop The store needed to model exceptions
2314  * @param   *op1   The first operand.
2315  * @param   *op2   The second operand.
2316  * @param   *mode  The mode of the result.
2317  * @param   state  The pinned state.
2318  */
2319 ir_node *new_r_Quot   (ir_graph *irg, ir_node *block,
2320                ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state);
2321
2322 /** Constructor for a DivMod node.
2323  *
2324  * @param   *irg   The IR graph the node  belongs to.
2325  * @param   *block The IR block the node belongs to.
2326  * @param   *memop The store needed to model exceptions
2327  * @param   *op1   The first operand.
2328  * @param   *op2   The second operand.
2329  * @param   *mode  The mode of the results.
2330  * @param   state  The pinned state.
2331  */
2332 ir_node *new_r_DivMod (ir_graph *irg, ir_node *block,
2333                ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state);
2334
2335 /** Constructor for a Div node.
2336  *
2337  * @param   *irg   The IR graph the node  belongs to.
2338  * @param   *block The IR block the node belongs to.
2339  * @param   *memop The store needed to model exceptions
2340  * @param   *op1   The first operand.
2341  * @param   *op2   The second operand.
2342  * @param   *mode  The mode of the result.
2343  * @param   state  The pinned state.
2344  */
2345 ir_node *new_r_Div    (ir_graph *irg, ir_node *block,
2346                ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state);
2347
2348 /** Constructor for a remainderless Div node.
2349  *
2350  * @param   *irg   The IR graph the node  belongs to.
2351  * @param   *block The IR block the node belongs to.
2352  * @param   *memop The store needed to model exceptions
2353  * @param   *op1   The first operand.
2354  * @param   *op2   The second operand.
2355  * @param   *mode  The mode of the result.
2356  * @param   state  The pinned state.
2357  */
2358 ir_node *new_r_DivRL  (ir_graph *irg, ir_node *block,
2359                ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state);
2360
2361 /** Constructor for a Mod node.
2362  *
2363  * @param   *irg   The IR graph the node  belongs to.
2364  * @param   *block The IR block the node belongs to.
2365  * @param   *memop The store needed to model exceptions
2366  * @param   *op1   The first operand.
2367  * @param   *op2   The second operand.
2368  * @param   *mode  The mode of the result.
2369  * @param   state  The pinned state.
2370  */
2371 ir_node *new_r_Mod    (ir_graph *irg, ir_node *block,
2372                ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state);
2373
2374 /** Constructor for a Abs node.
2375  *
2376  * @param   *irg   The IR graph the node  belongs to.
2377  * @param   *block The IR block the node belongs to.
2378  * @param   *op    The operand
2379  * @param   *mode  The mode of the operands and the result.
2380  */
2381 ir_node *new_r_Abs    (ir_graph *irg, ir_node *block,
2382                        ir_node *op, ir_mode *mode);
2383
2384 /** Constructor for a And node.
2385  *
2386  * @param   *irg   The IR graph the node  belongs to.
2387  * @param   *block The IR block the node belongs to.
2388  * @param   *op1   The first operand.
2389  * @param   *op2   The second operand.
2390  * @param   *mode  The mode of the operands and the result.
2391  */
2392 ir_node *new_r_And    (ir_graph *irg, ir_node *block,
2393                ir_node *op1, ir_node *op2, ir_mode *mode);
2394
2395 /** Constructor for a Or node.
2396  *
2397  * @param   *irg   The IR graph the node  belongs to.
2398  * @param   *block The IR block the node belongs to.
2399  * @param   *op1   The first operand.
2400  * @param   *op2   The second operand.
2401  * @param   *mode  The mode of the operands and the result.
2402  */
2403 ir_node *new_r_Or     (ir_graph *irg, ir_node *block,
2404                ir_node *op1, ir_node *op2, ir_mode *mode);
2405
2406 /** Constructor for a Eor node.
2407  *
2408  * @param   *irg   The IR graph the node  belongs to.
2409  * @param   *block The IR block the node belongs to.
2410  * @param   *op1   The first operand.
2411  * @param   *op2   The second operand.
2412  * @param   *mode  The mode of the operands and the results.
2413  */
2414 ir_node *new_r_Eor    (ir_graph *irg, ir_node *block,
2415                ir_node *op1, ir_node *op2, ir_mode *mode);
2416
2417 /** Constructor for a Not node.
2418  *
2419  * @param   *irg   The IR graph the node  belongs to.
2420  * @param   *block The IR block the node belongs to.
2421  * @param   *op    The operand.
2422  * @param   *mode  The mode of the operand and the result.
2423  */
2424 ir_node *new_r_Not    (ir_graph *irg, ir_node *block,
2425                ir_node *op, ir_mode *mode);
2426
2427 /** Constructor for a Cmp node.
2428  *
2429  * @param   *irg   The IR graph the node  belongs to.
2430  * @param   *block The IR block the node belongs to.
2431  * @param   *op1   The first operand.
2432  * @param   *op2   The second operand.
2433  */
2434 ir_node *new_r_Cmp    (ir_graph *irg, ir_node *block,
2435                ir_node *op1, ir_node *op2);
2436
2437 /** Constructor for a Shl node.
2438  *
2439  * @param   *irg   The IR graph the node  belongs to.
2440  * @param   *block The IR block the node belongs to.
2441  * @param   *op    The operand.
2442  * @param   *k     The number of bits to  shift the operand .
2443  * @param   *mode  The mode of the operand and the result.
2444  */
2445 ir_node *new_r_Shl    (ir_graph *irg, ir_node *block,
2446                ir_node *op, ir_node *k, ir_mode *mode);
2447
2448 /** Constructor for a Shr node.
2449  *
2450  * @param   *irg   The IR graph the node  belongs to.
2451  * @param   *block The IR block the node belongs to.
2452  * @param   *op    The operand.
2453  * @param   *k     The number of bits to shift the operand .
2454  * @param   *mode  The mode of the operand and the result.
2455  */
2456 ir_node *new_r_Shr    (ir_graph *irg, ir_node *block,
2457                ir_node *op, ir_node *k, ir_mode *mode);
2458
2459 /**
2460  * Constructor for a Shrs node.
2461  *
2462  * @param   *irg   The IR graph the node  belongs to.
2463  * @param   *block The IR block the node belongs to.
2464  * @param   *op    The operand.
2465  * @param   *k     The number of bits to shift the operand.
2466  * @param   *mode  The mode of the operand and the result.
2467  */
2468 ir_node *new_r_Shrs   (ir_graph *irg, ir_node *block,
2469                ir_node *op, ir_node *k, ir_mode *mode);
2470
2471 /** Constructor for a Rotl node.
2472  *
2473  * @param   *irg   The IR graph the node  belongs to.
2474  * @param   *block The IR block the node belongs to.
2475  * @param   *op    The operand.
2476  * @param   *k     The number of bits to rotate the operand.
2477  * @param   *mode  The mode of the operand.
2478  */
2479 ir_node *new_r_Rotl   (ir_graph *irg, ir_node *block,
2480                ir_node *op, ir_node *k, ir_mode *mode);
2481
2482 /** Constructor for a Conv node.
2483  *
2484  * @param   *irg   The IR graph the node  belongs to.
2485  * @param   *block The IR block the node belongs to.
2486  * @param   *op    The operand.
2487  * @param   *mode  The mode of this the operand muss be converted .
2488  */
2489 ir_node *new_r_Conv   (ir_graph *irg, ir_node *block,
2490                ir_node *op, ir_mode *mode);
2491
2492 /** Constructor for a Cast node.
2493  *
2494  * High level type cast
2495  *
2496  * @param   *irg   The IR graph the node  belongs to.
2497  * @param   *block The IR block the node belongs to.
2498  * @param   *op    The operand.
2499  * @param   *to_tp The type of this the operand muss be casted .
2500  */
2501 ir_node *new_r_Cast   (ir_graph *irg, ir_node *block,
2502                ir_node *op, ir_type *to_tp);
2503
2504 /** Constructor for a Carry node.
2505  *
2506  * @param   *irg   The IR graph the node  belongs to.
2507  * @param   *block The IR block the node belongs to.
2508  * @param   *op1   The first operand.
2509  * @param   *op2   The second operand.
2510  * @param   *mode  The mode of the operands and the result.
2511  */
2512 ir_node *new_r_Carry  (ir_graph *irg, ir_node *block,
2513                ir_node *op1, ir_node *op2, ir_mode *mode);
2514
2515 /**
2516  * Constructor for a Borrow node.
2517  *
2518  * @param   *irg   The IR graph the node  belongs to.
2519  * @param   *block The IR block the node belongs to.
2520  * @param   *op1   The first operand.
2521  * @param   *op2   The second operand.
2522  * @param   *mode  The mode of the operands and the results.
2523  */
2524 ir_node *new_r_Borrow (ir_graph *irg, ir_node *block,
2525                ir_node *op1, ir_node *op2, ir_mode *mode);
2526
2527 /** Constructor for a Phi node.
2528  *
2529  * @param *irg   The IR graph the node  belongs to.
2530  * @param *block The IR block the node belongs to.
2531  * @param arity  The number of predecessors
2532  * @param *in[]    Array with predecessors. The constructor copies this array.
2533  * @param *mode  The mode of it's inputs and output.
2534  */
2535 ir_node *new_r_Phi    (ir_graph *irg, ir_node *block, int arity,
2536                        ir_node *in[], ir_mode *mode);
2537
2538 /** Constructor for a Load node.
2539  *
2540  * @param *irg   The IR graph the node  belongs to.
2541  * @param *block The IR block the node belongs to.
2542  * @param *store The current memory
2543  * @param *adr   A pointer to the variable to be read in this memory.
2544  * @param *mode  The mode of the value to be loaded.
2545  */
2546 ir_node *new_r_Load   (ir_graph *irg, ir_node *block,
2547                ir_node *store, ir_node *adr, ir_mode *mode);
2548
2549 /** Constructor for a Store node.
2550  *
2551  * @param *irg   The IR graph the node  belongs to.
2552  * @param *block The IR block the node belongs to.
2553  * @param *store The current memory
2554  * @param *adr   A pointer to the variable to be read in this memory.
2555  * @param *val   The value to write to this variable.
2556  */
2557 ir_node *new_r_Store  (ir_graph *irg, ir_node *block,
2558                        ir_node *store, ir_node *adr, ir_node *val);
2559
2560 /** Constructor for a Alloc node.
2561  *
2562  * The Alloc node extends the memory by space for an entity of type alloc_type.
2563  *
2564  * @param *irg        The IR graph the node  belongs to.
2565  * @param *block      The IR block the node belongs to.
2566  * @param *store      The memory which shall contain the new variable.
2567  * @param *size       The number of bytes to allocate.
2568  * @param *alloc_type The type of the allocated variable.
2569  * @param where       Where to allocate the variable, either heap_alloc or stack_alloc.
2570  */
2571 ir_node *new_r_Alloc  (ir_graph *irg, ir_node *block, ir_node *store,
2572                ir_node *size, ir_type *alloc_type, ir_where_alloc where);
2573
2574 /** Constructor for a Free node.
2575  *
2576  * Frees the memory occupied by the entity pointed to by the pointer
2577  * arg.  Type indicates the type of the entity the argument points to.
2578  *
2579  * @param *irg        The IR graph the node  belongs to.
2580  * @param *block      The IR block the node belongs to.
2581  * @param *store      The memory which shall contain the new variable.
2582  * @param *ptr        The pointer to the object to free.
2583  * @param *size       The number of objects of type free_type to free in a sequence.
2584  * @param *free_type  The type of the freed variable.
2585  * @param where       Where the variable was allocated, either heap_alloc or stack_alloc.
2586  */
2587 ir_node *new_r_Free   (ir_graph *irg, ir_node *block, ir_node *store,
2588                ir_node *ptr, ir_node *size, ir_type *free_type, ir_where_alloc where);
2589
2590 /** Constructor for a Sync node.
2591  *
2592  * Merges several memory values.  The node assumes that a variable
2593  * either occurs only in one of the memories, or it contains the same
2594  * value in all memories where it occurs.
2595  *
2596  * @param *irg      The IR graph the node  belongs to.
2597  * @param *block    The IR block the node belongs to.
2598  * @param  arity    The number of memories to synchronize.
2599  * @param  *in[]    An array of pointers to nodes that produce an output of  type memory.
2600  *                  The constructor copies this array.
2601  */
2602 ir_node *new_r_Sync (ir_graph *irg, ir_node *block, int arity, ir_node *in[]);
2603
2604 /** Constructor for a Proj node.
2605  *
2606  * Projects a single value out of a tuple.  The parameter proj gives the
2607  * position of the value within the tuple.
2608  *
2609  * @param *irg   The IR graph the node  belongs to.
2610  * @param *block The IR block the node belongs to.
2611  * @param arg    A node producing a tuple.
2612  * @param *mode  The mode of the value to project.
2613  * @param proj   The position of the value in the tuple.
2614  */
2615 ir_node *new_r_Proj   (ir_graph *irg, ir_node *block, ir_node *arg,
2616                        ir_mode *mode, long proj);
2617
2618 /** Constructor for a defaultProj node.
2619  *
2620  * Represents the default control flow of a Switch-Cond node.
2621  *
2622  * @param *irg      The IR graph the node  belongs to.
2623  * @param *block    The IR block the node belongs to.
2624  * @param arg       A node producing a tuple.
2625  * @param max_proj  The end  position of the value in the tuple.
2626  */
2627 ir_node *new_r_defaultProj (ir_graph *irg, ir_node *block, ir_node *arg, long max_proj);
2628
2629
2630 /** Constructor for a Tuple node.
2631  *
2632  * This is an auxiliary node to replace a node that returns a tuple
2633  * without changing the corresponding Proj nodes.
2634  *
2635  * @param *irg    The IR graph the node  belongs to.
2636  * @param *block  The IR block the node belongs to.
2637  * @param arity   The number of tuple elements.
2638  * @param *in[]   An array containing pointers to the nodes producing the tuple elements.
2639  *                The constructor copies this array.
2640  */
2641 ir_node *new_r_Tuple  (ir_graph *irg, ir_node *block, int arity, ir_node *in[]);
2642
2643 /** Constructor for a Id node.
2644  *
2645  * This is an auxiliary node to replace a node that returns a single
2646  * value.
2647  *
2648  * @param *irg    The IR graph the node  belongs to.
2649  * @param *block  The IR block the node belongs to.
2650  * @param *val    The operand to Id.
2651  * @param *mode   The mode of *val.
2652  */
2653 ir_node *new_r_Id     (ir_graph *irg, ir_node *block,
2654                ir_node *val, ir_mode *mode);
2655
2656 /** Constructor for a Bad node.
2657  *
2658  * Returns the unique Bad node of the graph.  The same as
2659  * get_irg_bad().
2660  *
2661  * @param *irg    The IR graph the node  belongs to.
2662  *
2663  */
2664 ir_node *new_r_Bad    (ir_graph *irg);
2665
2666 /** Constructor for a Confirm node.
2667  *
2668  * Specifies constraints for a value.  To support dataflow analyses.
2669  *
2670  * Example: If the value never exceeds '100' this is expressed by placing a
2671  * Confirm node val = new_d_Confirm(db, val, 100, '<=') on the dataflow edge.
2672  *
2673  * @param *irg    The IR graph the node belong to.
2674  * @param *block  The IR block the node belong to.
2675  * @param *val    The value we express a constraint for
2676  * @param *bound  The value to compare against. Must be a firm node, typically a constant.
2677  * @param cmp     The compare operation.
2678  */
2679 ir_node *new_r_Confirm(ir_graph *irg, ir_node *block,
2680             ir_node *val, ir_node *bound, pn_Cmp cmp);
2681
2682 /** Constructor for a Unknown node.
2683  *
2684  * Represents an arbitrary value.  Places the node in
2685  * the start block.
2686  *
2687  * @param *irg    The IR graph the node  belongs to.
2688  * @param *m      The mode of the unknown value.
2689  */
2690 ir_node *new_r_Unknown(ir_graph *irg, ir_mode *m);
2691
2692 /** Constructor for a CallBegin node.
2693  *
2694  * CallBegin represents control flow depending of the pointer value
2695  * representing the called method to the called methods.  The
2696  * constructor copies the method pointer input from the passed Call
2697  * node.
2698  *
2699  * @param *irg    The IR graph the node belong to.
2700  * @param *block  The block the node belong to.
2701  * @param *callee The call node visible in the  intra procedural view.
2702  */
2703 ir_node *new_r_CallBegin(ir_graph *irg, ir_node *block, ir_node *callee);
2704
2705 /** Constructor for a EndReg node.
2706  *
2707  * Used to represent regular procedure end in interprocedual view.
2708  *
2709  * @param *irg    The IR graph the node belong to.
2710  * @param *block  The block the node belong to.
2711  */
2712 ir_node *new_r_EndReg (ir_graph *irg, ir_node *block);
2713
2714 /** Constructor for a EndExcept node.
2715  *
2716  * Used to represent exceptional procedure end in interprocedural view.
2717  *
2718  * @param *irg    The IR graph the node belong to.
2719  * @param *block  The block the node belong to.
2720  */
2721 ir_node *new_r_EndExcept(ir_graph *irg, ir_node *block);
2722
2723 /** Constructor for a Break node.
2724  *
2725  * Break represents control flow to a single control successor just as Jmp.
2726  * The blocks separated by a break may not be concatenated by an optimization.
2727  * It is used for the interprocedural representation where blocks are parted
2728  * behind Call nodes to represent the control flow to called procedures.
2729  *
2730  * @param *irg    The IR graph the node belong to.
2731  * @param *block  The block the node belong to.
2732  */
2733 ir_node *new_r_Break  (ir_graph *irg, ir_node *block);
2734
2735 /** Constructor for a Filter node.
2736  *
2737  * Constructor for a Filter node. Adds the node to the block in current_ir_block.
2738  * Filter is a node with two views used to construct the interprocedural view.
2739  * In intraprocedural view its semantics are identical to the Proj node.
2740  * In interprocedural view the Filter performs the Phi operation on method
2741  * parameters or results.  Other than a Phi a Filter node may not be removed
2742  * if it has only a single input.
2743  *
2744  * The constructor builds the Filter in intraprocedural view.
2745  *
2746  * @param *irg    The IR graph the node belong to.
2747  * @param *block  The block the node belong to.
2748  * @param *arg  The tuple value to project from.
2749  * @param *mode The mode of the projected value.
2750  * @param proj  The position in the tuple to project from.
2751  */
2752 ir_node *new_r_Filter (ir_graph *irg, ir_node *block, ir_node *arg,
2753                ir_mode *mode, long proj);
2754
2755 /** Constructor for a NoMem node.
2756  *
2757  * Returns the unique NoMem node of the graph.  The same as
2758  * get_irg_no_mem().
2759  *
2760  * @param *irg    The IR graph the node belongs to.
2761  */
2762 ir_node *new_r_NoMem  (ir_graph *irg);
2763
2764 /** Constructor for a Mux node.
2765  *
2766  * @param *irg      The IR graph the node belong to.
2767  * @param *block    The block the node belong to.
2768  * @param *sel      The ir_node that calculates the boolean select.
2769  * @param *ir_true  The ir_node that calculates the true result.
2770  * @param *ir_false The ir_node that calculates the false result.
2771  * @param *mode     The mode of the node (and it_true and ir_false).
2772  */
2773 ir_node *new_r_Mux  (ir_graph *irg, ir_node *block,
2774     ir_node *sel, ir_node *ir_false, ir_node *ir_true, ir_mode *mode);
2775
2776 /** Constructor for a CopyB node.
2777  *
2778  * @param *irg        The IR graph the node belong to.
2779  * @param *block      The block the node belong to.
2780  * @param *store      The current memory
2781  * @param *dst        The ir_node that represents the destination address.
2782  * @param *src        The ir_node that represents the source address.
2783  * @param *data_type  The type of the copied data
2784  */
2785 ir_node *new_r_CopyB(ir_graph *irg, ir_node *block,
2786     ir_node *store, ir_node *dst, ir_node *src, ir_type *data_type);
2787
2788 /** Constructor for a InstOf node.
2789  *
2790  * A High-Level Type check.
2791  *
2792  * @param   *irg       The IR graph the node  belongs to.
2793  * @param   *block     The IR block the node belongs to.
2794  * @param   *store     The memory in which the object the entity should be selected
2795  *                     from is allocated.
2796  * @param   *objptr    A pointer to a object of a class type.
2797  * @param   *type      The type of which objptr must be.
2798  */
2799 ir_node *new_r_InstOf(ir_graph *irg, ir_node *block, ir_node *store,
2800                       ir_node *objptr, ir_type *type);
2801
2802 /** Constructor for a Raise node.
2803  *
2804  * A High-Level Exception throw.
2805  *
2806  * @param *irg   The IR graph the node  belongs to.
2807  * @param *block The IR block the node belongs to.
2808  * @param *store The current memory.
2809  * @param *obj   A pointer to the Except variable.
2810  */
2811 ir_node *new_r_Raise(ir_graph *irg, ir_node *block,
2812                      ir_node *store, ir_node *obj);
2813
2814 /** Constructor for a Bound node.
2815  *
2816  * A High-Level bounds check. Checks whether lower <= idx && idx < upper.
2817  *
2818  * @param *irg        The IR graph the node belong to.
2819  * @param *block      The block the node belong to.
2820  * @param *store      The current memory.
2821  * @param *idx        The ir_node that represents an index.
2822  * @param *lower      The ir_node that represents the lower bound for the index.
2823  * @param *upper      The ir_node that represents the upper bound for the index.
2824  */
2825 ir_node *new_r_Bound(ir_graph *irg, ir_node *block,
2826     ir_node *store, ir_node *idx, ir_node *lower, ir_node *upper);
2827
2828 /** Constructor for a Pin node.
2829  *
2830  * @param *irg        The IR graph the node belong to.
2831  * @param *block      The block the node belong to.
2832  * @param *node       The node which value should be pinned.
2833  */
2834 ir_node *new_r_Pin(ir_graph *irg, ir_node *block, ir_node *node);
2835
2836 /** Constructor for an ASM pseudo node.
2837  *
2838  * @param *irg        The IR graph the node belong to.
2839  * @param *block      The block the node belong to.
2840  * @param arity       The number of data inputs to the node.
2841  * @param *in         The array of length arity of data inputs.
2842  * @param *inputs     The array of length arity of input constraints.
2843  * @param n_outs      The number of data outputs to the node.
2844  * @param *outputs    The array of length n_outs of output constraints.
2845  * @param n_clobber   The number of clobbered registers.
2846  * @param *clobber    The array of length n_clobber of clobbered registers.
2847  * @param *asm_text   The assembler text.
2848  */
2849 ir_node *new_r_ASM(ir_graph *irg, ir_node *block,
2850                    int arity, ir_node *in[], ir_asm_constraint *inputs,
2851                    int n_outs, ir_asm_constraint *outputs,
2852                    int n_clobber, ident *clobber[], ident *asm_text);
2853
2854 /*-----------------------------------------------------------------------*/
2855 /* The block oriented interface                                          */
2856 /*-----------------------------------------------------------------------*/
2857
2858 /** Sets the current block in which the following constructors place the
2859  *  nodes they construct.
2860  *
2861  *  @param target  The new current block.
2862  */
2863 void     set_cur_block (ir_node *target);
2864
2865 /** Returns the current block of the current graph. */
2866 ir_node *get_cur_block(void);
2867
2868 /** Returns the fixed nodes  of the current graph. */
2869 #define get_cur_end_block()   get_irg_end_block(current_ir_graph)
2870 #define get_cur_end()         get_irg_end(current_ir_graph)
2871 #define get_cur_start_block() get_irg_start_block(current_ir_graph)
2872 #define get_cur_start()       get_irg_start(current_ir_graph)
2873
2874 /** Constructor for a Block node.
2875  *
2876  * Adds the block to the graph in current_ir_graph. Constructs a Block
2877  * with a fixed number of predecessors.  Does set current_block.  Can
2878  * be used with automatic Phi node construction.
2879  *
2880  * @param *db    A Pointer for debug information.
2881  * @param arity  The number of control predecessors.
2882  * @param in[]   An array of control predecessors.  The length of
2883  *               the array must be 'arity'.
2884  */
2885 ir_node *new_d_Block(dbg_info *db, int arity, ir_node *in[]);
2886
2887 /** Constructor for a Start node.
2888  *
2889  * Adds the node to the block in current_ir_block.
2890  *
2891  * @param *db    A pointer for debug information.
2892  */
2893 ir_node *new_d_Start  (dbg_info *db);
2894
2895 /** Constructor for a End node.
2896  *
2897  * Adds the node to the block in current_ir_block.
2898  *
2899  * @param *db     A pointer for debug information.
2900  */
2901 ir_node *new_d_End    (dbg_info *db);
2902
2903 /** Constructor for a Jmp node.
2904  *
2905  * Adds the node to the block in current_ir_block.
2906  *
2907  * Jmp represents control flow to a single control successor.
2908  *
2909  * @param *db     A pointer for debug information.
2910  */
2911 ir_node *new_d_Jmp    (dbg_info *db);
2912
2913 /** Constructor for an IJmp node.
2914  *
2915  * IJmp represents control flow to a single control successor not
2916  * statically known i.e. an indirect Jmp.
2917  *
2918  * @param *db     A pointer for debug information.
2919  * @param *tgt    The IR node representing the target address.
2920  */
2921 ir_node *new_d_IJmp   (dbg_info *db, ir_node *tgt);
2922
2923 /** Constructor for a Cond node.
2924  *
2925  * Adds the node to the block in current_ir_block.
2926  *
2927  * If c is mode_b represents a conditional branch (if/else). If c is
2928  * mode_Is/mode_Iu (?) represents a switch.  (Allocates dense Cond
2929  * node, default Proj is 0.)
2930  *
2931  * This is not consistent:  Input to Cond is Is, Proj has as proj number
2932  * longs.
2933  *
2934  * @param *db    A pointer for debug information.
2935  * @param *c     The conditions parameter.Can be of mode b or I_u.
2936  */
2937 ir_node *new_d_Cond   (dbg_info *db, ir_node *c);
2938
2939 /** Constructor for a Return node.
2940  *
2941  * Adds the node to the block in current_ir_block.
2942  *
2943  * Returns the memory and zero or more return values.  Only node that
2944  * can end regular control flow.
2945  *
2946  * @param *db    A pointer for debug information.
2947  * @param *store The state of memory.
2948  * @param arity  Number of array indices.
2949  * @param *in    Array with index inputs to the node.
2950  */
2951 ir_node *new_d_Return (dbg_info *db, ir_node *store, int arity, ir_node *in[]);
2952
2953 /** Constructor for a Const_type node.
2954  *
2955  * Adds the node to the start block.
2956  *
2957  * The constant represents a target value.  This constructor sets high
2958  * level type information for the constant value.
2959  * Derives mode from passed tarval.
2960  *
2961  * @param *db    A pointer for debug information.
2962  * @param *con   Points to an entry in the constant table. This pointer is
2963                  added to the attributes of the node.
2964  * @param *tp    The type of the constant.
2965  */
2966 ir_node *new_d_Const_type (dbg_info *db, tarval *con, ir_type *tp);
2967
2968 /** Constructor for a Const node.
2969  *
2970  * Adds the node to the block in current_ir_block.
2971  *
2972  * Constructor for a Const node. The constant represents a target
2973  * value.  Sets the type information to type_unknown.  (No more
2974  * supported: If tv is entity derives a somehow useful type.)
2975  * Derives mode from passed tarval.
2976  *
2977  * @param *db    A pointer for debug information.
2978  * @param *con   Points to an entry in the constant table. This pointer is added
2979  *               to the attributes of the node.
2980  */
2981 ir_node *new_d_Const  (dbg_info *db, tarval *con);
2982
2983 /** Constructor for a SymConst_type node.
2984  *
2985  *  Adds the node to the block in current_ir_block.
2986  *  This is the constructor for a symbolic constant.
2987  *    There are four kinds of symbolic constants:
2988  *    - type_tag  The symbolic constant represents a type tag.  The type the
2989  *                tag stands for is given explicitly.
2990  *    - size      The symbolic constant represents the size of a type.  The
2991  *                type of which the constant represents the size is given
2992  *                explicitly.
2993  *    - addr_name The symbolic constant represents the address of an entity
2994  *                (variable or method).  The variable is indicated by a name
2995  *                that is valid for linking.
2996  *    - addr_ent   The symbolic constant represents the address of an entity
2997  *                (variable or method).  The variable is given explicitly by
2998  *                a firm entity.
2999  *
3000  *    Inputs to the node:
3001  *      No inputs except the block it belongs to.
3002  *    Outputs of the node.
3003  *      An unsigned integer (I_u) or a pointer (P).
3004  *
3005  * @param *db     A pointer for debug information.
3006  * @param mode    The mode for the SymConst.
3007  * @param value   A type, entity or ident depending on the SymConst kind.
3008  * @param kind    The kind of the symbolic constant: symconst_type_tag, symconst_type_size,
3009  *                symconst_type_align, symconst_addr_name or symconst_addr_ent.
3010  * @param tp      The source type of the constant.
3011  */
3012 ir_node *new_d_SymConst_type(dbg_info *db, ir_mode *mode,
3013                              union symconst_symbol value, symconst_kind kind, ir_type *tp);
3014
3015 /** Constructor for a SymConst node.
3016  *
3017  *  Same as new_d_SymConst_type, except that it sets the type to type_unknown.
3018  */
3019 ir_node *new_d_SymConst(dbg_info *db, ir_mode *mode,
3020                         union symconst_symbol value, symconst_kind kind);
3021
3022 /** Constructor for a simpleSel node.
3023  *
3024  *  This is a shortcut for the new_d_Sel() constructor.  To be used for
3025  *  Sel nodes that do not select from an array, i.e., have no index
3026  *  inputs.  It adds the two parameters 0, NULL.
3027  *
3028  * @param   *db        A pointer for debug information.
3029  * @param   *store     The memory in which the object the entity should be
3030  *                     selected from is allocated.
3031  * @param   *objptr    The object from that the Sel operation selects a
3032  *                     single attribute out.
3033  * @param   *ent       The entity to select.
3034  */
3035 ir_node *new_d_simpleSel(dbg_info *db, ir_node *store, ir_node *objptr, ir_entity *ent);
3036
3037 /** Constructor for a Sel node.
3038  *
3039  * The select node selects an entity (field or method) from an entity
3040  * with a compound type.  It explicitly specifies the entity selected.
3041  * Dynamically the node may select entities that overwrite the given
3042  * entity.  If the selected entity is an array element entity the Sel
3043  * node takes the required array indices as inputs.
3044  * Adds the node to the block in current_ir_block.
3045  *
3046  * @param   *db        A pointer for debug information.
3047  * @param   *store     The memory in which the object the entity should be selected
3048  *                     from is allocated.
3049  * @param   *objptr    A pointer to a compound entity the Sel operation selects a
3050  *                     single attribute from.
3051  * @param   arity      The number of array indices needed to select an array element entity.
3052  * @param   *in[]      If the compound entity is an array the indices of the selected
3053  *                     element entity.  The constructor copies this array.
3054  * @param   *ent       The entity to select.
3055  */
3056 ir_node *new_d_Sel    (dbg_info *db, ir_node *store, ir_node *objptr, int arity, ir_node *in[],
3057                        ir_entity *ent);
3058
3059 /** Constructor for a Call node.
3060  *
3061  *  Represents all kinds of method and function calls.
3062  *  Adds the node to the block in current_ir_block.
3063  *
3064  * @param   *db     A pointer for debug information.
3065  * @param   *store  The actual store.
3066  * @param   *callee A pointer to the called procedure.
3067  * @param   arity   The number of procedure parameters.
3068  * @param   *in[]   An array with the pointers to the parameters. The constructor copies this array.
3069  * @param   *tp     Type information of the procedure called.
3070  */
3071 ir_node *new_d_Call   (dbg_info *db, ir_node *store, ir_node *callee, int arity, ir_node *in[],
3072              ir_type *tp);
3073
3074 /** Constructor for a Add node.
3075  *
3076  * Adds the node to the block in current_ir_block.
3077  *
3078  * @param   *db    A pointer for debug information.
3079  * @param   *op1   The first operand.
3080  * @param   *op2   The second operand.
3081  * @param   *mode  The mode of the operands and the result.
3082  */
3083 ir_node *new_d_Add    (dbg_info *db, ir_node *op1, ir_node *op2, ir_mode *mode);
3084
3085 /** Constructor for a Sub node.
3086  *
3087  * Adds the node to the block in current_ir_block.
3088  *
3089  * @param   *db    A pointer for debug information.
3090  * @param   *op1   The first operand.
3091  * @param   *op2   The second operand.
3092  * @param   *mode  The mode of the operands and the result.
3093  */
3094 ir_node *new_d_Sub    (dbg_info *db, ir_node *op1, ir_node *op2, ir_mode *mode);
3095
3096 /** Constructor for a Minus node.
3097  *
3098  * Adds the node to the block in current_ir_block.
3099  *
3100  * @param   *db    A pointer for debug information.
3101  * @param   *op    The operand .
3102  * @param   *mode  The mode of the operand and the result.
3103  */
3104 ir_node *new_d_Minus  (dbg_info *db, ir_node *op,  ir_mode *mode);
3105
3106 /** Constructor for a Mul node.
3107  *
3108  * Adds the node to the block in current_ir_block.
3109  *
3110  * @param   *db    A pointer for debug information.
3111  * @param   *op1   The first operand.
3112  * @param   *op2   The second operand.
3113  * @param   *mode  The mode of the operands and the result.
3114  */
3115 ir_node *new_d_Mul    (dbg_info *db, ir_node *op1, ir_node *op2, ir_mode *mode);
3116
3117 /** Constructor for a Mulh node.
3118  *
3119  * Adds the node to the block in current_ir_block.
3120  *
3121  * @param   *db    A pointer for debug information.
3122  * @param   *op1   The first operand.
3123  * @param   *op2   The second operand.
3124  * @param   *mode  The mode of the operands and the result.
3125  */
3126 ir_node *new_d_Mulh   (dbg_info *db, ir_node *op1, ir_node *op2, ir_mode *mode);
3127
3128 /** Constructor for a Quot node.
3129  *
3130  * Adds the node to the block in current_ir_block.
3131  *
3132  * @param   *db    A pointer for debug information.
3133  * @param   *memop The store needed to model exceptions
3134  * @param   *op1   The first operand.
3135  * @param   *op2   The second operand.
3136  * @param   *mode  The mode of the result.
3137  * @param   state  The pinned state.
3138  */
3139 ir_node *new_d_Quot   (dbg_info *db, ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state);
3140
3141 /** Constructor for a DivMod node.
3142  *
3143  * Adds the node to the block in current_ir_block.
3144  *
3145  * @param   *db    A pointer for debug information.
3146  * @param   *memop The store needed to model exceptions
3147  * @param   *op1   The first operand.
3148  * @param   *op2   The second operand.
3149  * @param   *mode  The mode of the results.
3150  * @param   state  The pinned state.
3151  */
3152 ir_node *new_d_DivMod (dbg_info *db, ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state);
3153
3154 /** Constructor for a Div node.
3155  *
3156  * Adds the node to the block in current_ir_block.
3157  *
3158  * @param   *db    A pointer for debug information.
3159  * @param   *memop The store needed to model exceptions
3160  * @param   *op1   The first operand.
3161  * @param   *op2   The second operand.
3162  * @param   *mode  The mode of the result.
3163  * @param   state  The pinned state.
3164  */
3165 ir_node *new_d_Div    (dbg_info *db, ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state);
3166
3167 /** Constructor for a remainderless Div node.
3168  *
3169  * Adds the node to the block in current_ir_block.
3170  *
3171  * @param   *db    A pointer for debug information.
3172  * @param   *memop The store needed to model exceptions
3173  * @param   *op1   The first operand.
3174  * @param   *op2   The second operand.
3175  * @param   *mode  The mode of the result.
3176  * @param   state  The pinned state.
3177  */
3178 ir_node *new_d_DivRL  (dbg_info *db, ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state);
3179
3180 /** Constructor for a Mod node.
3181  *
3182  * Adds the node to the block in current_ir_block.
3183  *
3184  * @param   *db    A pointer for debug information.
3185  * @param   *memop The store needed to model exceptions
3186  * @param   *op1   The first operand.
3187  * @param   *op2   The second operand.
3188  * @param   *mode  The mode of the result.
3189  * @param   state  The pinned state.
3190  */
3191 ir_node *new_d_Mod    (dbg_info *db, ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state);
3192
3193 /** Constructor for a Abs node.
3194  *
3195  * Adds the node to the block in current_ir_block.
3196  *
3197  * @param   *db    A pointer for debug information.
3198  * @param   *op    The operand
3199  * @param   *mode  The mode of the operands and the result.
3200  */
3201 ir_node *new_d_Abs    (dbg_info *db, ir_node *op,                ir_mode *mode);
3202
3203 /** Constructor for a And node.
3204  *
3205  * Adds the node to the block in current_ir_block.
3206  *
3207  * @param   *db    A pointer for debug information.
3208  * @param   *op1   The first operand.
3209  * @param   *op2   The second operand.
3210  * @param   *mode  The mode of the operands and the result.
3211  */
3212 ir_node *new_d_And    (dbg_info *db, ir_node *op1, ir_node *op2, ir_mode *mode);
3213
3214 /** Constructor for a Or node.
3215  *
3216  * Adds the node to the block in current_ir_block.
3217  *
3218  * @param   *db    A pointer for debug information.
3219  * @param   *op1   The first operand.
3220  * @param   *op2   The second operand.
3221  * @param   *mode  The mode of the operands and the result.
3222  */
3223 ir_node *new_d_Or     (dbg_info *db, ir_node *op1, ir_node *op2, ir_mode *mode);
3224
3225 /** Constructor for a Eor node.
3226  *
3227  * Adds the node to the block in current_ir_block.
3228  *
3229  * @param   *db    A pointer for debug information.
3230  * @param   *op1   The first operand.
3231  * @param   *op2   The second operand.
3232  * @param   *mode  The mode of the operands and the results.
3233  */
3234 ir_node *new_d_Eor    (dbg_info *db, ir_node *op1, ir_node *op2, ir_mode *mode);
3235
3236 /** Constructor for a Not node.
3237  *
3238  * Adds the node to the block in current_ir_block.
3239  *
3240  * @param   *db    A pointer for debug information.
3241  * @param   *op    The operand.
3242  * @param   *mode  The mode of the operand and the result.
3243  */
3244 ir_node *new_d_Not    (dbg_info *db, ir_node *op,                ir_mode *mode);
3245
3246 /** Constructor for a Shl node.
3247  *
3248  * Adds the node to the block in current_ir_block.
3249  *
3250  * @param   *db    A pointer for debug information.
3251  * @param   *op    The operand.
3252  * @param   *k     The number of bits to  shift the operand .
3253  * @param   *mode  The mode of the operand and the result.
3254  */
3255 ir_node *new_d_Shl    (dbg_info *db, ir_node *op,  ir_node *k,   ir_mode *mode);
3256
3257 /** Constructor for a Shr node.
3258  *
3259  * Adds the node to the block in current_ir_block.
3260  *
3261  * @param   *db    A pointer for debug information.
3262  * @param   *op    The operand.
3263  * @param   *k     The number of bits to  shift the operand .
3264  * @param   *mode  The mode of the operand and the result.
3265  */
3266 ir_node *new_d_Shr    (dbg_info *db, ir_node *op,  ir_node *k,   ir_mode *mode);
3267
3268 /** Constructor for a Shrs node.
3269  *
3270  * Adds the node to the block in current_ir_block.
3271  *
3272  * @param   *db    A pointer for debug information.
3273  * @param   *op    The operand.
3274  * @param   *k     The number of bits to  shift the operand .
3275  * @param   *mode  The mode of the operand and the result.
3276  */
3277 ir_node *new_d_Shrs   (dbg_info *db, ir_node *op,  ir_node *k,   ir_mode *mode);
3278
3279 /** Constructor for a Rotl node.
3280  *
3281  * Adds the node to the block in current_ir_block.
3282  *
3283  * @param   *db    A pointer for debug information.
3284  * @param   *op    The operand.
3285  * @param   *k     The number of bits to rotate the operand.
3286  * @param   *mode  The mode of the operand.
3287  */
3288 ir_node *new_d_Rotl   (dbg_info *db, ir_node *op,  ir_node *k,   ir_mode *mode);
3289
3290 /** Constructor for a Cmp node.
3291  *
3292  * Adds the node to the block in current_ir_block.
3293  *
3294  * @param   *db    A pointer for debug information.
3295  * @param   *op1   The first operand.
3296  * @param   *op2   The second operand.
3297  */
3298 ir_node *new_d_Cmp    (dbg_info *db, ir_node *op1, ir_node *op2);
3299
3300 /** Constructor for a Conv node.
3301  *
3302  * Adds the node to the block in current_ir_block.
3303  *
3304  * @param   *db    A pointer for debug information.
3305  * @param   *op    The operand.
3306  * @param   *mode  The mode of this the operand muss be converted .
3307  */
3308 ir_node *new_d_Conv   (dbg_info *db, ir_node *op, ir_mode *mode);
3309
3310 /** Constructor for a strict Conv node.
3311  *
3312  * Adds the node to the block in current_ir_block.
3313  *
3314  * @param   *db    A pointer for debug information.
3315  * @param   *op    The operand.
3316  * @param   *mode  The mode of this the operand muss be converted .
3317  */
3318 ir_node *new_d_strictConv   (dbg_info *db, ir_node *op, ir_mode *mode);
3319
3320 /** Constructor for a Cast node.
3321  *
3322  * High level type cast
3323  * Adds the node to the block in current_ir_block.
3324  *
3325  * @param   *db    A pointer for debug information.
3326  * @param   *op    The operand.
3327  * @param   *to_tp The type of this the operand muss be casted .
3328  */
3329 ir_node *new_d_Cast   (dbg_info *db, ir_node *op, ir_type *to_tp);
3330
3331 /** Constructor for a Carry node.
3332  *
3333  * Adds the node to the block in current_ir_block.
3334  *
3335  * @param   *db    A pointer for debug information.
3336  * @param   *op1   The first operand.
3337  * @param   *op2   The second operand.
3338  * @param   *mode  The mode of the operands and the result.
3339  */
3340 ir_node *new_d_Carry  (dbg_info *db, ir_node *op1, ir_node *op2, ir_mode *mode);
3341
3342 /** Constructor for a Borrow node.
3343  *
3344  * Adds the node to the block in current_ir_block.
3345  *
3346  * @param   *db    A pointer for debug information.
3347  * @param   *op1   The first operand.
3348  * @param   *op2   The second operand.
3349  * @param   *mode  The mode of the operands and the result.
3350  */
3351 ir_node *new_d_Borrow (dbg_info *db, ir_node *op1, ir_node *op2, ir_mode *mode);
3352
3353 /** Constructor for a Phi node.
3354  *
3355  * Adds the node to the block in current_ir_block.
3356  *
3357  * @param *db    A pointer for debug information.
3358  * @param arity  The number of predecessors
3359  * @param *in    Array with predecessors
3360  * @param *mode  The mode of it's inputs and output.
3361  */
3362 ir_node *new_d_Phi    (dbg_info *db, int arity, ir_node *in[], ir_mode *mode);
3363
3364 /** Constructor for a Load node.
3365  *
3366  * Adds the node to the block in current_ir_block.
3367  *
3368  * @param *db    A pointer for debug information.
3369  * @param *store The current memory
3370  * @param *addr  A pointer to the variable to be read in this memory.
3371  * @param *mode  The mode of the value to be loaded.
3372  */
3373 ir_node *new_d_Load   (dbg_info *db, ir_node *store, ir_node *addr, ir_mode *mode);
3374
3375 /** Constructor for a Store node.
3376  *
3377  * Adds the node to the block in current_ir_block.
3378  *
3379  * @param *db    A pointer for debug information.
3380  * @param *store The current memory
3381  * @param *addr  A pointer to the variable to be read in this memory.
3382  * @param *val   The value to write to this variable.
3383  */
3384 ir_node *new_d_Store  (dbg_info *db, ir_node *store, ir_node *addr, ir_node *val);
3385
3386 /** Constructor for a Alloc node.
3387  *
3388  * The Alloc node extends the memory by space for an entity of type alloc_type.
3389  * Adds the node to the block in current_ir_block.
3390  *
3391  * @param *db         A pointer for debug information.
3392  * @param *store      The memory which shall contain the new variable.
3393  * @param *size       The number of bytes to allocate.
3394  * @param *alloc_type The type of the allocated variable.
3395  * @param where       Where to allocate the variable, either heap_alloc or stack_alloc.
3396  */
3397 ir_node *new_d_Alloc  (dbg_info *db, ir_node *store, ir_node *size, ir_type *alloc_type,
3398                        ir_where_alloc where);
3399
3400  /** Constructor for a Free node.
3401  *
3402  * Frees the memory occupied by the entity pointed to by the pointer
3403  * arg.  Type indicates the type of the entity the argument points to.
3404  * Adds the node to the block in current_ir_block.
3405  *
3406  * @param *db         A pointer for debug information.
3407  * @param *store      The memory which shall contain the new variable.
3408  * @param *ptr        The pointer to the object to free.
3409  * @param *size       The number of objects of type free_type to free in a sequence.
3410  * @param *free_type  The type of the freed variable.
3411  * @param where       Where the variable was allocated, either heap_alloc or stack_alloc.
3412  */
3413 ir_node *new_d_Free   (dbg_info *db, ir_node *store, ir_node *ptr, ir_node *size,
3414              ir_type *free_type, ir_where_alloc where);
3415
3416 /** Constructor for a Sync node.
3417  *
3418  * Merges several memory values.  The node assumes that a variable
3419  * either occurs only in one of the memories, or it contains the same
3420  * value in all memories where it occurs.
3421  * Adds the node to the block in current_ir_block.
3422  *
3423  * @param *db       A pointer for debug information.
3424  * @param  arity    The number of memories to synchronize.
3425  * @param  **in     An array of pointers to nodes that produce an output of type
3426  *                  memory.  The constructor copies this array.
3427  */
3428 ir_node *new_d_Sync   (dbg_info *db, int arity, ir_node *in[]);
3429
3430 /** Constructor for a Proj node.
3431  *
3432  * Projects a single value out of a tuple.  The parameter proj gives the
3433  * position of the value within the tuple.
3434  * Adds the node to the block in current_ir_block.
3435  *
3436  * @param *db    A pointer for deubug information.
3437  * @param arg    A node producing a tuple.
3438  * @param *mode  The mode of the value to project.
3439  * @param proj   The position of the value in the tuple.
3440  */
3441 ir_node *new_d_Proj   (dbg_info *db, ir_node *arg, ir_mode *mode, long proj);
3442
3443 /** Constructor for a defaultProj node.
3444  *
3445  * Represents the default control flow of a Switch-Cond node.
3446  * Adds the node to the block in current_ir_block.
3447  *
3448  * @param *db       A pointer for debug information.
3449  * @param arg       A node producing a tuple.
3450  * @param max_proj  The end  position of the value in the tuple.
3451  */
3452 ir_node *new_d_defaultProj (dbg_info *db, ir_node *arg, long max_proj);
3453
3454 /** Constructor for a Tuple node.
3455  *
3456  * This is an auxiliary node to replace a node that returns a tuple
3457  * without changing the corresponding Proj nodes.
3458  * Adds the node to the block in current_ir_block.
3459  *
3460  * @param *db     A pointer for debug information.
3461  * @param arity   The number of tuple elements.
3462  * @param **in    An array containing pointers to the nodes producing the tuple elements.
3463  */
3464 ir_node *new_d_Tuple  (dbg_info *db, int arity, ir_node *in[]);
3465
3466 /** Constructor for a Id node.
3467  *
3468  * This is an auxiliary node to replace a node that returns a single
3469  * value. Adds the node to the block in current_ir_block.
3470  *
3471  * @param *db     A pointer for debug information.
3472  * @param *val    The operand to Id.
3473  * @param *mode   The mode of *val.
3474  */
3475 ir_node *new_d_Id     (dbg_info *db, ir_node *val, ir_mode *mode);
3476
3477 /** Constructor for a Confirm node.
3478  *
3479  * Constructor for a Confirm node. Adds the node to the block in current_ir_block.
3480  * Specifies constraints for a value.  To support dataflow analyses.
3481  *
3482  * Example: If the value never exceeds '100' this is expressed by placing a
3483  * Confirm node val = new_d_Confirm(db, val, 100, '<=') on the dataflow edge.
3484  *
3485  * @param *db     A pointer for debug information.
3486  * @param *val    The value we express a constraint for
3487  * @param *bound  The value to compare against. Must be a firm node, typically a constant.
3488  * @param cmp     The compare operation.
3489  */
3490 ir_node *new_d_Confirm (dbg_info *db, ir_node *val, ir_node *bound, pn_Cmp cmp);
3491
3492 /** Constructor for an Unknown node.
3493  *
3494  * Represents an arbitrary value.  Places the node in
3495  * the start block.
3496  *
3497  * @param *m      The mode of the unknown value.
3498  */
3499 ir_node *new_d_Unknown(ir_mode *m);
3500
3501 /** Constructor for a CallBegin node.
3502  *
3503  * CallBegin represents control flow depending of the pointer value
3504  * representing the called method to the called methods.  The
3505  * constructor copies the method pointer input from the passed Call
3506  * node.Adds the node to the block in current_ir_block.
3507  *
3508  * @param *db     A pointer for debug information.
3509  * @param *callee The call node visible in the  intra procedural view.
3510  */
3511 ir_node *new_d_CallBegin(dbg_info *db, ir_node *callee);
3512
3513 /** Constructor for an EndReg node.
3514  *
3515  *Adds the node to the block in current_ir_block.
3516  *
3517  * @param *db     A pointer for debug information.
3518  */
3519 ir_node *new_d_EndReg (dbg_info *db);
3520
3521 /** Constructor for an EndExcept node.
3522  *
3523  * Used to represent regular procedure end in interprocedual view.
3524  * Adds the node to the block in current_ir_block.
3525  *
3526  * @param *db     A pointer for debug information.
3527  */
3528 ir_node *new_d_EndExcept(dbg_info *db);
3529
3530 /** Constructor for a Break node.
3531  *
3532  * Used to represent exceptional procedure end in interprocedural view.
3533  * Adds the node to the block in current_ir_block.
3534  *
3535  * Break represents control flow to a single control successor just as Jmp.
3536  * The blocks separated by a break may not be concatenated by an optimization.
3537  * It is used for the interprocedural representation where blocks are parted
3538  * behind Call nodes to represent the control flow to called procedures.
3539  *
3540  * @param *db     A pointer for debug information.
3541  */
3542 ir_node *new_d_Break (dbg_info *db);
3543
3544 /** Constructor for a Filter node.
3545  *
3546  * Constructor for a Filter node. Adds the node to the block in
3547  * current_ir_block.  Filter is a node with two views used to
3548  * construct the interprocedural view.  In intraprocedural view its
3549  * semantics are identical to the Proj node.  In interprocedural view
3550  * the Filter performs the Phi operation on method parameters or
3551  * results.  Other than a Phi a Filter node may not be removed if it
3552  * has only a single input.
3553  *
3554  * The constructor builds the Filter in intraprocedural view.
3555  *
3556  * @param *db   A pointer for debug information.
3557  * @param *arg  The tuple value to project from.
3558  * @param *mode The mode of the projected value.
3559  * @param proj  The position in the tuple to project from.
3560  */
3561 ir_node *new_d_Filter (dbg_info *db, ir_node *arg, ir_mode *mode, long proj);
3562
3563 /** Constructor for a Mux node.
3564  *
3565  * @param *db       A pointer for debug information.
3566  * @param *sel      The ir_node that calculates the boolean select.
3567  * @param *ir_true  The ir_node that calculates the true result.
3568  * @param *ir_false The ir_node that calculates the false result.
3569  * @param *mode     The mode of the node (and it_true and ir_false).
3570  */
3571 ir_node *new_d_Mux  (dbg_info *db, ir_node *sel,
3572     ir_node *ir_false, ir_node *ir_true, ir_mode *mode);
3573
3574 /** Constructor for a CopyB node.
3575  *
3576  * @param *db         A pointer for debug information.
3577  * @param *store      The current memory
3578  * @param *dst        The ir_node that represents the destination address.
3579  * @param *src        The ir_node that represents the source address.
3580  * @param *data_type  The type of the copied data
3581  */
3582 ir_node *new_d_CopyB(dbg_info *db, ir_node *store, ir_node *dst, ir_node *src, ir_type *data_type);
3583
3584 /** Constructor for a InstOf node.
3585  *
3586  * A High-Level Type check.
3587  *
3588  * @param   *db        A pointer for debug information.
3589  * @param   *store     The memory in which the object the entity should be selected
3590  *                     from is allocated.
3591  * @param   *objptr    A pointer to a object of a class type.
3592  * @param   *type      The type of which objptr must be.
3593  */
3594 ir_node *new_d_InstOf (dbg_info *db, ir_node *store, ir_node *objptr, ir_type *type);
3595
3596 /** Constructor for a Raise node.
3597  *
3598  * A High-Level Exception throw.
3599  *
3600  * @param *db    A pointer for debug information.
3601  * @param *store The current memory.
3602  * @param *obj   A pointer to the Except variable.
3603  */
3604 ir_node *new_d_Raise  (dbg_info *db, ir_node *store, ir_node *obj);
3605
3606 /** Constructor for a Bound node.
3607  *
3608  * A High-Level bounds check. Checks whether lower <= idx && idx < upper.
3609  *
3610  * @param *db         A pointer for debug information.
3611  * @param *store      The current memory
3612  * @param *idx        The ir_node that represents an index.
3613  * @param *lower      The ir_node that represents the lower bound for the index.
3614  * @param *upper      The ir_node that represents the upper bound for the index.
3615  */
3616 ir_node *new_d_Bound(dbg_info *db, ir_node *store, ir_node *idx, ir_node *lower, ir_node *upper);
3617
3618 /** Constructor for a Pin node.
3619  *
3620  * @param *db         A pointer for debug information.
3621  * @param *node       The node which value should be pinned.
3622  */
3623 ir_node *new_d_Pin(dbg_info *db, ir_node *node);
3624
3625 /** Constructor for an ASM pseudo node.
3626  *
3627  * @param *db         A pointer for debug information.
3628  * @param arity       The number of data inputs to the node.
3629  * @param *in         The array of length arity of data inputs.
3630  * @param *inputs     The array of length arity of input constraints.
3631  * @param n_outs      The number of data outputs to the node.
3632  * @param *outputs    The array of length n_outs of output constraints.
3633  * @param n_clobber   The number of clobbered registers.
3634  * @param *clobber    The array of length n_clobber of clobbered registers.
3635  * @param *asm_text   The assembler text.
3636  */
3637 ir_node *new_d_ASM(dbg_info *db, int arity, ir_node *in[], ir_asm_constraint *inputs,
3638                    int n_outs, ir_asm_constraint *outputs,
3639                    int n_clobber, ident *clobber[], ident *asm_text);
3640
3641 /*-----------------------------------------------------------------------*/
3642 /* The block oriented interface without debug support                    */
3643 /*-----------------------------------------------------------------------*/
3644
3645 /* Needed from the interface with debug support:
3646 void set_cur_block (ir_node *target);   */
3647
3648 /** Constructor for a Block node.
3649  *
3650  * Constructor for a Block node. Adds the block to the graph in
3651  * current_ir_graph.  Constructs a Block with a fixed number of
3652  * predecessors.  Does set current_block.  Can be used with automatic
3653  * Phi node construction.
3654  *
3655  * @param arity  The number of control predecessors.
3656  * @param in     An array of control predecessors.  The length of
3657  *               the array must be 'arity'.
3658  */
3659 ir_node *new_Block(int arity, ir_node *in[]);
3660
3661 /** Constructor for a Start node.
3662  *
3663  * Adds the node to the block in current_ir_block.
3664  *
3665  */
3666 ir_node *new_Start  (void);
3667
3668 /** Constructor for an End node.
3669  *
3670  * Adds the node to the block in current_ir_block.
3671  */
3672 ir_node *new_End    (void);
3673
3674 /** Constructor for an EndReg node.
3675  *
3676  * Used to represent regular procedure end in interprocedual view.
3677  * Adds the node to the block in current_ir_block.
3678  */
3679 ir_node *new_EndReg (void);
3680
3681 /** Constructor for an EndExpcept node.
3682  *
3683  *  Used to represent exceptional procedure end in interprocedural view.
3684  *  Adds the node to the block in current_ir_block.
3685  */
3686 ir_node *new_EndExcept(void);
3687
3688 /** Constructor for a Jump node.
3689  *
3690  * Adds the node to the block in current_ir_block.
3691  *
3692  * Jmp represents control flow to a single control successor.
3693  */
3694 ir_node *new_Jmp    (void);
3695
3696 /** Constructor for an IJmp node.
3697  *
3698  * IJmp represents control flow to a single control successor not
3699  * statically known i.e. an indirect Jmp.
3700  *
3701  * @param *tgt    The IR node representing the target address.
3702  */
3703 ir_node *new_IJmp   (ir_node *tgt);
3704
3705 /** Constructor for a Break node.
3706  * Break represents control flow to a single control successor just as Jmp.
3707  * The blocks separated by a break may not be concatenated by an optimization.
3708  * It is used for the interprocedural representation where blocks are parted
3709  * behind Call nodes to represent the control flow to called procedures.
3710  * Adds the node to the block in current_ir_block.
3711  */
3712 ir_node *new_Break  (void);
3713
3714 /** Constructor for a Cond node.
3715  *
3716  * If c is mode_b represents a conditional branch (if/else). If c is
3717  * mode_Is/mode_Iu (?) represents a switch.  (Allocates dense Cond
3718  * node, default Proj is 0.). Adds the node to the block in current_ir_block.
3719  *
3720  * This is not consistent:  Input to Cond is Is, Proj has as proj number
3721  * longs.
3722  *
3723  *
3724  * @param *c     The conditions parameter.Can be of mode b or I_u.
3725  */
3726 ir_node *new_Cond   (ir_node *c);
3727
3728 /** Constructor for a Return node.
3729  *
3730  * Returns the memory and zero or more return values.  Only node that
3731  * can end regular control flow. Adds the node to the block in current_ir_block.
3732  *
3733  * @param *store The state of memory.
3734  * @param arity  Number of array indices.
3735  * @param *in    Array with index inputs to the node.
3736  */
3737 ir_node *new_Return (ir_node *store, int arity, ir_node *in[]);
3738
3739 /** Constructor for a Const node.
3740  *
3741  * Constructor for a Const node. The constant represents a target
3742  * value.  Sets the type information to type_unknown.  (No more
3743  * supported: If tv is entity derives a somehow useful type.)
3744  * Adds the node to the block in current_ir_block.
3745  * Derives mode from passed tarval.
3746  *
3747  * @param *con   Points to an entry in the constant table. This pointer is
3748  *               added to the attributes of  the node.
3749  */
3750 ir_node *new_Const (tarval *con);
3751
3752 /**
3753  * Make a const from a long.
3754  * This is just convenience for the usual
3755  * <code>
3756  * new_Const(mode, tarval_from_long(mode, ...))
3757  * </code>
3758  * pain.
3759  * @param mode The mode for the const.
3760  * @param value The value of the constant.
3761  * @return A new const node.
3762  */
3763 ir_node *new_Const_long(ir_mode *mode, long value);
3764
3765 /** Constructor for a Const node.
3766  *
3767  * Derives mode from passed tarval. */
3768 ir_node *new_Const_type(tarval *con, ir_type *tp);
3769
3770 /** Constructor for a SymConst node.
3771  *
3772  * Adds the node to the block in current_ir_block.
3773  * This is the constructor for a symbolic constant.
3774  * There are four kinds of symbolic constants:
3775  *    -# type_tag  The symbolic constant represents a type tag.  The type the
3776  *                 tag stands for is given explicitly.
3777  *    -# size      The symbolic constant represents the size of a type.  The
3778  *                 type of which the constant represents the size is given
3779  *                 explicitly.
3780  *    -# align     The symbolic constant represents the alignment of a type.  The
3781  *                 type of which the constant represents the size is given
3782  *                 explicitly.
3783  *    -# addr_name The symbolic constant represents the address of an entity
3784  *                 (variable or method).  The variable is indicated by a name
3785  *                 that is valid for linking.
3786  *    -# addr_ent  The symbolic constant represents the address of an entity
3787  *                 (variable or method).  The variable is given explicitly by
3788  *                 a firm entity.
3789  *
3790  *    Inputs to the node:
3791  *      No inputs except the block it belongs to.
3792  *    Outputs of the node.
3793  *      An unsigned integer (I_u) or a pointer (P).
3794  *
3795  * @param mode    The mode for the SymConst.
3796  * @param value   A type or a ident depending on the SymConst kind.
3797  * @param kind    The kind of the symbolic constant: symconst_type_tag, symconst_type_size
3798  *                symconst_type_align, symconst_addr_name or symconst_addr_ent.
3799  * @param tp      The source type of the constant.
3800  */
3801 ir_node *new_SymConst_type(ir_mode *mode, union symconst_symbol value, symconst_kind kind, ir_type *tp);
3802
3803 /** Constructor for a SymConst node.
3804  *
3805  * Adds the node to the block in current_ir_block.
3806  * This is the constructor for a symbolic constant.
3807  * There are four kinds of symbolic constants:
3808  *    -# type_tag  The symbolic constant represents a type tag.  The type the
3809  *                 tag stands for is given explicitly.
3810  *    -# size      The symbolic constant represents the size of a type.  The
3811  *                 type of which the constant represents the size is given
3812  *                 explicitly.
3813  *    -# align     The symbolic constant represents the alignment of a type.  The
3814  *                 type of which the constant represents the size is given
3815  *                 explicitly.
3816  *    -# addr_name The symbolic constant represents the address of an entity
3817  *                 (variable or method).  The variable is indicated by a name
3818  *                 that is valid for linking.
3819  *    -# addr_ent  The symbolic constant represents the address of an entity
3820  *                 (variable or method).  The variable is given explicitly by
3821  *                 a firm entity.
3822  *
3823  *    Inputs to the node:
3824  *      No inputs except the block it belongs to.
3825  *    Outputs of the node.
3826  *      An unsigned integer (I_u) or a pointer (P).
3827  *
3828  * @param mode    The mode for the SymConst.
3829  * @param value   A type or a ident depending on the SymConst kind.
3830  * @param kind    The kind of the symbolic constant: symconst_type_tag, symconst_type_size
3831  *                symconst_type_align, symconst_addr_name or symconst_addr_ent.
3832  */
3833 ir_node *new_SymConst(ir_mode *mode, union symconst_symbol value, symconst_kind kind);
3834
3835 /** Constructor for a simpelSel node.
3836  *
3837  *  This is a shortcut for the new_Sel() constructor.  To be used for
3838  *  Sel nodes that do not select from an array, i.e., have no index
3839  *  inputs.  It adds the two parameters 0, NULL.
3840  *
3841  * @param   *store     The memory in which the object the entity should be selected from is allocated.
3842  * @param   *objptr    The object from that the Sel operation selects a single attribute out.
3843  * @param   *ent       The entity to select.
3844  */
3845 ir_node *new_simpleSel(ir_node *store, ir_node *objptr, ir_entity *ent);
3846
3847 /** Constructor for a Sel node.
3848  *
3849  * The select node selects an entity (field or method) from an entity
3850  * with a compound type.  It explicitly specifies the entity selected.
3851  * Dynamically the node may select entities that overwrite the given
3852  * entity.  If the selected entity is an array element entity the Sel
3853  * node takes the required array indices as inputs.
3854  * Adds the node to the block in current_ir_block.
3855  *
3856  * @param   *store     The memory in which the object the entity should be selected
3857  *                     from is allocated.
3858  * @param   *objptr    A pointer to a compound entity the Sel operation selects a
3859  *                     single attribute from.
3860  * @param   arity      The number of array indices needed to select an array element entity.
3861  * @param   *in[]      If the compound entity is an array the indices of the selected
3862  *                     element entity.  The constructor copies this array.
3863  * @param   *ent       The entity to select.
3864  */
3865 ir_node *new_Sel    (ir_node *store, ir_node *objptr, int arity, ir_node *in[],
3866                      ir_entity *ent);
3867
3868 /** Constructor for a Call node.
3869  *
3870  *  Adds the node to the block in current_ir_block.
3871  *  Represents all kinds of method and function calls.
3872  *
3873  * @param   *store  The actual store.
3874  * @param   *callee A pointer to the called procedure.
3875  * @param   arity   The number of procedure parameters.
3876  * @param   *in[]   An array with the pointers to the parameters. The constructor copies this array.
3877  * @param   *tp     Type information of the procedure called.
3878  */
3879 ir_node *new_Call   (ir_node *store, ir_node *callee, int arity, ir_node *in[],
3880                      ir_type *tp);
3881
3882 /** Constructor for a CallBegin node.
3883  *
3884  * CallBegin represents control flow depending of the pointer value
3885  * representing the called method to the called methods.  The
3886  * constructor copies the method pointer input from the passed Call
3887  * node. Adds the node to the block in current_ir_block.
3888  *
3889  * @param   *callee A pointer to the called procedure.
3890  */
3891 ir_node *new_CallBegin(ir_node *callee);
3892
3893 /** Constructor for a Add node.
3894  *
3895  * Adds the node to the block in current_ir_block.
3896  *
3897  * @param   *op1   The first operand.
3898  * @param   *op2   The second operand.
3899  * @param   *mode  The mode of the operands and the result.
3900  */
3901 ir_node *new_Add    (ir_node *op1, ir_node *op2, ir_mode *mode);
3902
3903 /** Constructor for a Sub node.
3904  *
3905  * Adds the node to the block in current_ir_block.
3906  *
3907  * @param   *op1   The first operand.
3908  * @param   *op2   The second operand.
3909  * @param   *mode  The mode of the operands and the result.
3910  */
3911 ir_node *new_Sub    (ir_node *op1, ir_node *op2, ir_mode *mode);
3912
3913 /** Constructor for a Minus node.
3914  *
3915  * Adds the node to the block in current_ir_block.
3916  *
3917  * @param   *op    The operand .
3918  * @param   *mode  The mode of the operand and the result.
3919  */
3920 ir_node *new_Minus  (ir_node *op,  ir_mode *mode);
3921
3922 /**
3923  * Constructor for a Mul node. Adds the node to the block in current_ir_block.
3924  *
3925  * @param   *op1   The first operand.
3926  * @param   *op2   The second operand.
3927  * @param   *mode  The mode of the operands and the result.
3928  */
3929 ir_node *new_Mul    (ir_node *op1, ir_node *op2, ir_mode *mode);
3930
3931 /**
3932  * Constructor for a Mulh node. Adds the node to the block in current_ir_block.
3933  *
3934  * @param   *op1   The first operand.
3935  * @param   *op2   The second operand.
3936  * @param   *mode  The mode of the operands and the result.
3937  */
3938 ir_node *new_Mulh   (ir_node *op1, ir_node *op2, ir_mode *mode);
3939
3940 /** Constructor for a Quot node.
3941  *
3942  * Adds the node to the block in current_ir_block.
3943  *
3944  * @param   *memop The store needed to model exceptions
3945  * @param   *op1   The first operand.
3946  * @param   *op2   The second operand.
3947  * @param   *mode  The mode of the result.
3948  * @param   state  The pinned state.
3949  */
3950 ir_node *new_Quot   (ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state);
3951
3952 /** Constructor for a DivMod node.
3953  *
3954  * Adds the node to the block in current_ir_block.
3955  *
3956  * @param   *memop The store needed to model exceptions
3957  * @param   *op1   The first operand.
3958  * @param   *op2   The second operand.
3959  * @param   *mode  The mode of the results.
3960  * @param   state  The pinned state.
3961  */
3962 ir_node *new_DivMod (ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state);
3963
3964 /** Constructor for a Div node.
3965  *
3966  * Adds the node to the block in current_ir_block.
3967  *
3968  * @param   *memop The store needed to model exceptions
3969  * @param   *op1   The first operand.
3970  * @param   *op2   The second operand.
3971  * @param   *mode  The mode of the result.
3972  * @param   state  The pinned state.
3973  */
3974 ir_node *new_Div    (ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state);
3975
3976 /** Constructor for a remainderless Div node.
3977  *
3978  * Adds the node to the block in current_ir_block.
3979  *
3980  * @param   *memop The store needed to model exceptions
3981  * @param   *op1   The first operand.
3982  * @param   *op2   The second operand.
3983  * @param   *mode  The mode of the result.
3984  * @param   state  The pinned state.
3985  */
3986 ir_node *new_DivRL  (ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state);
3987
3988 /** Constructor for a Mod node.
3989  *
3990  * Adds the node to the block in current_ir_block.
3991  *
3992  * @param   *memop The store needed to model exceptions
3993  * @param   *op1   The first operand.
3994  * @param   *op2   The second operand.
3995  * @param   *mode  The mode of the result.
3996  * @param   state  The pinned state.
3997  */
3998 ir_node *new_Mod    (ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state);
3999
4000 /** Constructor for a Abs node.
4001  *
4002  * Adds the node to the block in current_ir_block.
4003  *
4004  * @param   *op    The operand
4005  * @param   *mode  The mode of the operands and the result.
4006  */
4007 ir_node *new_Abs    (ir_node *op,                ir_mode *mode);
4008
4009 /** Constructor for a And node.
4010  *
4011  * Adds the node to the block in current_ir_block.
4012  *
4013  * @param   *op1   The first operand.
4014  * @param   *op2   The second operand.
4015  * @param   *mode  The mode of the operands and the result.
4016  */
4017 ir_node *new_And    (ir_node *op1, ir_node *op2, ir_mode *mode);
4018
4019 /**
4020  * Constructor for a Or node. Adds the node to the block in current_ir_block.
4021  *
4022  * @param   *op1   The first operand.
4023  * @param   *op2   The second operand.
4024  * @param   *mode  The mode of the operands and the result.
4025  */
4026 ir_node *new_Or     (ir_node *op1, ir_node *op2, ir_mode *mode);
4027
4028 /**
4029  * Constructor for a Eor node. Adds the node to the block in current_ir_block.
4030  *
4031  * @param   *op1   The first operand.
4032  * @param   *op2   The second operand.
4033  * @param   *mode  The mode of the operands and the results.
4034  */
4035 ir_node *new_Eor    (ir_node *op1, ir_node *op2, ir_mode *mode);
4036
4037 /** Constructor for a Not node.
4038  *
4039  * Adds the node to the block in current_ir_block.
4040  *
4041  * @param   *op    The operand.
4042  * @param   *mode  The mode of the operand and the result.
4043  */
4044 ir_node *new_Not    (ir_node *op,                ir_mode *mode);
4045
4046 /** Constructor for a Shl node.
4047  *
4048  * Adds the node to the block in current_ir_block.
4049  *
4050  * @param   *op    The operand.
4051  * @param   *k     The number of bits to  shift the operand .
4052  * @param   *mode  The mode of the operand and the result.
4053  */
4054 ir_node *new_Shl    (ir_node *op,  ir_node *k,   ir_mode *mode);
4055
4056 /**
4057  * Constructor for a Shr node. Adds the node to the block in current_ir_block.
4058  *
4059  * @param   *op    The operand.
4060  * @param   *k     The number of bits to  shift the operand .
4061  * @param   *mode  The mode of the operand and the result.
4062  */
4063 ir_node *new_Shr    (ir_node *op,  ir_node *k,   ir_mode *mode);
4064
4065 /** Constructor for a Shrs node.
4066  *
4067  * Adds the node to the block in current_ir_block.
4068  *
4069  * @param   *op    The operand.
4070  * @param   *k     The number of bits to  shift the operand .
4071  * @param   *mode  The mode of the operand and the result.
4072  */
4073 ir_node *new_Shrs   (ir_node *op,  ir_node *k,   ir_mode *mode);
4074
4075 /** Constructor for a Rotl node.
4076  *
4077  * Adds the node to the block in current_ir_block.
4078  *
4079  * @param   *op    The operand.
4080  * @param   *k     The number of bits to rotate the operand.
4081  * @param   *mode  The mode of the operand.
4082  */
4083 ir_node *new_Rotl   (ir_node *op,  ir_node *k,   ir_mode *mode);
4084
4085 /** Constructor for a Cmp node.
4086  *
4087  * Adds the node to the block in current_ir_block.
4088  *
4089  * @param   *op1   The first operand.
4090  * @param   *op2   The second operand.
4091  */
4092 ir_node *new_Cmp    (ir_node *op1, ir_node *op2);
4093
4094 /** Constructor for a Conv node.
4095  *
4096  * Adds the node to the block in current_ir_block.
4097  *
4098  * @param   *op          The operand.
4099  * @param   *mode        The mode of this the operand muss be converted.
4100  */
4101 ir_node *new_Conv   (ir_node *op, ir_mode *mode);
4102
4103 /** Constructor for a strict Conv node.
4104  *
4105  * Adds the node to the block in current_ir_block.
4106  *
4107  * @param   *op          The operand.
4108  * @param   *mode        The mode of this the operand muss be converted.
4109  */
4110 ir_node *new_strictConv   (ir_node *op, ir_mode *mode);
4111
4112 /** Constructor for a Cast node.
4113  *
4114  * Adds the node to the block in current_ir_block.
4115  * High level type cast
4116  *
4117  * @param   *op    The operand.
4118  * @param   *to_tp The type of this the operand muss be casted .
4119  */
4120 ir_node *new_Cast   (ir_node *op, ir_type *to_tp);
4121
4122 /** Constructor for a Carry node.
4123  *
4124  * Adds the node to the block in current_ir_block.
4125  *
4126  * @param   *op1   The first operand.
4127  * @param   *op2   The second operand.
4128  * @param   *mode  The mode of the operands and the result.
4129  */
4130 ir_node *new_Carry  (ir_node *op1, ir_node *op2, ir_mode *mode);
4131
4132 /** Constructor for a Borrow node.
4133  *
4134  * Adds the node to the block in current_ir_block.
4135  *
4136  * @param   *op1   The first operand.
4137  * @param   *op2   The second operand.
4138  * @param   *mode  The mode of the operands and the result.
4139  */
4140 ir_node *new_Borrow (ir_node *op1, ir_node *op2, ir_mode *mode);
4141
4142 /** Constructor for a Phi node.
4143  *
4144  * Adds the node to the block in current_ir_block.
4145  *
4146  * @param arity  The number of predecessors.
4147  * @param *in    Array with predecessors.
4148  * @param *mode  The mode of it's inputs and output.
4149  */
4150 ir_node *new_Phi    (int arity, ir_node *in[], ir_mode *mode);
4151
4152 /** Constructor for a Load node.
4153  *
4154  * @param *store  The current memory.
4155  * @param *addr   A pointer to the variable to be read in this memory.
4156  * @param *mode   The mode of the value to be loaded.
4157  */
4158 ir_node *new_Load   (ir_node *store, ir_node *addr, ir_mode *mode);
4159
4160 /** Constructor for a Store node.
4161  *
4162  * @param *store  The current memory.
4163  * @param *addr   A pointer to the variable to be read in this memory.
4164  * @param *val    The value to write to this variable.
4165  */
4166 ir_node *new_Store  (ir_node *store, ir_node *addr, ir_node *val);
4167
4168 /** Constructor for a Alloc node.
4169  *
4170  * The Alloc node extends the memory by space for an entity of type alloc_type.
4171  * Adds the node to the block in current_ir_block.
4172  *
4173  * @param *store      The memory which shall contain the new variable.
4174  * @param *size       The number of bytes to allocate.
4175  * @param *alloc_type The type of the allocated variable.
4176  * @param where       Where to allocate the variable, either heap_alloc or stack_alloc.
4177  */
4178 ir_node *new_Alloc  (ir_node *store, ir_node *size, ir_type *alloc_type,
4179                      ir_where_alloc where);
4180
4181 /** Constructor for a Free node.
4182  *
4183  * Frees the memory occupied by the entity pointed to by the pointer
4184  * arg.  Type indicates the type of the entity the argument points to.
4185  * Adds the node to the block in current_ir_block.
4186  *
4187  * @param *store      The memory which shall contain the new variable.
4188  * @param *ptr        The pointer to the object to free.
4189  * @param *size       The number of objects of type free_type to free in a sequence.
4190  * @param *free_type  The type of the freed variable.
4191  * @param where       Where the variable was allocated, either heap_alloc or stack_alloc.
4192  */
4193 ir_node *new_Free   (ir_node *store, ir_node *ptr, ir_node *size,
4194                              ir_type *free_type, ir_where_alloc where);
4195
4196 /** Constructor for a Sync node.
4197  *
4198  * Merges several memory values.  The node assumes that a variable
4199  * either occurs only in one of the memories, or it contains the same
4200  * value in all memories where it occurs.
4201  * Adds the node to the block in current_ir_block.
4202  *
4203  * @param  arity    The number of memories to synchronize.
4204  * @param  **in     An array of pointers to nodes that produce an output of type
4205  *                  memory.  The constructor copies this array.
4206  */
4207 ir_node *new_Sync   (int arity, ir_node *in[]);
4208
4209 /** Constructor for a Proj node.
4210  *
4211  * Projects a single value out of a tuple.  The parameter proj gives the
4212  * position of the value within the tuple.
4213  * Adds the node to the block in current_ir_block.
4214  *
4215  * @param arg    A node producing a tuple.
4216  * @param *mode  The mode of the value to project.
4217  * @param proj   The position of the value in the tuple.
4218  */
4219 ir_node *new_Proj   (ir_node *arg, ir_mode *mode, long proj);
4220
4221 /** Constructor for a Filter node.
4222  *
4223  * Constructor for a Filter node. Adds the node to the block in current_ir_block.
4224  * Filter is a node with two views used to construct the interprocedural view.
4225  * In intraprocedural view its semantics are identical to the Proj node.
4226  * In interprocedural view the Filter performs the Phi operation on method
4227  * parameters or results.  Other than a Phi a Filter node may not be removed
4228  * if it has only a single input.
4229  *
4230  * The constructor builds the Filter in intraprocedural view.
4231  *
4232  * @param *arg  The tuple value to project from.
4233  * @param *mode The mode of the projected value.
4234  * @param proj  The position in the tuple to project from.
4235  */
4236 ir_node *new_Filter (ir_node *arg, ir_mode *mode, long proj);
4237
4238 /** Constructor for a defaultProj node.
4239  *
4240  * Represents the default control flow of a Switch-Cond node.
4241  * Adds the node to the block in current_ir_block.
4242  *
4243  * @param arg       A node producing a tuple.
4244  * @param max_proj  The end  position of the value in the tuple.
4245  */
4246 ir_node *new_defaultProj (ir_node *arg, long max_proj);
4247
4248 /** Constructor for a Tuple node.
4249  *
4250  * This is an auxiliary node to replace a node that returns a tuple
4251  * without changing the corresponding Proj nodes.
4252  * Adds the node to the block in current_ir_block.
4253  *
4254  * @param arity   The number of tuple elements.
4255  * @param **in    An array containing pointers to the nodes producing the tuple elements.
4256  */
4257 ir_node *new_Tuple  (int arity, ir_node *in[]);
4258
4259 /** Constructor for an Id node.
4260  *
4261  * This is an auxiliary node to replace a node that returns a single
4262  * value. Adds the node to the block in current_ir_block.
4263  *
4264  * @param *val    The operand to Id.
4265  * @param *mode   The mode of *val.
4266  */
4267 ir_node *new_Id     (ir_node *val, ir_mode *mode);
4268
4269 /** Constructor for a Bad node.
4270  *
4271  * Returns the unique Bad node of the graph.  The same as
4272  * get_irg_bad().
4273  */
4274 ir_node *new_Bad    (void);
4275
4276 /** Constructor for a Confirm node.
4277  *
4278  * Specifies constraints for a value.  To support dataflow analyses.
4279  * Adds the node to the block in current_ir_block.
4280  *
4281  * Example: If the value never exceeds '100' this is expressed by placing a
4282  * Confirm node val = new_d_Confirm(db, val, 100, '<=') on the dataflow edge.
4283  *
4284  * @param *val    The value we express a constraint for
4285  * @param *bound  The value to compare against. Must be a firm node, typically a constant.
4286  * @param cmp     The compare operation.
4287  */
4288 ir_node *new_Confirm (ir_node *val, ir_node *bound, pn_Cmp cmp);
4289
4290 /** Constructor for an Unknown node.
4291  *
4292  * Represents an arbitrary value.  Places the node in
4293  * the start block.
4294  *
4295  * @param *m      The mode of the unknown value.
4296  */
4297 ir_node *new_Unknown(ir_mode *m);
4298
4299 /** Constructor for a NoMem node.
4300  *
4301  * Returns the unique NoMem node of the graph.  The same as
4302  * get_irg_no_mem().
4303  */
4304 ir_node *new_NoMem  (void);
4305
4306 /** Constructor for a Mux node.
4307  *
4308  * Adds the node to the block in current_ir_block.
4309  *
4310  * @param *sel      The ir_node that calculates the boolean select.
4311  * @param *ir_true  The ir_node that calculates the true result.
4312  * @param *ir_false The ir_node that calculates the false result.
4313  * @param *mode     The mode of the node (and it_true and ir_false).
4314  */
4315 ir_node *new_Mux  (ir_node *sel, ir_node *ir_false, ir_node *ir_true, ir_mode *mode);
4316
4317 /** Constructor for a CopyB node.
4318  *
4319  * Adds the node to the block in current_ir_block.
4320  *
4321  * @param *store      The current memory
4322  * @param *dst        The ir_node that represents the destination address.
4323  * @param *src        The ir_node that represents the source address.
4324  * @param *data_type  The type of the copied data
4325  */
4326 ir_node *new_CopyB(ir_node *store, ir_node *dst, ir_node *src, ir_type *data_type);
4327
4328 /** Constructor for a InstOf node.
4329  *
4330  * A High-Level Type check.
4331  *
4332  * @param   *store     The memory in which the object the entity should be selected
4333  *                     from is allocated.
4334  * @param   *objptr    A pointer to a object of a class type.
4335  * @param   *type      The type of which objptr must be.
4336  */
4337 ir_node *new_InstOf (ir_node *store, ir_node *objptr, ir_type *type);
4338
4339 /**Constructor for a Raise node.
4340  *
4341  * A High-Level Exception throw.
4342  *
4343  * @param *store The current memory.
4344  * @param *obj   A pointer to the Except variable.
4345  */
4346 ir_node *new_Raise  (ir_node *store, ir_node *obj);
4347
4348 /** Constructor for a Bound node.
4349  *
4350  * A High-Level bounds check. Checks whether lower <= idx && idx < upper.
4351  *
4352  * Adds the node to the block in current_ir_block.
4353  *
4354  * @param *store      The current memory
4355  * @param *idx        The ir_node that represents an index.
4356  * @param *lower      The ir_node that represents the lower bound for the index.
4357  * @param *upper      The ir_node that represents the upper bound for the index.
4358  */
4359 ir_node *new_Bound  (ir_node *store, ir_node *idx, ir_node *lower, ir_node *upper);
4360
4361 /** Constructor for a Pin node.
4362  *
4363  * @param *node       The node which value should be pinned.
4364  */
4365 ir_node *new_Pin    (ir_node *node);
4366
4367 /** Constructor for an ASM pseudo node.
4368  *
4369  * @param arity       The number of data inputs to the node.
4370  * @param *in         The array of length arity of data inputs.
4371  * @param *inputs     The array of length arity of input constraints.
4372  * @param n_outs      The number of data outputs to the node.
4373  * @param *outputs    The array of length n_outs of output constraints.
4374  * @param n_clobber   The number of clobbered registers.
4375  * @param *clobber    The array of length n_clobber of clobbered registers.
4376  * @param *asm_text   The assembler text.
4377  */
4378 ir_node *new_ASM(int arity, ir_node *in[], ir_asm_constraint *inputs,
4379                  int n_outs, ir_asm_constraint *outputs,
4380                  int n_clobber, ident *clobber[], ident *asm_text);
4381
4382 /*---------------------------------------------------------------------*/
4383 /* The comfortable interface.                                          */
4384 /* Supports automatic Phi node construction.                           */
4385 /* All routines of the block oriented interface except new_Block are   */
4386 /* needed also.                                                        */
4387 /*---------------------------------------------------------------------*/
4388
4389 /** Create an immature Block.
4390  *
4391  * An immature Block has an unknown number of predecessors.  Predecessors
4392  * can be added with add_immBlock_pred().  Once all predecessors are
4393  * added the block must be matured.
4394  *
4395  * Adds the block to the graph in current_ir_graph. Can be used with automatic
4396  * Phi node construction.
4397  * This constructor can only be used if the graph is in state_building.
4398  */
4399 ir_node *new_d_immBlock(dbg_info *db);
4400 ir_node *new_immBlock(void);
4401
4402 /** Create an immature PartBlock.
4403  *
4404  * An immature block has only one Block or PartBlock predecessor.
4405  * A PartBlock forms together with one BLock and possibly other
4406  * PartBlocks a MacroBlock.
4407  *
4408  * Adds the PartBlock to the graph in current_ir_graph. Does set
4409  * current_block.  Can be used with automatic Phi node construction.
4410  * This constructor can only be used if the graph is in
4411  * state_building.
4412  */
4413 ir_node *new_d_immPartBlock(dbg_info *db, ir_node *pred_jmp);
4414 ir_node *new_immPartBlock(ir_node *pred_jmp);
4415
4416 /** Add a control flow edge to an immature block. */
4417 void add_immBlock_pred(ir_node *immblock, ir_node *jmp);
4418
4419 /** Finalize a Block node, when all control flows are known. */
4420 void mature_immBlock(ir_node *block);
4421 #define mature_cur_block() mature_immBlock(get_cur_block());
4422
4423
4424 /** Get the current value of a local variable.
4425  *
4426  * Use this function to obtain the last definition of the local variable
4427  * associated with pos.  Pos may not exceed the value passed as n_loc
4428  * to new_ir_graph.  This call automatically inserts Phi nodes.
4429  *
4430  * @param *db    A pointer for debug information.
4431  * @param  pos   The position/id of the local variable.
4432  * @param *mode  The mode of the value to get.
4433  */
4434 ir_node *get_d_value(dbg_info *db, int pos, ir_mode *mode);
4435 ir_node *get_value(int pos, ir_mode *mode);
4436
4437 /** Remark a new definition of a variable.
4438  *
4439  * Use this function to remember a new definition of the value
4440  * associated with pos. Pos may not exceed the value passed as n_loc
4441  * to new_ir_graph.  This call is needed to automatically inserts Phi
4442  * nodes.
4443  *
4444  * @param  pos   The position/id of the local variable.
4445  * @param *value The new value written to the local variable.
4446  */
4447 void set_value(int pos, ir_node *value);
4448
4449 /** Find the value number for a node in the current block.
4450  *
4451  * This function searches all values in the current block for
4452  * a given value and returns its value number if it was found, else
4453  * -1.
4454  * Note that this does not mean that the value does not exists,
4455  * it's just not equal the node (for instance behind a Phi/Confirm ...)
4456  *
4457  * @param *value The value to find.
4458  */
4459 int find_value(ir_node *value);
4460
4461 /** Get the current memory state.
4462  *
4463  * Use this function to obtain the last definition of the memory
4464  * state.  This call automatically inserts Phi nodes for the memory
4465  * state value.
4466  */
4467 ir_node *get_store(void);
4468
4469 /** Remark a new definition of the memory state.
4470  *
4471  * Use this function to remember a new definition of the memory state.
4472  * This call is needed to automatically inserts Phi nodes.
4473  *
4474  * @param *store The new memory state.
4475  */
4476 void set_store(ir_node *store);
4477
4478 /** keep this node alive even if End is not control-reachable from it
4479  *
4480  * @param ka The node to keep alive.
4481  */
4482 void keep_alive(ir_node *ka);
4483
4484 /** Returns the frame type of the current graph */
4485 ir_type *get_cur_frame_type(void);
4486
4487
4488 /* --- initialize and finalize IR construction --- */
4489
4490 /** Puts the graph into state "phase_high" */
4491 #define irg_finalize_cons(irg) set_irg_phase_state(irg, phase_high)
4492
4493 /** Puts the program and all graphs into state phase_high.
4494  *
4495  * This also remarks, the construction of types is finished,
4496  * e.g., that no more subtypes will be added.  */
4497 void irp_finalize_cons(void);
4498
4499 /* --- Initialization --- */
4500
4501 #endif