- BugFix of the last fix ...
[libfirm] / ir / ir / irnode.c
index 45f56fd..d98b1de 100644 (file)
@@ -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;
@@ -3104,6 +3094,18 @@ ir_entity *get_Global_entity(const ir_node *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) {