gas on cygwin doesn't like section type (althought that's not what the docu says...
[libfirm] / ir / common / irtools.h
index 7447d39..afa6e7f 100644 (file)
@@ -82,75 +82,43 @@ void firm_clear_link(ir_node *n, void *env);
 void firm_clear_node_and_phi_links(ir_node *n, void *env);
 
 /**
- * Copies a node to a new irg. The Ins of the new node point to
- * the predecessors on the old irg.  n->link points to the new node.
+ * Creates an exact copy of a node with same inputs and attributes in the
+ * same block.
  *
- * @param n    The node to be copied
- * @param irg  the new irg
- *
- * Does NOT copy standard nodes like Start, End etc that are fixed
- * in an irg. Instead, the corresponding nodes of the new irg are returned.
- * Note further, that the new nodes have no block.
+ * @param node   the node to copy
  */
-void copy_irn_to_irg(ir_node *n, ir_graph *irg);
+ir_node *exact_copy(const ir_node *node);
 
 /**
- * Creates an exact copy of a node.
- * The copy resists on the same graph in the same block.
- *
- * @param n   the node to copy
- *
- * @note If the copy is not changed, the next CSE operation will
- *       replace it by the original, so beware.
+ * Create an exact copy of a node with same inputs and attributes in the same
+ * block but puts the node on a graph which might be different than the graph
+ * of the original node.
+ * Note: You have to fixup the inputs/block later
  */
-ir_node *exact_copy(const ir_node *n);
+ir_node *irn_copy_into_irg(const ir_node *node, ir_graph *irg);
 
 /**
- * Creates an ir_graph pass for running void function(ir_graph *irg).
- * Uses the default verifier and dumper.
- * The pass returns always 0.
- *
- * @param name      the name of this pass
- * @param verify    should this pass be verified?
- * @param dump      should this pass result be dumped?
- * @param function  the function to run
+ * This is a helper function used by some routines copying irg graphs
+ * This assumes that we have "old" nodes which have been copied to "new"
+ * nodes; The inputs of the new nodes still point to old nodes.
  *
- * @return  the newly created ir_graph pass
+ * Given an old(!) node this function rewires the matching new_node
+ * so that all its inputs point to new nodes afterwards.
  */
-ir_graph_pass_t *def_graph_pass(
-       const char *name, int verify, int dump,
-       void (*function)(ir_graph *irg));
+void irn_rewire_inputs(ir_node *node);
 
 /**
- * Creates an ir_graph pass for running int function(ir_graph *irg).
- * Uses the default verifier and dumper.
- * The pass returns the return value of function.
- *
- * @param name      the name of this pass
- * @param verify    should this pass be verified?
- * @param dump      should this pass result be dumped?
- * @param function  the function to run
- *
- * @return  the newly created ir_graph pass
- */
-ir_graph_pass_t *def_graph_pass_ret(
-       const char *name, int verify, int dump,
-       int (*function)(ir_graph *irg));
-
-/**
- * Creates an ir_prog pass for running void function().
- * Uses the default verifier and dumper.
- * The pass returns always 0.
+ * @deprecated
+ * Copies a node to a new irg. The Ins of the new node point to
+ * the predecessors on the old irg.  n->link points to the new node.
  *
- * @param name      the name of this pass
- * @param verify    should this pass be verified?
- * @param dump      should this pass result be dumped?
- * @param function  the function to run
+ * @param n    The node to be copied
+ * @param irg  the new irg
  *
- * @return  the newly created ir_graph pass
+ * Does NOT copy standard nodes like Start, End etc that are fixed
+ * in an irg. Instead, the corresponding nodes of the new irg are returned.
+ * Note further, that the new nodes have no block.
  */
-ir_prog_pass_t *def_prog_pass(
-       const char *name, int verify, int dump,
-       void (*function)(void));
+void copy_irn_to_irg(ir_node *n, ir_graph *irg);
 
 #endif