Changed comment to free_ir_graph.
[r247]
/* Frees the passed irgraph.
Deallocates all nodes in this graph and the ir_graph structure.
Sets the field irgraph in the corresponding entity to NULL.
+ Does not remove the irgraph from the list in irprog (requires
+ inefficient search, call remove_irp_irg by hand).
Does not free types, entities or modes that are used only by this
graph, nor the entity standing for this graph. */
void free_ir_graph (ir_graph *irg) {
/* Frees the passed irgraph.
Deallocates all nodes in this graph and the ir_graph structure.
Sets the field irgraph in the corresponding entity to NULL.
+ Does not remove the irgraph from the list in irprog (requires
+ inefficient search, call remove_irp_irg by hand).
Does not free types, entities or modes that are used only by this
graph, nor the entity standing for this graph. */
void free_ir_graph (ir_graph *irg);
}
/* Adds irg to the list of ir graphs in irp. */
-void add_irp_irg(ir_graph *irg) {
+void add_irp_irg(ir_graph *irg) {
assert (irg != NULL);
assert(irp && irp->graphs);
ARR_APP1 (ir_graph *, irp->graphs, irg);
}
+/* Removes irg from the list or irgs, shrinks the list by one.
+ @@@ does not work properly. */
+void remove_irp_irg(ir_graph *irg){
+ int i;
+ assert(irg);
+ for (i = 1; i < (ARR_LEN (irp->graphs))-1; i++)
+ if (irp->graphs[i+1] == irg) {
+ for(i++; 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?? */
/* Adds irg to the list of ir graphs in irp. */
void add_irp_irg(ir_graph *irg);
+/* Removes irg from the list or irgs, shrinks the list by one.
+ @@@ does not work properly. */
+void remove_irp_irg(ir_graph *irg);
int get_irp_n_irgs();
ir_graph *get_irp_irg(int pos);
void set_irp_irg(int pos, ir_graph *irg);