3 #include "pseudo_irg.h"
10 /** Returns the number of pseudo graphs in the program. */
11 int get_irp_n_pseudo_irgs(void) {
12 return ARR_LEN(irp->pseudo_graphs);
15 /** Returns the number of pseudo graphs in the program. */
16 ir_graph *get_irp_pseudo_irg(int pos) {
17 return irp->pseudo_graphs[pos];
20 void add_irp_pseudo_irg(ir_graph *irg) {
21 ARR_APP1(ir_graph *, irp->pseudo_graphs, irg);
25 /* Create a new ir graph to build a pseudo representation of a procedure.
27 * The pseudo representation can only be used for analyses. It may not be
28 * optimized. Pseudo graphs are kept in a separate graph list in irprog.
31 new_pseudo_ir_graph(entity *ent, int n_loc) {
32 ir_graph *res = new_r_ir_graph (ent, n_loc);
33 add_irp_irg(res); /* remember this graph global. */
37 /** Returns true ir ir_graph is pseudo graph. */
38 int is_pseudo_ir_graph(ir_graph *irg)
40 assert(irg && "nothing here");
41 assert(is_ir_graph(irg) && "no ir_graph given");
43 int i, n_pseudo_irgs = get_irp_n_pseudo_irgs();
44 for (i = 0; i < n_pseudo_irgs; ++i) {
45 if (irg == get_irp_pseudo_irg(i)) return true;
50 static int visit_pseudo_irgs = 0;
52 void set_visit_pseudo_irgs(int x) {
53 visit_pseudo_irgs = x;
56 int get_visit_pseudo_irgs(void) {
57 return visit_pseudo_irgs;