Rimproved interface to type array.
[libfirm] / ir / tr / entity.c
index 7b8255b..f54ee06 100644 (file)
@@ -51,12 +51,12 @@ new_entity (type *owner, ident *name, type *type)
     add_struct_member (owner, res);
   } break;
   case tpo_union: {
-    /* not implemented */
+    add_union_member (owner, res);
   } break;
-  case tpo_method: {
-    /* not implemented */
+  case tpo_array: {
+    set_array_element_entity(owner, res);
   } break;
-  default: ;
+  default: assert(0);
   }
 
   return res;
@@ -94,8 +94,9 @@ inline void   /* should this go into type.c? */
 assert_legal_owner_of_ent(type *owner) {
   assert (get_type_tpop_code(owner) == tpo_class ||
           get_type_tpop_code(owner) == tpo_union ||
-          get_type_tpop_code(owner) == tpo_array ||
-          get_type_tpop_code(owner) == tpo_method );
+          get_type_tpop_code(owner) == tpo_struct ||
+         get_type_tpop_code(owner) == tpo_array);   /* Yes, array has an entity
+                                                       -- to select fields! */
 }
 
 inline ident *