/**
* This file implements the creation of the achitecture specific firm opcodes
- * and the coresponding node constructors for the $arch assembler irg.
+ * and the coresponding node constructors for the ia32 assembler irg.
* @author Christian Wuerdig
* $Id$
*/
return NULL;
}
+ if (! attr->plain_offs)
+ attr->plain_offs = (struct obstack *)_new_arr_d(get_irg_obstack(get_irn_irg(node)), 1, sizeof(*(attr->plain_offs)));
+ else
+ obstack_free(attr->plain_offs, NULL);
+
+ obstack_init(attr->plain_offs);
+
size = obstack_object_size(attr->am_offs);
if (size > 0) {
- res = xmalloc(size + 2);
+ res = obstack_alloc(attr->plain_offs, size + 2);
res[0] = attr->data.offs_sign ? '-' : '+';
memcpy(&res[1], obstack_base(attr->am_offs), size);
res[size + 1] = '\0';
if (! attr->am_offs) {
/* obstack is not initialized */
- attr->am_offs = xcalloc(1, sizeof(*(attr->am_offs)));
+ attr->am_offs = (struct obstack *)_new_arr_d(get_irg_obstack(get_irn_irg(node)), 1, sizeof(*(attr->am_offs)));
obstack_init(attr->am_offs);
attr->data.offs_sign = (op == '-') ? 1 : 0;
*/
void set_ia32_Const_attr(ir_node *ia32_cnst, ir_node *cnst) {
ia32_attr_t *attr = get_ia32_attr(ia32_cnst);
+ ir_mode *mode;
assert(is_ia32_Cnst(ia32_cnst) && "Need ia32_Const to set Const attr");
case iro_Const:
attr->data.tp = ia32_Const;
attr->cnst_val.tv = get_Const_tarval(cnst);
+ mode = get_tarval_mode(attr->cnst_val.tv);
+ if (mode_is_reference(mode) &&
+ get_mode_null(mode) == attr->cnst_val.tv)
+ attr->cnst_val.tv = get_mode_null(mode_Is);
attr->cnst = get_ident_for_tv(attr->cnst_val.tv);
break;
case iro_SymConst: