Commit 31f34dc0 authored by Christian Würdig's avatar Christian Würdig
Browse files

added function to get a user Proj with a certain proj num from a mode_T node

parent 6be08f9b
......@@ -20,6 +20,7 @@
#include "irgopt.h"
#include "irtools.h"
#include "irprintf.h"
#include "iredges.h"
#include "beutil.h"
#include "besched_t.h"
......@@ -225,3 +226,21 @@ ir_node *dom_up_search(pset *accept, ir_node *start_point_exclusive) {
else
return NULL; /* this was the start block and we did not find an acceptable irn */
}
/**
* Gets the Proj with number pn from irn.
*/
ir_node *be_get_Proj_for_pn(const ir_node *irn, long pn) {
const ir_edge_t *edge;
ir_node *proj;
assert(get_irn_mode(irn) == mode_T && "need mode_T");
foreach_out_edge(irn, edge) {
proj = get_edge_src_irn(edge);
if (get_Proj_proj(proj) == pn)
return proj;
}
return NULL;
}
......@@ -132,4 +132,9 @@ void be_kill_node(ir_node *irn);
*/
ir_node *dom_up_search(pset *accept, ir_node *start_point_exclusive);
/**
* Gets the Proj with number pn from irn.
*/
ir_node *be_get_Proj_for_pn(const ir_node *irn, long pn);
#endif /* _BEUTIL_H */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment