2 * Contains implementation of some useful functions for ia32 backend.
3 * @author Christian Wuerdig
12 #include "ia32_util.h"
15 * Returns the first Proj with given mode connected to irn.
17 * @param First proj with mode == mode or NULL if none found
19 ir_node *ia32_get_proj_for_mode(const ir_node *irn, ir_mode *mode) {
20 const ir_edge_t *edge;
23 assert(get_irn_mode(irn) == mode_T && "expected mode_T node");
25 foreach_out_edge(irn, edge) {
26 src = get_edge_src_irn(edge);
28 assert(is_Proj(src) && "Proj expected");
30 if (get_irn_mode(src) == mode_M)
38 * Returns the first Proj with mode != mode_M connected to irn.
40 * @param First proj with mode != mode_M or NULL if none found
42 ir_node *ia32_get_res_proj(const ir_node *irn) {
43 const ir_edge_t *edge;
46 assert(get_irn_mode(irn) == mode_T && "expected mode_T node");
48 foreach_out_edge(irn, edge) {
49 src = get_edge_src_irn(edge);
51 assert(is_Proj(src) && "Proj expected");
53 if (get_irn_mode(src) != mode_M)