rename type entity into ir_entity
[libfirm] / ir / ana / irdom.h
index 3806135..38307fe 100644 (file)
@@ -129,6 +129,28 @@ ir_node *get_Block_dominated_next(const ir_node *dom);
  */
 int block_dominates(const ir_node *a, const ir_node *b);
 
+/**
+ * Returns the smallest common dominator block of two nodes.
+ * @param a A node.
+ * @param b Another node.
+ * @return The first block dominating @p a and @p b
+ */
+ir_node *node_smallest_common_dominator(ir_node *a, ir_node *b);
+
+/**
+ * Returns the smallest common dominator block of all users of a node
+ * BEWARE: @p irn must not be a block
+ * If on or more users are Phi nodes, one can request special handling
+ * with @p handle_phi = 1.  In this case the cfg predecessor block
+ * corresponding to the position of the irn in the argument list of the
+ * Phi is determined and treated as user.
+ *
+ * @param irn        A node.
+ * @param handle_phi 1 if Phis should be handled different
+ * @return The first block dominating all users of @irn
+ */
+ir_node *node_users_smallest_common_dominator(ir_node *irn, int handle_phi);
+
 /**
  * Check, if a block post dominates another block.
  * @param a The first block.
@@ -200,6 +222,9 @@ void postdom_tree_walk_irg(ir_graph *irg, irg_walk_func *pre,
  */
 void compute_doms(ir_graph *irg);
 
+/** Computes the dominator trees on demand */
+void assure_doms(ir_graph *irg);
+
 /** Computes the post dominator trees.
  *
  * Sets a flag in irg to "dom_consistent".
@@ -217,6 +242,9 @@ void compute_doms(ir_graph *irg);
  */
 void compute_postdoms(ir_graph *irg);
 
+/** Computes the dominator trees on demand */
+void assure_postdoms(ir_graph *irg);
+
 /** Frees the dominator data structures.  Sets the flag in irg to "dom_none". */
 void free_dom(ir_graph *irg);