+/* Removes irg from the list or irgs, shrinks the list by one. */
+void remove_irp_irg(ir_graph *irg){
+ int i;
+ assert(irg);
+ free_ir_graph(irg);
+ for (i = 1; i < (ARR_LEN (irp->graphs)); i++) {
+ if (irp->graphs[i] == irg) {
+ for(; i < (ARR_LEN (irp->graphs)) - 1; i++) {
+ irp->graphs[i] = irp->graphs[i+1];
+ }
+ ARR_SETLEN(ir_graph*, irp->graphs, (ARR_LEN(irp->graphs)) - 1);
+ break;
+ }
+ }
+}
+
+int get_irp_n_irgs() {
+ assert (irp && irp->graphs);
+ /* Strangely the first element of the array is NULL. Why?? */
+ return (ARR_LEN((irp)->graphs) - 1);
+}
+
+ir_graph *get_irp_irg(int pos){
+ assert (irp && irp->graphs);
+ /* Strangely the first element of the array is NULL. Why?? */
+ return irp->graphs[pos+1];
+}
+
+void set_irp_irg(int pos, ir_graph *irg) {
+ assert (irp && irg);
+ assert (pos < (ARR_LEN((irp)->graphs) - 1));
+ /* Strangely the first element of the array is NULL. Why?? */
+ irp->graphs[pos+1] = irg;
+}
+