Initial revision
[libfirm] / ir / ir / irgmod.h
1 /* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
2 ** All rights reserved.
3 **
4 ** Authors: Martin Trapp, Christian Schaefer
5 **
6 ** irgmod.h: ir graph modification*/
7
8 # include "irgraph.h"
9 # include "ircons.h"
10 # include "array.h"
11 # include "misc.h"
12
13 /* ir_node *arg_access (ir_mode *mode, long proj); */
14
15
16 inline ir_node *get_r_value_internal (ir_node *block, int pos, ir_mode *mode);
17
18
19 /** Needed only during ir_graph construction. Should all go into
20     ircons.ch **/
21
22 /* Read a store.
23    Use this function to get the most recent version of the store (type M).
24    Internally it does the same as get_value. */
25 ir_node *get_store (void);
26
27 /* write a store */
28 void set_store (ir_node *store);
29
30 /* add a control flow edge */
31 void add_in_edge (ir_node *block, ir_node *jmp);
32
33 /* read a value from the array with the local variables */
34 ir_node *get_value (int pos, ir_mode *mode);
35
36 /* write a value in the array with the local variables */
37 void set_value (int pos, ir_node *value);
38
39 /* fixes the number of predecessors of a block. */
40 void mature_block (ir_node *block);
41
42 /* sets current block */
43 void switch_block (ir_node *target);
44
45
46 /** always useful, e.g. for optimizations.  **/
47 /* turns a node into a tuple. The tuples predecessors have to be
48    set by hand. */
49 void turn_into_tuple (ir_node *node, int arity);
50
51 /* exchanges two nodes by conserving edges leaving old (i.e., pointers
52    pointing to old. */
53 inline void exchange (ir_node *old, ir_node *new);