X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fia32%2Fia32_new_nodes.c;h=e509b2179dec110ed5b3eeff196c04c3c46e57eb;hb=a1a465eb2b3f54027b29f829423fffd0396937f4;hp=43e01692ffee4038e4127309fbaf0464dd05e505;hpb=d2a666fcdf613a561e58e53ce330d1b19981bf0b;p=libfirm diff --git a/ir/be/ia32/ia32_new_nodes.c b/ir/be/ia32/ia32_new_nodes.c index 43e01692f..e509b2179 100644 --- a/ir/be/ia32/ia32_new_nodes.c +++ b/ir/be/ia32/ia32_new_nodes.c @@ -976,7 +976,7 @@ void set_ia32_out_req_all(ir_node *node, const ia32_register_req_t **reqs) { */ const ia32_register_req_t *get_ia32_in_req(const ir_node *node, int pos) { ia32_attr_t *attr = get_ia32_attr(node); - return attr->in_req[pos]; + return attr->in_req != NULL ? attr->in_req[pos] : NULL; } /** @@ -984,7 +984,7 @@ const ia32_register_req_t *get_ia32_in_req(const ir_node *node, int pos) { */ const ia32_register_req_t *get_ia32_out_req(const ir_node *node, int pos) { ia32_attr_t *attr = get_ia32_attr(node); - return attr->out_req[pos]; + return attr->out_req != NULL ? attr->out_req[pos] : NULL; } /** @@ -1075,6 +1075,23 @@ void set_ia32_pncode(ir_node *node, long code) { attr->pn_code = code; } +/** + * Sets the flags for the n'th out. + */ +void set_ia32_out_flags(ir_node *node, arch_irn_flags_t flags, int pos) { + ia32_attr_t *attr = get_ia32_attr(node); + assert(pos < (int) attr->data.n_res && "Invalid OUT position."); + attr->out_flags[pos] = flags; +} + +/** + * Gets the flags for the n'th out. + */ +arch_irn_flags_t get_ia32_out_flags(const ir_node *node, int pos) { + ia32_attr_t *attr = get_ia32_attr(node); + return pos < (int)attr->data.n_res ? attr->out_flags[pos] : arch_irn_flags_none; +} + #ifndef NDEBUG /** @@ -1288,7 +1305,6 @@ int is_ia32_Cnst(const ir_node *node) { const char *get_ia32_out_reg_name(const ir_node *node, int pos) { ia32_attr_t *attr = get_ia32_attr(node); - assert(is_ia32_irn(node) && "Not an ia32 node."); assert(pos < (int) attr->data.n_res && "Invalid OUT position."); assert(attr->slots[pos] && "No register assigned"); @@ -1301,7 +1317,6 @@ const char *get_ia32_out_reg_name(const ir_node *node, int pos) { int get_ia32_out_regnr(const ir_node *node, int pos) { ia32_attr_t *attr = get_ia32_attr(node); - assert(is_ia32_irn(node) && "Not an ia32 node."); assert(pos < (int) attr->data.n_res && "Invalid OUT position."); assert(attr->slots[pos] && "No register assigned"); @@ -1314,7 +1329,6 @@ int get_ia32_out_regnr(const ir_node *node, int pos) { const arch_register_t *get_ia32_out_reg(const ir_node *node, int pos) { ia32_attr_t *attr = get_ia32_attr(node); - assert(is_ia32_irn(node) && "Not an ia32 node."); assert(pos < (int) attr->data.n_res && "Invalid OUT position."); assert(attr->slots[pos] && "No register assigned"); @@ -1333,6 +1347,9 @@ void init_ia32_attributes(ir_node *node, arch_irn_flags_t flags, const ia32_regi set_ia32_out_req_all(node, out_reqs); set_ia32_latency(node, latency); + attr->out_flags = NEW_ARR_D(int, get_irg_obstack(get_irn_irg(node)), n_res); + memset(attr->out_flags, 0, n_res * sizeof(attr->out_flags[0])); + attr->data.n_res = n_res; memset((void *)attr->slots, 0, n_res * sizeof(attr->slots[0])); }