X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fir%2Firnode.c;h=d98b1dec749488fddce38e83c5c9daf54da75c41;hb=672b5c243e900427b5dcae01441d4fa3327d692c;hp=b3ebc104bea992f814dd83d6ef76e4ae22034b08;hpb=136719e8b6d00cc17b1c7837d1587f14b3abc31d;p=libfirm diff --git a/ir/ir/irnode.c b/ir/ir/irnode.c index b3ebc104b..d98b1dec7 100644 --- a/ir/ir/irnode.c +++ b/ir/ir/irnode.c @@ -154,8 +154,8 @@ new_ir_node(dbg_info *db, ir_graph *irg, ir_node *block, ir_op *op, ir_mode *mod if (arity < 0) { res->in = NEW_ARR_F(ir_node *, 1); /* 1: space for block */ } else { - /* not nice but necessary: End must always have a flexible array */ - if (op == op_End) + /* not nice but necessary: End and Sync must always have a flexible array */ + if (op == op_End || op == op_Sync) res->in = NEW_ARR_F(ir_node *, (arity+1)); else res->in = NEW_ARR_D(ir_node *, irg->obst, (arity+1)); @@ -649,22 +649,10 @@ ir_type *is_frame_pointer(const ir_node *n) { return NULL; } -/* Test whether arbitrary node is globals pointer, i.e. Proj(pn_Start_P_globals) - * from Start. If so returns global type, else Null. */ -ir_type *is_globals_pointer(const ir_node *n) { - if (is_Proj(n) && (get_Proj_proj(n) == pn_Start_P_globals)) { - ir_node *start = get_Proj_pred(n); - if (is_Start(start)) { - return get_glob_type(); - } - } - return NULL; -} - /* Test whether arbitrary node is tls pointer, i.e. Proj(pn_Start_P_tls) * from Start. If so returns tls type, else Null. */ ir_type *is_tls_pointer(const ir_node *n) { - if (is_Proj(n) && (get_Proj_proj(n) == pn_Start_P_globals)) { + if (is_Proj(n) && (get_Proj_proj(n) == pn_Start_P_tls)) { ir_node *start = get_Proj_pred(n); if (is_Start(start)) { return get_tls_type(); @@ -1112,13 +1100,13 @@ set_Const_type(ir_node *node, ir_type *tp) { symconst_kind get_SymConst_kind(const ir_node *node) { assert(node->op == op_SymConst); - return node->attr.symc.num; + return node->attr.symc.kind; } void -set_SymConst_kind(ir_node *node, symconst_kind num) { +set_SymConst_kind(ir_node *node, symconst_kind kind) { assert(node->op == op_SymConst); - node->attr.symc.num = num; + node->attr.symc.kind = kind; } ir_type * @@ -3084,6 +3072,8 @@ dbg_info *(get_irn_dbg_info)(const ir_node *n) { return _get_irn_dbg_info(n); } +#if 0 /* allow the global pointer */ + /* checks whether a node represents a global address */ int is_Global(const ir_node *node) { ir_node *ptr; @@ -3098,12 +3088,24 @@ int is_Global(const ir_node *node) { } /* returns the entity of a global address */ -ir_entity *get_Global_ent(const ir_node *node) { +ir_entity *get_Global_entity(const ir_node *node) { if (is_SymConst(node)) return get_SymConst_entity(node); else return get_Sel_entity(node); } +#else + +/* checks whether a node represents a global address */ +int is_Global(const ir_node *node) { + return is_SymConst_addr_ent(node); +} + +/* returns the entity of a global address */ +ir_entity *get_Global_entity(const ir_node *node) { + return get_SymConst_entity(node); +} +#endif #ifdef DEBUG_libfirm void dump_irn(const ir_node *n) {