2 * Contains implementation of some useful functions for ia32 backend.
3 * @author Christian Wuerdig
15 #include "ia32_util.h"
18 * Returns the first Proj with given mode connected to irn.
20 * @param First proj with mode == mode or NULL if none found
22 ir_node *ia32_get_proj_for_mode(const ir_node *irn, ir_mode *mode) {
23 const ir_edge_t *edge;
26 assert(get_irn_mode(irn) == mode_T && "expected mode_T node");
28 foreach_out_edge(irn, edge) {
29 src = get_edge_src_irn(edge);
31 assert(is_Proj(src) && "Proj expected");
33 if (get_irn_mode(src) == mode_M)
41 * Returns the first Proj with mode != mode_M connected to irn.
43 * @param First proj with mode != mode_M or NULL if none found
45 ir_node *ia32_get_res_proj(const ir_node *irn) {
46 const ir_edge_t *edge;
49 assert(get_irn_mode(irn) == mode_T && "expected mode_T node");
51 foreach_out_edge(irn, edge) {
52 src = get_edge_src_irn(edge);
54 assert(is_Proj(src) && "Proj expected");
56 if (get_irn_mode(src) != mode_M)