3 #include "pseudo_irg.h"
10 /** Returns the number of pseudo graphs in the program. */
11 int get_irp_n_pseudo_irgs(void) {
12 assert (irp && irp->pseudo_graphs);
13 return ARR_LEN(irp->pseudo_graphs);
16 /** Returns the number of pseudo graphs in the program. */
17 ir_graph *get_irp_pseudo_irg(int pos) {
18 assert(0 <= pos && pos <= get_irp_n_pseudo_irgs());
19 return irp->pseudo_graphs[pos];
22 void add_irp_pseudo_irg(ir_graph *irg) {
23 assert (irp && irp->pseudo_graphs);
24 ARR_APP1(ir_graph *, irp->pseudo_graphs, irg);
28 /* Create a new ir graph to build a pseudo representation of a procedure.
30 * The pseudo representation can only be used for analyses. It may not be
31 * optimized. Pseudo graphs are kept in a separate graph list in irprog.
34 new_pseudo_ir_graph(entity *ent, int n_loc) {
35 ir_graph *res = new_r_ir_graph (ent, n_loc);
36 add_irp_pseudo_irg(res); /* remember this graph global. */
40 /** Returns true ir ir_graph is pseudo graph. */
41 int is_pseudo_ir_graph(ir_graph *irg)
43 assert(irg && "nothing here");
44 assert(is_ir_graph(irg) && "no ir_graph given");
46 int i, n_pseudo_irgs = get_irp_n_pseudo_irgs();
47 for (i = 0; i < n_pseudo_irgs; ++i) {
48 if (irg == get_irp_pseudo_irg(i)) return true;
53 static int visit_pseudo_irgs = 0;
55 void set_visit_pseudo_irgs(int x) {
56 visit_pseudo_irgs = x;
59 int get_visit_pseudo_irgs(void) {
60 return visit_pseudo_irgs;