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));
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();
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 *
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;
}
/* 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) {