1 /* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
2 ** All rights reserved.
4 ** Authors: Martin Trapp, Christian Schaefer
6 ** irgraph.h: ir graph construction
13 /* to resolve recursion between irnode.h and irgraph.h */
14 #ifndef _IR_NODE_TYPEDEF_
15 #define _IR_NODE_TYPEDEF_
16 typedef struct ir_node ir_node;
19 /* to resolve recursion between entity.h and irgraph.h */
20 #ifndef _IR_GRAPH_TYPEDEF_
21 #define _IR_GRAPH_TYPEDEF_
22 typedef struct ir_graph ir_graph;
25 /* Global variable holding the current_ir_graph. This global variable
26 is used by the ir construction interface in ircons and by the
28 extern ir_graph *current_ir_graph;
30 /* Create a new ir graph to built ir for a procedure.
31 ent is the entity representing this procedure, i.e., the type of the
32 entity must be type_method. The constructor automatically sets the
33 field irg of the entity to the new ir graph.
34 n_loc is the number of local variables in this procedure including
35 the procedure parameters. */
36 ir_graph *new_ir_graph (entity *ent, int n_loc);
38 /* access routines for all ir_graph attributes */
39 ir_node *get_irg_start_block (ir_graph *irg);
40 void set_irg_start_block (ir_graph *irg, ir_node *node);
42 ir_node *get_irg_start (ir_graph *irg);
43 void set_irg_start (ir_graph *irg, ir_node *node);
45 ir_node *get_irg_end_block (ir_graph *irg);
46 void set_irg_end_block (ir_graph *irg, ir_node *node);
48 ir_node *get_irg_end (ir_graph *irg);
49 void set_irg_end (ir_graph *irg, ir_node *node);
51 ir_node *get_irg_cstore (ir_graph *irg);
52 void set_irg_cstore (ir_graph *irg, ir_node *node);
54 ir_node *get_irg_frame (ir_graph *irg);
55 void set_irg_frame (ir_graph *irg, ir_node *node);
57 ir_node *get_irg_globals (ir_graph *irg);
58 void set_irg_globals (ir_graph *irg, ir_node *node);
60 ir_node *get_irg_args (ir_graph *irg);
61 void set_irg_args (ir_graph *irg, ir_node *node);
63 /* Use new_Bad() instead!! */
64 ir_node *get_irg_bad (ir_graph *irg);
65 void set_irg_bad (ir_graph *irg, ir_node *node);
67 ir_node *get_irg_current_block (ir_graph *irg);
68 void set_irg_current_block (ir_graph *irg, ir_node *node);
70 entity *get_irg_ent (ir_graph *irg);
71 void set_irg_ent (ir_graph *irg, entity *ent);
73 /* Use not encouraged, internal of Phi construction algorithm. */
74 int get_irg_n_loc (ir_graph *irg);
75 void set_irg_n_loc (ir_graph *irg, int n_loc);
77 /* increments visited by one */
78 void inc_irg_visited(ir_graph *irg);
79 unsigned long get_irg_visited (ir_graph *irg);
80 void set_irg_visited(ir_graph *irg, unsigned long i);
82 /* increments block_visited by one */
83 void inc_irg_block_visited(ir_graph *irg);
84 unsigned long get_irg_block_visited (ir_graph *irg);
85 void set_irg_block_visited(ir_graph *irg, unsigned long i);
87 # endif /* _IRGRAPH_H_ */