+/**
+ * Contains some useful function for the backend.
+ * @author Sebastian Hack
+ * @cvsid $Id$
+ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
irg_walk_graph(irg, collect_phis, NULL, NULL);
}
+unsigned count_num_reachable_nodes(ir_node *irn, void *env) {
+ int *num = env;
+ (*num)++;
+}
+
+unsigned get_num_reachable_nodes(ir_graph *irg) {
+ int num = 0;
+ irg_walk_graph(irg, count_num_reachable_nodes, NULL, &num);
+ return num;
+}
+
/* FIXME: not used. can be deleted? */
ir_node *dom_up_search(pset *accept, ir_node *start_point_exclusive) {
ir_node *irn, *idom;
*/
void be_dump(ir_graph *irg, const char *suffix, void (*dumper)(ir_graph *, const char *));
+/**
+ * Returns the number of reachable nodes in an irg.
+ * @param irg The irg.
+ * @return The number of reachable nodes.
+ */
+unsigned get_num_reachable_nodes(ir_graph *irg);
+
/**
* Search for an irn in @p accept.
* The search is started at @p start_point_exclusive and continues upwards the dom-tree