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