struct types still require names.
[libfirm] / ir / tr / entity_t.h
index c93d7b0..a3f46ca 100644 (file)
@@ -18,7 +18,7 @@
  */
 
 /*
- * @file     entity_t.h
+ * @file
  * @brief   Representation of all program known entities -- private header.
  * @author  Martin Trapp, Christian Schaefer, Goetz Lindenmaier, Michael Beck
  * @version $Id$
 
 #include <assert.h>
 
-#include "firm_common_t.h"
-
 #include "typerep.h"
 #include "type_t.h"
 #include "ident.h"
 #include "pseudo_irg.h"
+#include "compound_path.h"
 
 typedef struct ir_initializer_base_t {
        ir_initializer_kind_t kind;
@@ -72,18 +71,6 @@ union ir_initializer_t {
        ir_initializer_tarval_t    tarval;
 };
 
-/** A path in a compound graph. */
-struct compound_graph_path {
-       firm_kind kind;       /**< The dynamic type tag for compound graph path. */
-       ir_type *tp;          /**< The type this path belongs to. */
-       int len;              /**< The length of the path. */
-       struct tuple {
-               int       index;    /**< Array index.  To compute position of array elements */
-               ir_entity *node;    /**< The accessed entity. */
-       } list[1];            /**< List of entity/index tuple of length len to express the
-                                  access path. */
-};
-
 /** The attributes for atomic entities. */
 typedef struct atomic_ent_attr {
        ir_node *value;            /**< value if entity is not of variability uninitialized.
@@ -117,6 +104,11 @@ typedef struct method_ent_attr {
                                            with a high weight are good candidates for procedure cloning. */
 } method_ent_attr;
 
+/** additional attributes for code entities */
+typedef struct code_ent_attr {
+       ir_label_t  label;       /** label of the basic block */
+} code_ent_attr;
+
 
 /**
  * An abstract data type to represent program entities.
@@ -173,6 +165,8 @@ struct ir_entity {
                compound_ent_attr cmpd_attr;
                /* ------------- fields for method entities ---------------- */
                method_ent_attr   mtd_attr;
+               /* fields for code entities */
+               code_ent_attr     code_attr;
                /* entity initializer */
                ir_initializer_t *initializer;
        } attr; /**< type specific attributes */
@@ -215,7 +209,7 @@ _set_entity_ident(ir_entity *ent, ident *id) {
 static inline ir_type *
 _get_entity_owner(ir_entity *ent) {
        assert(ent && ent->kind == k_entity);
-       return ent->owner = skip_tid(ent->owner);
+       return ent->owner;
 }
 
 static inline ident *
@@ -242,7 +236,7 @@ _get_entity_ld_name(ir_entity *ent) {
 static inline ir_type *
 _get_entity_type(ir_entity *ent) {
        assert(ent && ent->kind == k_entity);
-       return ent->type = skip_tid(ent->type);
+       return ent->type;
 }
 
 static inline void