CopyB node constructors added
[libfirm] / ir / ir / irgopt.h
index 7faaa31..910cbc3 100644 (file)
@@ -33,7 +33,7 @@ void local_optimize_node(ir_node *n);
  *
  * @param irg  The graph to be optimized.
  *
- * After appliying local_optimize_graph() to a IR-graph, Bad nodes
+ * After applying local_optimize_graph() to a IR-graph, Bad nodes
  * only occure as predecessor of Block and Phi nodes.
  */
 void local_optimize_graph (ir_graph *irg);
@@ -54,9 +54,6 @@ void local_optimize_graph (ir_graph *irg);
  *  Removes old attributes of nodes.  Sets link field to NULL.
  *  Callee information must be freed (irg_callee_info_none).
  *
- *  Attention: the numbers assigned to nodes if the library is compiled for
- *  development/debugging are not conserved by copying.
- *
  * @param irg  The graph to be optimized.
  */
 void dead_node_elimination(ir_graph *irg);
@@ -67,6 +64,8 @@ void dead_node_elimination(ir_graph *irg);
  * inputs to Phi nodes as in dead_node_elimination but without
  * copying the graph.
  *
+ * Conserves loop information.
+ *
  * @param irg  The graph to be optimized.
  */
 void remove_bad_predecessors(ir_graph *irg);
@@ -175,4 +174,19 @@ void place_code(ir_graph *irg);
  */
 void remove_critical_cf_edges(ir_graph *irg);
 
+/**
+ * Copies a node to the current_ir_graph. The Ins of the new node point to
+ * the predecessors on the graph of the old node.  For block/phi nodes not all
+ * predecessors might be copied.
+ * For Phi and Block nodes the function allocates in-arrays with an arity
+ * only for useful predecessors.  The arity is determined by counting
+ * the non-bad predecessors of the block.
+ * Does NOT copy Bad nodes, as these are "local" to the graph.
+ * Use get_irg_bad() instead.
+ *
+ * @param n             The node to be copied
+ * @param copy_node_nr  if non-NULL, the node number attribute will be copied to the new node
+ */
+ir_node *copy_irn(ir_node *n, int copy_node_nr);
+
 # endif /* _IRGOPT_H_ */