used new get_irn_pinned() fucntion
[libfirm] / ir / tr / type_t.h
index 4c52c8d..6accd23 100644 (file)
@@ -126,6 +126,10 @@ struct type {
   void *link;              /**< holds temporary data - like in irnode_t.h */
   struct dbg_info* dbi;    /**< A pointer to information for debug support. */
 
+  /* ------------- fields for analyses ---------------*/
+  ir_node **allocations;    /**< array of all Alloc nodes with this type
+                             @@@ Should not be in here, hash table! */
+
 #ifdef DEBUG_libfirm
   int nr;             /**< a unique node number for each node to make output
                              readable. */
@@ -250,6 +254,8 @@ __get_type_size_bits(type *tp) {
 static INLINE int
 __get_type_size_bytes(type *tp) {
   int size = __get_type_size_bits(tp);
+  if (size < 0)
+    return -1;
   if ((size & 7) != 0) {
     assert(0 && "cannot take byte size of this type");
     return -1;
@@ -308,14 +314,14 @@ __is_class_type(type *clss) {
 static INLINE int
 __get_class_n_members (type *clss) {
   assert(clss && (clss->type_op == type_class));
-  return (ARR_LEN (clss->attr.ca.members))-1;
+  return (ARR_LEN (clss->attr.ca.members));
 }
 
 static INLINE entity *
 __get_class_member   (type *clss, int pos) {
   assert(clss && (clss->type_op == type_class));
   assert(pos >= 0 && pos < get_class_n_members(clss));
-  return clss->attr.ca.members[pos+1];
+  return clss->attr.ca.members[pos];
 }
 
 static INLINE int