-
- /* ------------- fields for compound entities ---------------*/
-
- ir_node **values; /**< constant values of compound entities. Only available if
- variablility not uninitialized. Must be set for variability constant
- */
- compound_graph_path **val_paths; /**< paths corresponding to constant values. Only available if
- variablility not uninitialized. Must be set for variability constant */
-
- /* ------------- fields for entities owned by a class type ---------------*/
-
- entity **overwrites; /**< A list of entities this entity overwrites. */
- entity **overwrittenby; /**< A list of entities that overwrite this entity. */
-
- /* ------------- fields for methods ---------------*/
-
- enum peculiarity peculiarity;
- ir_graph *irg; /**< If (type == method_type) this is the corresponding irg.
- The ir_graph constructor automatically sets this field.
- Yes, it must be here. */
-
- /* ------------- fields for analyses ---------------*/
-
+} atomic_ent_attr;
+
+/** The attributes for compound entities. */
+typedef struct compound_ent_attr {
+ ir_node **values; /**< constant values of compound entities. Only available if
+ variability not uninitialized. Must be set for variability constant. */
+ compound_graph_path **val_paths;
+ /**< paths corresponding to constant values. Only available if
+ variability not uninitialized. Must be set for variability constant. */
+} compound_ent_attr;
+
+/** A reserved value for "not yet set". */
+#define VTABLE_NUM_NOT_SET ((unsigned)(-1))
+
+/** The attributes for methods. */
+typedef struct method_ent_attr {
+ ir_graph *irg; /**< The corresponding irg if known.
+ The ir_graph constructor automatically sets this field. */
+ unsigned irg_add_properties; /**< Additional graph properties can be
+ stored in a entity if no irg is available. */
+
+ unsigned vtable_number; /**< For a dynamically called method, the number assigned
+ in the virtual function table. */
+
+ ptr_access_kind *param_access; /**< the parameter access */
+ float *param_weight; /**< The weight of method's parameters. Parameters
+ with a high weight are good for procedure cloning. */
+ ir_img_section section; /**< The code section where this method should be placed */
+} method_ent_attr;
+
+
+/** The type of an entity. */
+struct ir_entity {
+ firm_kind kind; /**< The dynamic type tag for entity. */
+ ident *name; /**< The name of this entity. */
+ ident *ld_name; /**< Unique name of this entity, i.e., the mangled
+ name. If the field is read before written a default
+ mangling is applies. The name of the owner is prepended
+ to the name of the entity, separated by a underscore.
+ E.g., for a class `A' with field `a' this
+ is the ident for `A_a'. */
+ ir_type *type; /**< The type of this entity, e.g., a method type, a
+ basic type of the language or a class itself. */
+ ir_type *owner; /**< The compound type (e.g. class type) this entity belongs to. */
+ ir_allocation allocation:3; /**< Distinguishes static and dynamically allocated
+ entities and some further cases. */
+ ir_visibility visibility:3; /**< Specifies visibility to external program
+ fragments. */
+ ir_variability variability:3; /**< Specifies variability of entities content. */
+ ir_volatility volatility:2; /**< Specifies volatility of entities content. */
+ ir_stickyness stickyness:2; /**< Specifies whether this entity is sticky. */
+ ir_peculiarity peculiarity:3; /**< The peculiarity of this entity. */
+ unsigned final:1; /**< If set, this entity cannot be overridden. */
+ unsigned compiler_gen:1; /**< If set, this entity was compiler generated. */
+ int offset; /**< Offset in bytes for this entity. Fixed when layout
+ of owner is determined. */
+ unsigned char offset_bit_remainder;
+ /**< If the entity is a bit field, this is the offset of
+ the start of the bit field within the byte specified
+ by offset. */
+ unsigned long visit; /**< visited counter for walks of the type information. */
+ struct dbg_info *dbi; /**< A pointer to information for debug support. */
+ void *link; /**< To store some intermediate information. */
+ ir_type *repr_class; /**< If this entity represents a class info, the associated class. */
+
+ /* ------------- fields for entities owned by a class type ---------------*/
+
+ ir_entity **overwrites; /**< A list of entities this entity overwrites. */
+ ir_entity **overwrittenby; /**< A list of entities that overwrite this entity. */
+
+ /* ------------- fields for atomic entities --------------- */
+ ir_node *value; /**< value if entity is not of variability uninitialized.
+ Only for atomic entities. */
+ union {
+ /* ------------- fields for compound entities -------------- */
+ compound_ent_attr cmpd_attr;
+ /* ------------- fields for method entities ---------------- */
+ method_ent_attr mtd_attr;
+ } attr; /**< type specific attributes */
+
+ /* ------------- fields for analyses ---------------*/