1 /* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
2 ** All rights reserved.
4 ** Authors: Martin Trapp, Christian Schaefer
6 ** irgraph.h: ir graph construction
12 /* # include "lib/obstack.h" */
20 /* ir_graph holds all information for a procedure */
22 struct entity *ent; /* The entity of this procedure, i.e., the
23 type of the procedure and the class it
25 struct ir_node *start_block; /* block the start node will belong to */
26 struct ir_node *start; /* start node of this ir_graph */
27 struct ir_node *end_block; /* block the end node will belong to */
28 struct ir_node *end; /* end node of this ir_graph */
29 struct ir_node *cstore; /* constant store */
30 struct ir_node *frame; /* method's frame */
32 struct ir_node *dataseg; /* pointer to the data segment */
34 struct ir_node *args; /* methods arguments */
35 struct ir_node *bad; /* bad node of this ir_graph, the one and
37 struct obstack *obst; /* obstack where all of the ir_nodes live */
38 #if USE_EXPICIT_PHI_IN_STACK
39 struct Phi_in_stack *Phi_in_stack; /* needed for automatic Phi construction */
41 struct ir_node *current_block; /* block for newly gen_*()-erated ir_nodes */
42 int params; /* number of local variable in this procedure */
43 // should be n_loc or so, params is ambiguous.
44 pset *value_table; /* value table for global value numbering
45 for optimizing use in iropt.c */
48 extern ir_graph *current_ir_graph;
50 /* create a new ir graph */
51 ir_graph *new_ir_graph (entity *ent, int params);
53 extern unsigned long ir_visited;
54 extern unsigned long block_visited;
56 /* access routines for all ir_graph attributes */
58 ir_node *get_start_block_of_irgraph (ir_graph *irg);
59 void set_start_block_of_irgraph (ir_graph *irg, ir_node *node);
61 ir_node *get_start_of_irgraph (ir_graph *irg);
62 void set_start_of_irgraph(ir_graph *irg, ir_node *node);
64 ir_node *get_end_block_of_irgraph (ir_graph *irg);
65 void set_end_block_of_irgraph (ir_graph *irg, ir_node *node);
67 ir_node *get_end_of_irgraph (ir_graph *irg);
68 void set_end_of_irgraph (ir_graph *irg, ir_node *node);
70 ir_node *get_cstore_of_irgraph (ir_graph *irg);
71 void set_cstore_of_irgraph (ir_graph *irg, ir_node *node);
73 ir_node *get_frame_of_irgraph (ir_graph *irg);
74 void set_frame_of_irgraph (ir_graph *irg, ir_node *node);
76 ir_node *get_args_of_irgraph (ir_graph *irg);
77 void set_args_of_irgraph (ir_graph *irg, ir_node *node);
79 ir_node *get_bad_of_irgraph (ir_graph *irg);
80 void set_bad_of_irgraph (ir_graph *irg, ir_node *node);
82 /* not implemented yet
83 struct obstack *get_obst_of_irgraph (ir_graph *irg);
84 void set_obst_of_irgraph (ir_graph *irg, struct obstack *obst);
87 ir_node *get_current_block_of_irgraph (ir_graph *irg);
88 void set_current_block_of_irgraph (ir_graph *irg, ir_node *node);
90 entity *get_ent_of_irgraph (ir_graph *irg);
91 void set_ent_of_irgraph (ir_graph *irg, entity *ent);
93 int get_params_of_irgraph (ir_graph *irg);
94 void set_params_of_irgraph (ir_graph *irg, int params);
96 # endif /* _IRGRAPH_H_ */